home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / jove-4.16-src.tgz / tar.out / bsd / jove / re.h < prev    next >
C/C++ Source or Header  |  1996-09-28  |  2KB  |  62 lines

  1. /************************************************************************
  2.  * This program is Copyright (C) 1986-1996 by Jonathan Payne.  JOVE is  *
  3.  * provided to you without charge, and with no warranty.  You may give  *
  4.  * away copies of JOVE, including sources, provided that this notice is *
  5.  * included in all the files.                                           *
  6.  ************************************************************************/
  7.  
  8. #define NALTS        16    /* number of alternate search strings */
  9. #define COMPSIZE    512
  10.  
  11. /* kinds of regular expression compiles */
  12. #define NORM    0    /* nothing special */
  13. #define OKAY_RE    1    /* allow regular expressions */
  14. #define IN_CB    2    /* in curly brace; implies OKAY_RE */
  15.  
  16. struct RE_block {
  17.     char
  18.         r_compbuf[COMPSIZE],
  19.         *r_alternates[NALTS],
  20.         r_lbuf[LBSIZE];
  21.     int
  22.         r_nparens;
  23.     ZXchar
  24.         r_firstc;
  25.     bool
  26.         r_anchored;
  27. };
  28.  
  29. extern char
  30.     rep_search[128],    /* replace search string */
  31.     rep_str[128];        /* contains replacement string */
  32.  
  33. extern int
  34.     REbom,        /* beginning and end columns of match */
  35.     REeom,
  36.     REdelta;    /* increase in line length due to last re_dosub */
  37.  
  38. extern bool    okay_wrap;    /* Do a wrap search ... not when we're
  39.                    parsing errors ... */
  40.  
  41. extern bool
  42.     re_lindex proto((LinePtr line, int offset, int dir,
  43.         struct RE_block *re_blk, bool lbuf_okay, int crater)),
  44.     LookingAt proto((char *pattern,char *buf,int offset)),
  45.     look_at proto((char *expr));
  46.  
  47. extern Bufpos
  48.     *docompiled proto((int dir, struct RE_block *re_blk)),
  49.     *dosearch proto((char *pattern, int dir, bool re));
  50.  
  51. extern void
  52.     REcompile proto((char *pattern, bool re, struct RE_block *re_blk)),
  53.     putmatch proto((int which,char *buf,size_t size)),
  54.     re_dosub proto((struct RE_block *re_blk, char *tobuf, bool delp)),
  55.     RErecur proto((void));
  56.  
  57. /* Variables: */
  58.  
  59. extern bool
  60.     CaseIgnore,        /* VAR: ignore case in search */
  61.     WrapScan;        /* VAR: make searches wrap */
  62.