home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / jove414s.zip / re.h < prev    next >
C/C++ Source or Header  |  1991-06-18  |  2KB  |  55 lines

  1. /***************************************************************************
  2.  * This program is Copyright (C) 1986, 1987, 1988 by Jonathan Payne.  JOVE *
  3.  * is 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    256
  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    r_compbuf[COMPSIZE],
  18.         *r_alternates[NALTS],
  19.         r_lbuf[LBSIZE];
  20.     int    r_nparens,
  21.         r_firstc,
  22.         r_anchored;
  23. };
  24.  
  25. extern char    searchstr[128],
  26.         rep_search[128],    /* replace search string */
  27.         rep_str[128];        /* contains replacement string */
  28.  
  29. extern int    REdirection,
  30.         REbom,        /* beginning and end columns of match */
  31.         REeom,
  32.         REdelta;    /* increase in line length due to last re_dosub */
  33.  
  34. extern int    okay_wrap;    /* Do a wrap search ... not when we're
  35.                    parsing errors ... */
  36. extern char
  37.     *getsearch proto((void));
  38.  
  39. extern int
  40.     LookingAt proto((char *pattern,char *buf,int offset)),
  41.     look_at proto((char *expr)),
  42.     re_lindex proto((struct line *line,int offset,struct RE_block *re_blk, int lbuf_okay, int crater));
  43.  
  44. extern Bufpos
  45.     *docompiled proto((int dir, struct RE_block *re_blk)),
  46.     *dosearch proto((char *pattern,int dir,int re));
  47.  
  48. extern void
  49.     REcompile proto((char *pattern,int re,struct RE_block *re_blk)),
  50.     find_tag proto((char *tag,int localp)),
  51.     putmatch proto((int which,char *buf,size_t size)),
  52.     re_dosub proto((struct RE_block *re_blk, char *tobuf, int delp)),
  53.     setsearch proto((char *str)),
  54.     RErecur proto((void));
  55.