home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1134 < prev    next >
Internet Message Format  |  1990-12-28  |  37KB

  1. From: howard@hasse.ericsson.se (Howard Gayle)
  2. Newsgroups: alt.sources
  3. Subject: GNU Emacs 8-bit mods part 07 of 12
  4. Message-ID: <1990Apr5.133859.8993@ericsson.se>
  5. Date: 5 Apr 90 13:38:59 GMT
  6.  
  7. *** ../18.55/src/regex.c    Thu Aug 18 20:24:38 1988
  8. --- src/regex.c    Thu Apr  5 09:15:22 1990
  9. ***************
  10. *** 1,5 ****
  11.   /* Extended regular expression matching and search.
  12. !    Copyright (C) 1985 Free Software Foundation, Inc.
  13.   
  14.                  NO WARRANTY
  15.   
  16. --- 1,5 ----
  17.   /* Extended regular expression matching and search.
  18. !    Copyright (C) 1985, 1990 Free Software Foundation, Inc.
  19.   
  20.                  NO WARRANTY
  21.   
  22. ***************
  23. *** 103,108 ****
  24. --- 103,112 ----
  25.   what you give them.   Help stamp out software-hoarding!  */
  26.   
  27.   
  28. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  29. +  *  See chartab.c for details. */
  30.   /* To test, compile with -Dtest.
  31.    This Dtestable feature turns this into a self-contained program
  32.    which reads a pattern, describes how it compiles,
  33. ***************
  34. *** 117,122 ****
  35. --- 121,127 ----
  36.   #include "config.h"
  37.   #include "lisp.h"
  38.   #include "buffer.h"
  39. + #include "sorttab.h"
  40.   #include "syntax.h"
  41.   
  42.   #else  /* not emacs */
  43. ***************
  44. *** 218,242 ****
  45.     after re_compile_pattern returns.
  46.   */
  47.   
  48. ! #define PATPUSH(ch) (*b++ = (char) (ch))
  49.   
  50.   #define PATFETCH(c) \
  51.    {if (p == pend) goto end_of_pattern; \
  52. !   c = * (unsigned char *) p++; \
  53. !   if (translate) c = translate[c]; }
  54. ! #define PATFETCH_RAW(c) \
  55. !  {if (p == pend) goto end_of_pattern; \
  56. !   c = * (unsigned char *) p++; }
  57.   
  58.   #define PATUNFETCH p--
  59.   
  60.   #define EXTEND_BUFFER \
  61. !   { char *old_buffer = bufp->buffer; \
  62.       if (bufp->allocated == (1<<16)) goto too_big; \
  63.       bufp->allocated *= 2; \
  64.       if (bufp->allocated > (1<<16)) bufp->allocated = (1<<16); \
  65. !     if (!(bufp->buffer = (char *) realloc (bufp->buffer, bufp->allocated))) \
  66.         goto memory_exhausted; \
  67.       c = bufp->buffer - old_buffer; \
  68.       b += c; \
  69. --- 223,242 ----
  70.     after re_compile_pattern returns.
  71.   */
  72.   
  73. ! #define PATPUSH(ch) (*b++ = (unsigned char) (ch))
  74.   
  75.   #define PATFETCH(c) \
  76.    {if (p == pend) goto end_of_pattern; \
  77. !   c = *p++; }
  78.   
  79.   #define PATUNFETCH p--
  80.   
  81.   #define EXTEND_BUFFER \
  82. !   { unsigned char *old_buffer = bufp->buffer; \
  83.       if (bufp->allocated == (1<<16)) goto too_big; \
  84.       bufp->allocated *= 2; \
  85.       if (bufp->allocated > (1<<16)) bufp->allocated = (1<<16); \
  86. !     if (!(bufp->buffer = (unsigned char *) realloc (bufp->buffer, bufp->allocated))) \
  87.         goto memory_exhausted; \
  88.       c = bufp->buffer - old_buffer; \
  89.       b += c; \
  90. ***************
  91. *** 251,274 ****
  92.   
  93.   static int store_jump (), insert_jump ();
  94.   
  95.   char *
  96.   re_compile_pattern (pattern, size, bufp)
  97. !      char *pattern;
  98.        int size;
  99.        struct re_pattern_buffer *bufp;
  100.   {
  101. !   register char *b = bufp->buffer;
  102. !   register char *p = pattern;
  103. !   char *pend = pattern + size;
  104.     register unsigned c, c1;
  105. !   char *p1;
  106. !   unsigned char *translate = (unsigned char *) bufp->translate;
  107.   
  108.     /* address of the count-byte of the most recently inserted "exactn" command.
  109.       This makes it possible to tell whether a new exact-match character
  110.       can be added to that command or requires a new "exactn" command. */
  111.        
  112. !   char *pending_exact = 0;
  113.   
  114.     /* address of the place where a forward-jump should go
  115.       to the end of the containing expression.
  116. --- 251,691 ----
  117.   
  118.   static int store_jump (), insert_jump ();
  119.   
  120. + #ifdef emacs
  121. + void
  122. + set_bits (b, c, st)
  123. + register unsigned char *b;
  124. + register int c;
  125. + register struct Lisp_Sorttab *st;
  126. + {
  127. + register int i;
  128. + register int hi;
  129. + register int ec;
  130. + if (st == NULL_SORT_TABLE)
  131. +    b[c / BYTEWIDTH] |= 1 << (c % BYTEWIDTH);
  132. + else
  133. +    {
  134. +    ec = st->srt_ec[c];
  135. +    hi = st->srt_dope[ec].ec_hi;
  136. +    for (i = st->srt_dope[ec].ec_lo; i <= hi; ++i)
  137. +       {
  138. +       c = st->srt_chars[i];
  139. +       b[c / BYTEWIDTH] |= 1 << (c % BYTEWIDTH);
  140. +       }
  141. +    }
  142. + }
  143. + char *
  144. + re_compile_pattern_sort (pattern, size, bufp, sorttab)
  145. +      unsigned char *pattern;
  146. +      int size;
  147. +      struct re_pattern_buffer *bufp;
  148. +      struct Lisp_Sorttab *sorttab;
  149. + {
  150. +   register unsigned char *b = bufp->buffer;
  151. +   register unsigned char *p = pattern;
  152. +   unsigned char *pend = pattern + size;
  153. +   register unsigned c, c1;
  154. +   unsigned char *p1;
  155. +   /* address of the count-byte of the most recently inserted "exactn" command.
  156. +     This makes it possible to tell whether a new exact-match character
  157. +     can be added to that command or requires a new "exactn" command. */
  158. +      
  159. +   unsigned char *pending_exact = 0;
  160. +   /* address of the place where a forward-jump should go
  161. +     to the end of the containing expression.
  162. +     Each alternative of an "or", except the last, ends with a forward-jump
  163. +     of this sort. */
  164. +   unsigned char *fixup_jump = 0;
  165. +   /* address of start of the most recently finished expression.
  166. +     This tells postfix * where to find the start of its operand. */
  167. +   unsigned char *laststart = 0;
  168. +   /* In processing a repeat, 1 means zero matches is allowed */
  169. +   unsigned char zero_times_ok;
  170. +   /* In processing a repeat, 1 means many matches is allowed */
  171. +   unsigned char many_times_ok;
  172. +   /* address of beginning of regexp, or inside of last \( */
  173. +   unsigned char *begalt = b;
  174. +   /* Stack of information saved by \( and restored by \).
  175. +      Four stack elements are pushed by each \(:
  176. +        First, the value of b.
  177. +        Second, the value of fixup_jump.
  178. +        Third, the value of regnum.
  179. +        Fourth, the value of begalt.  */
  180. +   int stackb[40];
  181. +   int *stackp = stackb;
  182. +   int *stacke = stackb + 40;
  183. +   int *stackt;
  184. +   /* Counts \('s as they are encountered.  Remembered for the matching \),
  185. +      where it becomes the "register number" to put in the stop_memory command */
  186. +   int regnum = 1;
  187. +   bufp->fastmap_accurate = 0;
  188. +   if (bufp->allocated == 0)
  189. +     {
  190. +       bufp->allocated = 28;
  191. +       if (bufp->buffer)
  192. +     /* EXTEND_BUFFER loses when bufp->allocated is 0 */
  193. +     bufp->buffer = (unsigned char *) realloc (bufp->buffer, 28);
  194. +       else
  195. +     /* Caller did not allocate a buffer.  Do it for him */
  196. +     bufp->buffer = (unsigned char *) malloc (28);
  197. +       if (!bufp->buffer) goto memory_exhausted;
  198. +       begalt = b = bufp->buffer;
  199. +     }
  200. +   while (p != pend)
  201. +     {
  202. +       if (b - bufp->buffer > bufp->allocated - 10)
  203. +     /* Note that EXTEND_BUFFER clobbers c */
  204. +     EXTEND_BUFFER;
  205. +       PATFETCH (c);
  206. +       switch (c)
  207. +     {
  208. +     case '$':
  209. +       /* $ means succeed if at end of line, but only in special contexts.
  210. +         If randonly in the middle of a pattern, it is a normal character. */
  211. +       if (p == pend || (*p == '\\' && (p[1] == ')' || p[1] == '|')))
  212. +         {
  213. +           PATPUSH (endline);
  214. +           break;
  215. +         }
  216. +       goto normal_char;
  217. +     case '^':
  218. +       /* ^ means succeed if at beg of line, but only if no preceding pattern. */
  219. +       if (laststart) goto normal_char;
  220. +       PATPUSH (begline);
  221. +       break;
  222. +     case '*':
  223. +     case '+':
  224. +     case '?':
  225. +       /* If there is no previous pattern, char not special. */
  226. +       if (!laststart)
  227. +         goto normal_char;
  228. +       /* If there is a sequence of repetition chars,
  229. +          collapse it down to equivalent to just one.  */
  230. +       zero_times_ok = 0;
  231. +       many_times_ok = 0;
  232. +       while (1)
  233. +         {
  234. +           zero_times_ok |= c != '+';
  235. +           many_times_ok |= c != '?';
  236. +           if (p == pend)
  237. +         break;
  238. +           PATFETCH (c);
  239. +           if (!(c == '*' || c == '+' || c == '?'))
  240. +         {
  241. +           PATUNFETCH;
  242. +           break;
  243. +         }
  244. +         }
  245. +       /* Now we know whether 0 matches is allowed,
  246. +          and whether 2 or more matches is allowed.  */
  247. +       if (many_times_ok)
  248. +         {
  249. +           /* If more than one repetition is allowed,
  250. +          put in a backward jump at the end.  */
  251. +           store_jump (b, maybe_finalize_jump, laststart - 3);
  252. +           b += 3;
  253. +         }
  254. +       insert_jump (on_failure_jump, laststart, b + 3, b);
  255. +       pending_exact = 0;
  256. +       b += 3;
  257. +       if (!zero_times_ok)
  258. +         {
  259. +           /* At least one repetition required: insert before the loop
  260. +          a skip over the initial on-failure-jump instruction */
  261. +           insert_jump (dummy_failure_jump, laststart, laststart + 6, b);
  262. +           b += 3;
  263. +         }
  264. +       break;
  265. +     case '.':
  266. +       laststart = b;
  267. +       PATPUSH (anychar);
  268. +       break;
  269. +     case '[':
  270. +       if (b - bufp->buffer
  271. +           > bufp->allocated - 3 - (1 << BYTEWIDTH) / BYTEWIDTH)
  272. +         /* Note that EXTEND_BUFFER clobbers c */
  273. +         EXTEND_BUFFER;
  274. +       laststart = b;
  275. +       if (*p == '^')
  276. +         PATPUSH (charset_not), p++;
  277. +       else
  278. +         PATPUSH (charset);
  279. +       p1 = p;
  280. +       PATPUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
  281. +       /* Clear the whole map */
  282. +       bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
  283. +       /* Read in characters and ranges, setting map bits */
  284. +       while (1)
  285. +         {
  286. +           PATFETCH (c);
  287. +           if (c == ']' && p != p1 + 1) break;
  288. +           if (*p == '-')
  289. +         {
  290. +           PATFETCH (c1);
  291. +           PATFETCH (c1);
  292. +           while (c <= c1)
  293. +             set_bits (b, c++, sorttab);
  294. +         }
  295. +           else
  296. +         set_bits (b, c, sorttab);
  297. +         }
  298. +       /* Discard any bitmap bytes that are all 0 at the end of the map.
  299. +          Decrement the map-length byte too. */
  300. +       while (b[-1] > 0 && b[b[-1] - 1] == 0)
  301. +         b[-1]--;
  302. +       b += b[-1];
  303. +       break;
  304. +         case '\\':
  305. +       if (p == pend) goto invalid_pattern;
  306. +       PATFETCH (c);
  307. +       switch (c)
  308. +         {
  309. +         case '(':
  310. +           if (stackp == stacke) goto nesting_too_deep;
  311. +           if (regnum < RE_NREGS)
  312. +             {
  313. +           PATPUSH (start_memory);
  314. +           PATPUSH (regnum);
  315. +             }
  316. +           *stackp++ = b - bufp->buffer;
  317. +           *stackp++ = fixup_jump ? fixup_jump - bufp->buffer + 1 : 0;
  318. +           *stackp++ = regnum++;
  319. +           *stackp++ = begalt - bufp->buffer;
  320. +           fixup_jump = 0;
  321. +           laststart = 0;
  322. +           begalt = b;
  323. +           break;
  324. +         case ')':
  325. +           if (stackp == stackb) goto unmatched_close;
  326. +           begalt = *--stackp + bufp->buffer;
  327. +           if (fixup_jump)
  328. +         store_jump (fixup_jump, jump, b);
  329. +           if (stackp[-1] < RE_NREGS)
  330. +         {
  331. +           PATPUSH (stop_memory);
  332. +           PATPUSH (stackp[-1]);
  333. +         }
  334. +           stackp -= 2;
  335. +           fixup_jump = 0;
  336. +           if (*stackp)
  337. +         fixup_jump = *stackp + bufp->buffer - 1;
  338. +           laststart = *--stackp + bufp->buffer;
  339. +           break;
  340. +         case '|':
  341. +           insert_jump (on_failure_jump, begalt, b + 6, b);
  342. +           pending_exact = 0;
  343. +           b += 3;
  344. +           if (fixup_jump)
  345. +         store_jump (fixup_jump, jump, b);
  346. +           fixup_jump = b;
  347. +           b += 3;
  348. +           laststart = 0;
  349. +           begalt = b;
  350. +           break;
  351. +         case '=':
  352. +           PATPUSH (at_dot);
  353. +           break;
  354. +         case 's':    
  355. +           laststart = b;
  356. +           PATPUSH (syntaxspec);
  357. +           PATFETCH (c);
  358. +           PATPUSH (syntax_spec_code[c]);
  359. +           break;
  360. +         case 'S':
  361. +           laststart = b;
  362. +           PATPUSH (notsyntaxspec);
  363. +           PATFETCH (c);
  364. +           PATPUSH (syntax_spec_code[c]);
  365. +           break;
  366. +         case 'w':
  367. +           laststart = b;
  368. +           PATPUSH (wordchar);
  369. +           break;
  370. +         case 'W':
  371. +           laststart = b;
  372. +           PATPUSH (notwordchar);
  373. +           break;
  374. +         case '<':
  375. +           PATPUSH (wordbeg);
  376. +           break;
  377. +         case '>':
  378. +           PATPUSH (wordend);
  379. +           break;
  380. +         case 'b':
  381. +           PATPUSH (wordbound);
  382. +           break;
  383. +         case 'B':
  384. +           PATPUSH (notwordbound);
  385. +           break;
  386. +         case '`':
  387. +           PATPUSH (begbuf);
  388. +           break;
  389. +         case '\'':
  390. +           PATPUSH (endbuf);
  391. +           break;
  392. +         case '1':
  393. +         case '2':
  394. +         case '3':
  395. +         case '4':
  396. +         case '5':
  397. +         case '6':
  398. +         case '7':
  399. +         case '8':
  400. +         case '9':
  401. +           c1 = c - '0';
  402. +           if (c1 >= regnum)
  403. +         goto normal_char;
  404. +           for (stackt = stackp - 2;  stackt > stackb;  stackt -= 4)
  405. +          if (*stackt == c1)
  406. +           goto normal_char;
  407. +           laststart = b;
  408. +           PATPUSH (duplicate);
  409. +           PATPUSH (c1);
  410. +           break;
  411. +         default:
  412. +           goto normal_char;
  413. +         }
  414. +       break;
  415. +     default:
  416. +     normal_char:
  417. +       if ((sorttab == NULL_SORT_TABLE) ||
  418. +           (sorttab->srt_dope[sorttab->srt_ec[c]].ec_lo ==
  419. +           sorttab->srt_dope[sorttab->srt_ec[c]].ec_hi))
  420. +         {
  421. +           if (!pending_exact || pending_exact + *pending_exact + 1 != b
  422. +               || *pending_exact == 0177 || *p == '*' || *p == '^'
  423. +               || *p == '+' || *p == '?')
  424. +             {
  425. +               laststart = b;
  426. +               PATPUSH (exactn);
  427. +               pending_exact = b;
  428. +               PATPUSH (0);
  429. +             }
  430. +           PATPUSH (c);
  431. +           (*pending_exact)++;
  432. +         }
  433. +       else
  434. +         {
  435. +           if (b - bufp->buffer
  436. +               > bufp->allocated - 3 - (1 << BYTEWIDTH) / BYTEWIDTH)
  437. +             /* Note that EXTEND_BUFFER clobbers c */
  438. +         {
  439. +           c1 = c;
  440. +               EXTEND_BUFFER;
  441. +           c = c1;
  442. +         }
  443. +           laststart = b;
  444. +           PATPUSH (charset);
  445. +           PATPUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
  446. +           /* Clear the whole map */
  447. +           bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
  448. +           set_bits (b, c, sorttab);
  449. +           /* Discard any bitmap bytes that are all 0 at the end of the map.
  450. +              Decrement the map-length byte too. */
  451. +           while (b[-1] > 0 && b[b[-1] - 1] == 0)
  452. +             b[-1]--;
  453. +           b += b[-1];
  454. +         }
  455. +     }
  456. +     }
  457. +   if (fixup_jump)
  458. +     store_jump (fixup_jump, jump, b);
  459. +   if (stackp != stackb) goto unmatched_open;
  460. +   bufp->used = b - bufp->buffer;
  461. +   return 0;
  462. +  invalid_pattern:
  463. +   return "Invalid regular expression";
  464. +  unmatched_open:
  465. +   return "Unmatched \\(";
  466. +  unmatched_close:
  467. +   return "Unmatched \\)";
  468. +  end_of_pattern:
  469. +   return "Premature end of regular expression";
  470. +  nesting_too_deep:
  471. +   return "Nesting too deep";
  472. +  too_big:
  473. +   return "Regular expression too big";
  474. +  memory_exhausted:
  475. +   return "Memory exhausted";
  476. + }
  477. + #else /* not emacs */
  478.   char *
  479.   re_compile_pattern (pattern, size, bufp)
  480. !      unsigned char *pattern;
  481.        int size;
  482.        struct re_pattern_buffer *bufp;
  483.   {
  484. !   register unsigned char *b = bufp->buffer;
  485. !   register unsigned char *p = pattern;
  486. !   unsigned char *pend = pattern + size;
  487.     register unsigned c, c1;
  488. !   unsigned char *p1;
  489.   
  490.     /* address of the count-byte of the most recently inserted "exactn" command.
  491.       This makes it possible to tell whether a new exact-match character
  492.       can be added to that command or requires a new "exactn" command. */
  493.        
  494. !   unsigned char *pending_exact = 0;
  495.   
  496.     /* address of the place where a forward-jump should go
  497.       to the end of the containing expression.
  498. ***************
  499. *** 275,298 ****
  500.       Each alternative of an "or", except the last, ends with a forward-jump
  501.       of this sort. */
  502.   
  503. !   char *fixup_jump = 0;
  504.   
  505.     /* address of start of the most recently finished expression.
  506.       This tells postfix * where to find the start of its operand. */
  507.   
  508. !   char *laststart = 0;
  509.   
  510.     /* In processing a repeat, 1 means zero matches is allowed */
  511.   
  512. !   char zero_times_ok;
  513.   
  514.     /* In processing a repeat, 1 means many matches is allowed */
  515.   
  516. !   char many_times_ok;
  517.   
  518.     /* address of beginning of regexp, or inside of last \( */
  519.   
  520. !   char *begalt = b;
  521.   
  522.     /* Stack of information saved by \( and restored by \).
  523.        Four stack elements are pushed by each \(:
  524. --- 692,715 ----
  525.       Each alternative of an "or", except the last, ends with a forward-jump
  526.       of this sort. */
  527.   
  528. !   unsigned char *fixup_jump = 0;
  529.   
  530.     /* address of start of the most recently finished expression.
  531.       This tells postfix * where to find the start of its operand. */
  532.   
  533. !   unsigned char *laststart = 0;
  534.   
  535.     /* In processing a repeat, 1 means zero matches is allowed */
  536.   
  537. !   unsigned char zero_times_ok;
  538.   
  539.     /* In processing a repeat, 1 means many matches is allowed */
  540.   
  541. !   unsigned char many_times_ok;
  542.   
  543.     /* address of beginning of regexp, or inside of last \( */
  544.   
  545. !   unsigned char *begalt = b;
  546.   
  547.     /* Stack of information saved by \( and restored by \).
  548.        Four stack elements are pushed by each \(:
  549. ***************
  550. *** 313,319 ****
  551.   
  552.     bufp->fastmap_accurate = 0;
  553.   
  554. - #ifndef emacs
  555.   #ifndef SYNTAX_TABLE
  556.     /*
  557.      * Initialize the syntax table.
  558. --- 730,735 ----
  559. ***************
  560. *** 320,326 ****
  561.      */
  562.      init_syntax_once();
  563.   #endif
  564. - #endif
  565.   
  566.     if (bufp->allocated == 0)
  567.       {
  568. --- 736,741 ----
  569. ***************
  570. *** 327,336 ****
  571.         bufp->allocated = 28;
  572.         if (bufp->buffer)
  573.       /* EXTEND_BUFFER loses when bufp->allocated is 0 */
  574. !     bufp->buffer = (char *) realloc (bufp->buffer, 28);
  575.         else
  576.       /* Caller did not allocate a buffer.  Do it for him */
  577. !     bufp->buffer = (char *) malloc (28);
  578.         if (!bufp->buffer) goto memory_exhausted;
  579.         begalt = b = bufp->buffer;
  580.       }
  581. --- 742,751 ----
  582.         bufp->allocated = 28;
  583.         if (bufp->buffer)
  584.       /* EXTEND_BUFFER loses when bufp->allocated is 0 */
  585. !     bufp->buffer = (unsigned char *) realloc (bufp->buffer, 28);
  586.         else
  587.       /* Caller did not allocate a buffer.  Do it for him */
  588. !     bufp->buffer = (unsigned char *) malloc (28);
  589.         if (!bufp->buffer) goto memory_exhausted;
  590.         begalt = b = bufp->buffer;
  591.       }
  592. ***************
  593. *** 534,540 ****
  594.   
  595.           case '\\':
  596.         if (p == pend) goto invalid_pattern;
  597. !       PATFETCH_RAW (c);
  598.         switch (c)
  599.           {
  600.           case '(':
  601. --- 949,955 ----
  602.   
  603.           case '\\':
  604.         if (p == pend) goto invalid_pattern;
  605. !       PATFETCH (c);
  606.         switch (c)
  607.           {
  608.           case '(':
  609. ***************
  610. *** 672,681 ****
  611.   
  612.           default:
  613.           normal_backsl:
  614. -           /* You might think it would be useful for \ to mean
  615. -          not to translate; but if we don't translate it
  616. -          it will never match anything.  */
  617. -           if (translate) c = translate[c];
  618.             goto normal_char;
  619.           }
  620.         break;
  621. --- 1087,1092 ----
  622. ***************
  623. *** 728,733 ****
  624. --- 1139,1146 ----
  625.     return "Memory exhausted";
  626.   }
  627.   
  628. + #endif /* emacs */
  629.   /* Store where `from' points a jump operation to jump to where `to' points.
  630.     `opcode' is the opcode to store. */
  631.   
  632. ***************
  633. *** 750,760 ****
  634.   
  635.   static int
  636.   insert_jump (op, from, to, current_end)
  637. !      char op;
  638. !      char *from, *to, *current_end;
  639.   {
  640. !   register char *pto = current_end + 3;
  641. !   register char *pfrom = current_end;
  642.     while (pfrom != from)
  643.       *--pto = *--pfrom;
  644.     store_jump (from, op, to);
  645. --- 1163,1173 ----
  646.   
  647.   static int
  648.   insert_jump (op, from, to, current_end)
  649. !      unsigned char op;
  650. !      unsigned char *from, *to, *current_end;
  651.   {
  652. !   register unsigned char *pto = current_end + 3;
  653. !   register unsigned char *pfrom = current_end;
  654.     while (pfrom != from)
  655.       *--pto = *--pfrom;
  656.     store_jump (from, op, to);
  657. ***************
  658. *** 773,785 ****
  659.   re_compile_fastmap (bufp)
  660.        struct re_pattern_buffer *bufp;
  661.   {
  662. !   unsigned char *pattern = (unsigned char *) bufp->buffer;
  663.     int size = bufp->used;
  664. !   register char *fastmap = bufp->fastmap;
  665.     register unsigned char *p = pattern;
  666.     register unsigned char *pend = pattern + size;
  667.     register int j, k;
  668. -   unsigned char *translate = (unsigned char *) bufp->translate;
  669.   
  670.     unsigned char *stackb[NFAILURES];
  671.     unsigned char **stackp = stackb;
  672. --- 1186,1197 ----
  673.   re_compile_fastmap (bufp)
  674.        struct re_pattern_buffer *bufp;
  675.   {
  676. !   unsigned char *pattern = bufp->buffer;
  677.     int size = bufp->used;
  678. !   register unsigned char *fastmap = bufp->fastmap;
  679.     register unsigned char *p = pattern;
  680.     register unsigned char *pend = pattern + size;
  681.     register int j, k;
  682.   
  683.     unsigned char *stackb[NFAILURES];
  684.     unsigned char **stackp = stackb;
  685. ***************
  686. *** 802,811 ****
  687.   #endif
  688.       {
  689.       case exactn:
  690. !       if (translate)
  691. !         fastmap[translate[p[1]]] = 1;
  692. !       else
  693. !         fastmap[p[1]] = 1;
  694.         break;
  695.   
  696.           case begline:
  697. --- 1214,1220 ----
  698.   #endif
  699.       {
  700.       case exactn:
  701. !       fastmap[p[1]] = 1;
  702.         break;
  703.   
  704.           case begline:
  705. ***************
  706. *** 821,830 ****
  707.         continue;
  708.   
  709.       case endline:
  710. !       if (translate)
  711. !         fastmap[translate['\n']] = 1;
  712. !       else
  713. !         fastmap['\n'] = 1;
  714.         if (bufp->can_be_null != 1)
  715.           bufp->can_be_null = 2;
  716.         break;
  717. --- 1230,1236 ----
  718.         continue;
  719.   
  720.       case endline:
  721. !       fastmap['\n'] = 1;
  722.         if (bufp->can_be_null != 1)
  723.           bufp->can_be_null = 2;
  724.         break;
  725. ***************
  726. *** 911,940 ****
  727.       case charset:
  728.         for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
  729.           if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))
  730. !           {
  731. !         if (translate)
  732. !           fastmap[translate[j]] = 1;
  733. !         else
  734. !           fastmap[j] = 1;
  735. !           }
  736.         break;
  737.   
  738.       case charset_not:
  739.         /* Chars beyond end of map must be allowed */
  740.         for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++)
  741. !         if (translate)
  742. !           fastmap[translate[j]] = 1;
  743. !         else
  744. !           fastmap[j] = 1;
  745.   
  746.         for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
  747.           if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))))
  748. !           {
  749. !         if (translate)
  750. !           fastmap[translate[j]] = 1;
  751. !         else
  752. !           fastmap[j] = 1;
  753. !           }
  754.         break;
  755.       }
  756.   
  757. --- 1317,1333 ----
  758.       case charset:
  759.         for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
  760.           if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))
  761. !           fastmap[j] = 1;
  762.         break;
  763.   
  764.       case charset_not:
  765.         /* Chars beyond end of map must be allowed */
  766.         for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++)
  767. !         fastmap[j] = 1;
  768.   
  769.         for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
  770.           if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))))
  771. !           fastmap[j] = 1;
  772.         break;
  773.       }
  774.   
  775. ***************
  776. *** 953,959 ****
  777.   int
  778.   re_search (pbufp, string, size, startpos, range, regs)
  779.        struct re_pattern_buffer *pbufp;
  780. !      char *string;
  781.        int size, startpos, range;
  782.        struct re_registers *regs;
  783.   {
  784. --- 1346,1352 ----
  785.   int
  786.   re_search (pbufp, string, size, startpos, range, regs)
  787.        struct re_pattern_buffer *pbufp;
  788. !      unsigned char *string;
  789.        int size, startpos, range;
  790.        struct re_registers *regs;
  791.   {
  792. ***************
  793. *** 975,981 ****
  794.   int
  795.   re_search_2 (pbufp, string1, size1, string2, size2, startpos, range, regs, mstop)
  796.        struct re_pattern_buffer *pbufp;
  797. !      char *string1, *string2;
  798.        int size1, size2;
  799.        int startpos;
  800.        register int range;
  801. --- 1368,1374 ----
  802.   int
  803.   re_search_2 (pbufp, string1, size1, string2, size2, startpos, range, regs, mstop)
  804.        struct re_pattern_buffer *pbufp;
  805. !      unsigned char *string1, *string2;
  806.        int size1, size2;
  807.        int startpos;
  808.        register int range;
  809. ***************
  810. *** 982,989 ****
  811.        struct re_registers *regs;
  812.        int mstop;
  813.   {
  814. !   register char *fastmap = pbufp->fastmap;
  815. !   register unsigned char *translate = (unsigned char *) pbufp->translate;
  816.     int total = size1 + size2;
  817.     int val;
  818.   
  819. --- 1375,1381 ----
  820.        struct re_registers *regs;
  821.        int mstop;
  822.   {
  823. !   register unsigned char *fastmap = pbufp->fastmap;
  824.     int total = size1 + size2;
  825.     int val;
  826.   
  827. ***************
  828. *** 1023,1049 ****
  829.             p = ((unsigned char *)
  830.              &(startpos >= size1 ? string2 - size1 : string1)[startpos]);
  831.   
  832. !           if (translate)
  833. !         {
  834. !           while (range > lim && !fastmap[translate[*p++]])
  835. !             range--;
  836. !         }
  837. !           else
  838. !         {
  839. !           while (range > lim && !fastmap[*p++])
  840. !             range--;
  841. !         }
  842.             startpos += irange - range;
  843.           }
  844.         else
  845.           {
  846.             register unsigned char c;
  847. !           if (startpos >= size1)
  848. !         c = string2[startpos - size1];
  849. !           else
  850. !         c = string1[startpos];
  851. !           c &= 0xff;
  852. !           if (translate ? !fastmap[translate[c]] : !fastmap[c])
  853.           goto advance;
  854.           }
  855.       }
  856. --- 1415,1430 ----
  857.             p = ((unsigned char *)
  858.              &(startpos >= size1 ? string2 - size1 : string1)[startpos]);
  859.   
  860. !           while (range > lim && !fastmap[*p++])
  861. !         range--;
  862.             startpos += irange - range;
  863.           }
  864.         else
  865.           {
  866.             register unsigned char c;
  867. !           if (startpos >= size1) c = string2[startpos - size1];
  868. !           else c = string1[startpos];
  869. !           if (!fastmap[c])
  870.           goto advance;
  871.           }
  872.       }
  873. ***************
  874. *** 1075,1081 ****
  875.   int
  876.   re_match (pbufp, string, size, pos, regs)
  877.        struct re_pattern_buffer *pbufp;
  878. !      char *string;
  879.        int size, pos;
  880.        struct re_registers *regs;
  881.   {
  882. --- 1456,1462 ----
  883.   int
  884.   re_match (pbufp, string, size, pos, regs)
  885.        struct re_pattern_buffer *pbufp;
  886. !      unsigned char *string;
  887.        int size, pos;
  888.        struct re_registers *regs;
  889.   {
  890. ***************
  891. *** 1087,1093 ****
  892.   
  893.   int re_max_failures = 2000;
  894.   
  895. - static int bcmp_translate();
  896.   /* Match the pattern described by PBUFP
  897.      against data which is the virtual concatenation of STRING1 and STRING2.
  898.      SIZE1 and SIZE2 are the sizes of the two data strings.
  899. --- 1468,1473 ----
  900. ***************
  901. *** 1123,1129 ****
  902.     unsigned char *end_match_1, *end_match_2;
  903.     register unsigned char *d, *dend;
  904.     register int mcnt;
  905. -   unsigned char *translate = (unsigned char *) pbufp->translate;
  906.   
  907.    /* Failure point stack.  Each place that can handle a failure further down the line
  908.       pushes a failure point on this stack.  It consists of two char *'s.
  909. --- 1503,1508 ----
  910. ***************
  911. *** 1295,1301 ****
  912.           if (mcnt > dend2 - d2)
  913.             mcnt = dend2 - d2;
  914.           /* Compare that many; failure if mismatch, else skip them. */
  915. !         if (translate ? bcmp_translate (d, d2, mcnt, translate) : bcmp (d, d2, mcnt))
  916.             goto fail;
  917.           d += mcnt, d2 += mcnt;
  918.             }
  919. --- 1674,1680 ----
  920.           if (mcnt > dend2 - d2)
  921.             mcnt = dend2 - d2;
  922.           /* Compare that many; failure if mismatch, else skip them. */
  923. !         if (bcmp (d, d2, mcnt))
  924.             goto fail;
  925.           d += mcnt, d2 += mcnt;
  926.             }
  927. ***************
  928. *** 1306,1312 ****
  929.         /* fetch a data character */
  930.         PREFETCH;
  931.         /* Match anything but a newline.  */
  932. !       if ((translate ? translate[*d++] : *d++) == '\n')
  933.           goto fail;
  934.         break;
  935.   
  936. --- 1685,1691 ----
  937.         /* fetch a data character */
  938.         PREFETCH;
  939.         /* Match anything but a newline.  */
  940. !       if (*d++ == '\n')
  941.           goto fail;
  942.         break;
  943.   
  944. ***************
  945. *** 1322,1331 ****
  946.           /* fetch a data character */
  947.           PREFETCH;
  948.   
  949. !         if (translate)
  950. !           c = translate [*d];
  951. !         else
  952. !           c = *d;
  953.   
  954.           if (c < *p * BYTEWIDTH
  955.           && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
  956. --- 1701,1707 ----
  957.           /* fetch a data character */
  958.           PREFETCH;
  959.   
  960. !             c = *d;
  961.   
  962.           if (c < *p * BYTEWIDTH
  963.           && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
  964. ***************
  965. *** 1371,1378 ****
  966.             if (stacke - stackb > re_max_failures)
  967.           return -2;
  968.             stackx = (unsigned char **) alloca (2 * (stacke - stackb)
  969. !                      * sizeof (char *));
  970. !           bcopy (stackb, stackx, (stacke - stackb) * sizeof (char *));
  971.             stackp = stackx + (stackp - stackb);
  972.             stacke = stackx + 2 * (stacke - stackb);
  973.             stackb = stackx;
  974. --- 1747,1754 ----
  975.             if (stacke - stackb > re_max_failures)
  976.           return -2;
  977.             stackx = (unsigned char **) alloca (2 * (stacke - stackb)
  978. !                      * sizeof (unsigned char *));
  979. !           bcopy (stackb, stackx, (stacke - stackb) * sizeof (unsigned char *));
  980.             stackp = stackx + (stackp - stackb);
  981.             stacke = stackx + 2 * (stacke - stackb);
  982.             stackb = stackx;
  983. ***************
  984. *** 1444,1451 ****
  985.           {
  986.             unsigned char **stackx
  987.           = (unsigned char **) alloca (2 * (stacke - stackb)
  988. !                          * sizeof (char *));
  989. !           bcopy (stackb, stackx, (stacke - stackb) * sizeof (char *));
  990.             stackp = stackx + (stackp - stackb);
  991.             stacke = stackx + 2 * (stacke - stackb);
  992.             stackb = stackx;
  993. --- 1820,1827 ----
  994.           {
  995.             unsigned char **stackx
  996.           = (unsigned char **) alloca (2 * (stacke - stackb)
  997. !                          * sizeof (unsigned char *));
  998. !           bcopy (stackb, stackx, (stacke - stackb) * sizeof (unsigned char *));
  999.             stackp = stackx + (stackp - stackb);
  1000.             stacke = stackx + 2 * (stacke - stackb);
  1001.             stackb = stackx;
  1002. ***************
  1003. *** 1563,1586 ****
  1004.         /* Match the next few pattern characters exactly.
  1005.            mcnt is how many characters to match. */
  1006.         mcnt = *p++;
  1007. !       if (translate)
  1008.           {
  1009. !           do
  1010. !         {
  1011. !           PREFETCH;
  1012. !           if (translate[*d++] != *p++) goto fail;
  1013. !         }
  1014. !           while (--mcnt);
  1015. !         }
  1016. !       else
  1017. !         {
  1018. !           do
  1019. !         {
  1020. !           PREFETCH;
  1021. !           if (*d++ != *p++) goto fail;
  1022. !         }
  1023. !           while (--mcnt);
  1024.           }
  1025.         break;
  1026.       }
  1027.         continue;    /* Successfully matched one pattern command; keep matching */
  1028. --- 1939,1950 ----
  1029.         /* Match the next few pattern characters exactly.
  1030.            mcnt is how many characters to match. */
  1031.         mcnt = *p++;
  1032. !       do
  1033.           {
  1034. !           PREFETCH;
  1035. !           if (*d++ != *p++) goto fail;
  1036.           }
  1037. +       while (--mcnt);
  1038.         break;
  1039.       }
  1040.         continue;    /* Successfully matched one pattern command; keep matching */
  1041. ***************
  1042. *** 1604,1624 ****
  1043.       }
  1044.     return -1;         /* Failure to match */
  1045.   }
  1046. - static int
  1047. - bcmp_translate (s1, s2, len, translate)
  1048. -      unsigned char *s1, *s2;
  1049. -      register int len;
  1050. -      unsigned char *translate;
  1051. - {
  1052. -   register unsigned char *p1 = s1, *p2 = s2;
  1053. -   while (len)
  1054. -     {
  1055. -       if (translate [*p1++] != translate [*p2++]) return 1;
  1056. -       len--;
  1057. -     }
  1058. -   return 0;
  1059. - }
  1060.   
  1061.   /* Entry points compatible with bsd4.2 regex library */
  1062.   
  1063. --- 1968,1973 ----
  1064. ***************
  1065. *** 1628,1634 ****
  1066.   
  1067.   char *
  1068.   re_comp (s)
  1069. !      char *s;
  1070.   {
  1071.     if (!s)
  1072.       {
  1073. --- 1977,1983 ----
  1074.   
  1075.   char *
  1076.   re_comp (s)
  1077. !      unsigned char *s;
  1078.   {
  1079.     if (!s)
  1080.       {
  1081. ***************
  1082. *** 1639,1648 ****
  1083.   
  1084.     if (!re_comp_buf.buffer)
  1085.       {
  1086. !       if (!(re_comp_buf.buffer = (char *) malloc (200)))
  1087.       return "Memory exhausted";
  1088.         re_comp_buf.allocated = 200;
  1089. !       if (!(re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH)))
  1090.       return "Memory exhausted";
  1091.       }
  1092.     return re_compile_pattern (s, strlen (s), &re_comp_buf);
  1093. --- 1988,1997 ----
  1094.   
  1095.     if (!re_comp_buf.buffer)
  1096.       {
  1097. !       if (!(re_comp_buf.buffer = (unsigned char *) malloc (200)))
  1098.       return "Memory exhausted";
  1099.         re_comp_buf.allocated = 200;
  1100. !       if (!(re_comp_buf.fastmap = (unsigned char *) malloc (1 << BYTEWIDTH)))
  1101.       return "Memory exhausted";
  1102.       }
  1103.     return re_compile_pattern (s, strlen (s), &re_comp_buf);
  1104. ***************
  1105. *** 1650,1656 ****
  1106.   
  1107.   int
  1108.   re_exec (s)
  1109. !      char *s;
  1110.   {
  1111.     int len = strlen (s);
  1112.     return 0 <= re_search (&re_comp_buf, s, len, 0, len, 0);
  1113. --- 1999,2005 ----
  1114.   
  1115.   int
  1116.   re_exec (s)
  1117. !      unsigned char *s;
  1118.   {
  1119.     int len = strlen (s);
  1120.     return 0 <= re_search (&re_comp_buf, s, len, 0, len, 0);
  1121. ***************
  1122. *** 1664,1670 ****
  1123.   
  1124.   /* Indexed by a character, gives the upper case equivalent of the character */
  1125.   
  1126. ! static char upcase[0400] = 
  1127.     { 000, 001, 002, 003, 004, 005, 006, 007,
  1128.       010, 011, 012, 013, 014, 015, 016, 017,
  1129.       020, 021, 022, 023, 024, 025, 026, 027,
  1130. --- 2013,2019 ----
  1131.   
  1132.   /* Indexed by a character, gives the upper case equivalent of the character */
  1133.   
  1134. ! static unsigned char upcase[0400] = 
  1135.     { 000, 001, 002, 003, 004, 005, 006, 007,
  1136.       010, 011, 012, 013, 014, 015, 016, 017,
  1137.       020, 021, 022, 023, 024, 025, 026, 027,
  1138. ***************
  1139. *** 1703,1713 ****
  1140.        int argc;
  1141.        char **argv;
  1142.   {
  1143. !   char pat[80];
  1144.     struct re_pattern_buffer buf;
  1145.     int i;
  1146. !   char c;
  1147. !   char fastmap[(1 << BYTEWIDTH)];
  1148.   
  1149.     /* Allow a command argument to specify the style of syntax.  */
  1150.     if (argc > 1)
  1151. --- 2052,2062 ----
  1152.        int argc;
  1153.        char **argv;
  1154.   {
  1155. !   unsigned char pat[80];
  1156.     struct re_pattern_buffer buf;
  1157.     int i;
  1158. !   unsigned char c;
  1159. !   unsigned char fastmap[(1 << BYTEWIDTH)];
  1160.   
  1161.     /* Allow a command argument to specify the style of syntax.  */
  1162.     if (argc > 1)
  1163. ***************
  1164. *** 1714,1722 ****
  1165.       obscure_syntax = atoi (argv[1]);
  1166.   
  1167.     buf.allocated = 40;
  1168. !   buf.buffer = (char *) malloc (buf.allocated);
  1169.     buf.fastmap = fastmap;
  1170. -   buf.translate = upcase;
  1171.   
  1172.     while (1)
  1173.       {
  1174. --- 2063,2070 ----
  1175.       obscure_syntax = atoi (argv[1]);
  1176.   
  1177.     buf.allocated = 40;
  1178. !   buf.buffer = (unsigned char *) malloc (buf.allocated);
  1179.     buf.fastmap = fastmap;
  1180.   
  1181.     while (1)
  1182.       {
  1183. ***************
  1184. *** 1763,1773 ****
  1185.     for (i = 0; i < (1 << BYTEWIDTH); i++)
  1186.       if (bufp->fastmap[i])
  1187.         printchar (i);
  1188. -   printf ("\nAllowed by translate: ");
  1189. -   if (bufp->translate)
  1190. -     for (i = 0; i < (1 << BYTEWIDTH); i++)
  1191. -       if (bufp->translate[i])
  1192. -     printchar (i);
  1193.     printf ("\nfastmap is%s accurate\n", bufp->fastmap_accurate ? "" : "n't");
  1194.     printf ("can %s be null\n----------", bufp->can_be_null ? "" : "not");
  1195.   }
  1196. --- 2111,2116 ----
  1197. ***************
  1198. *** 1774,1780 ****
  1199.   #endif
  1200.   
  1201.   printchar (c)
  1202. !      char c;
  1203.   {
  1204.     if (c < 041 || c >= 0177)
  1205.       {
  1206. --- 2117,2123 ----
  1207.   #endif
  1208.   
  1209.   printchar (c)
  1210. !      unsigned char c;
  1211.   {
  1212.     if (c < 041 || c >= 0177)
  1213.       {
  1214. ***************
  1215. *** 1788,1794 ****
  1216.   }
  1217.   
  1218.   error (string)
  1219. !      char *string;
  1220.   {
  1221.     puts (string);
  1222.     exit (1);
  1223. --- 2131,2137 ----
  1224.   }
  1225.   
  1226.   error (string)
  1227. !      unsigned char *string;
  1228.   {
  1229.     puts (string);
  1230.     exit (1);
  1231. *** ../18.55/src/regex.h    Sat Aug 13 20:15:10 1988
  1232. --- src/regex.h    Thu Apr  5 09:15:46 1990
  1233. ***************
  1234. *** 1,5 ****
  1235.   /* Definitions for data structures callers pass the regex library.
  1236. !    Copyright (C) 1985 Free Software Foundation, Inc.
  1237.   
  1238.                  NO WARRANTY
  1239.   
  1240. --- 1,5 ----
  1241.   /* Definitions for data structures callers pass the regex library.
  1242. !    Copyright (C) 1985, 1990 Free Software Foundation, Inc.
  1243.   
  1244.                  NO WARRANTY
  1245.   
  1246. ***************
  1247. *** 103,108 ****
  1248. --- 103,112 ----
  1249.   what you give them.   Help stamp out software-hoarding!  */
  1250.   
  1251.   
  1252. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  1253. +  *  See chartab.c for details. */
  1254.   /* Define number of parens for which we record the beginnings and ends.
  1255.      This affects how much space the `struct re_registers' type takes up.  */
  1256.   #ifndef RE_NREGS
  1257. ***************
  1258. *** 149,168 ****
  1259.   #define RE_SYNTAX_GREP (RE_BK_PLUS_QM | RE_NEWLINE_OR)
  1260.   #define RE_SYNTAX_EMACS 0
  1261.   
  1262.   /* This data structure is used to represent a compiled pattern. */
  1263.   
  1264.   struct re_pattern_buffer
  1265.     {
  1266. !     char *buffer;    /* Space holding the compiled pattern commands. */
  1267.       int allocated;    /* Size of space that  buffer  points to */
  1268.       int used;        /* Length of portion of buffer actually occupied */
  1269. !     char *fastmap;    /* Pointer to fastmap, if any, or zero if none. */
  1270.               /* re_search uses the fastmap, if there is one,
  1271.                  to skip quickly over totally implausible characters */
  1272. -     char *translate;    /* Translate table to apply to all characters before comparing.
  1273. -                Or zero for no translation.
  1274. -                The translation is applied to a pattern when it is compiled
  1275. -                and to data when it is matched. */
  1276.       char fastmap_accurate;
  1277.               /* Set to zero when a new pattern is stored,
  1278.                  set to one when the fastmap is updated from it. */
  1279. --- 153,172 ----
  1280.   #define RE_SYNTAX_GREP (RE_BK_PLUS_QM | RE_NEWLINE_OR)
  1281.   #define RE_SYNTAX_EMACS 0
  1282.   
  1283. + #ifndef emacs
  1284. + typedef unsigned char char_t;
  1285. + #endif
  1286.   /* This data structure is used to represent a compiled pattern. */
  1287.   
  1288.   struct re_pattern_buffer
  1289.     {
  1290. !     char_t *buffer;    /* Space holding the compiled pattern commands. */
  1291.       int allocated;    /* Size of space that  buffer  points to */
  1292.       int used;        /* Length of portion of buffer actually occupied */
  1293. !     char_t *fastmap;    /* Pointer to fastmap, if any, or zero if none. */
  1294.               /* re_search uses the fastmap, if there is one,
  1295.                  to skip quickly over totally implausible characters */
  1296.       char fastmap_accurate;
  1297.               /* Set to zero when a new pattern is stored,
  1298.                  set to one when the fastmap is updated from it. */
  1299. ***************
  1300. *** 252,258 ****
  1301. --- 256,267 ----
  1302.       notsyntaxspec /* Matches any character whose syntax differs from the specified. */
  1303.     };
  1304.   
  1305. + #ifdef emacs
  1306. + extern char *re_compile_pattern_sort ();
  1307. + #else
  1308.   extern char *re_compile_pattern ();
  1309. + #endif
  1310.   /* Is this really advertised? */
  1311.   extern void re_compile_fastmap ();
  1312.   extern int re_search (), re_search_2 ();
  1313. *** ../18.55/src/scroll.c    Sat Mar 19 08:55:25 1988
  1314. --- src/scroll.c    Thu Apr  5 09:16:04 1990
  1315. ***************
  1316. *** 1,5 ****
  1317.   /* Calculate what ins/del line to do, and do it, for Emacs redisplay.
  1318. !    Copyright (C) 1985, 1986 Free Software Foundation, Inc.
  1319.   
  1320.   This file is part of GNU Emacs.
  1321.   
  1322. --- 1,5 ----
  1323.   /* Calculate what ins/del line to do, and do it, for Emacs redisplay.
  1324. !    Copyright (C) 1985, 1986, 1990 Free Software Foundation, Inc.
  1325.   
  1326.   This file is part of GNU Emacs.
  1327.   
  1328. ***************
  1329. *** 19,25 ****
  1330. --- 19,30 ----
  1331.   and this notice must be preserved on all copies.  */
  1332.   
  1333.   
  1334. + /* Modified 1990 for 8-bit character support by Howard Gayle.
  1335. +  *  See chartab.c for details. */
  1336.   #include "config.h"
  1337. + #include "lisp.h"
  1338.   #include "termchar.h"
  1339.   #include "dispextern.h"
  1340.   
  1341.