ldmud-3.2.9/doc/
ldmud-3.2.9/doc/efun/
ldmud-3.2.9/mud/
ldmud-3.2.9/mud/heaven7/
ldmud-3.2.9/mud/heaven7/lib/
ldmud-3.2.9/mud/lp-245/
ldmud-3.2.9/mud/lp-245/banish/
ldmud-3.2.9/mud/lp-245/doc/
ldmud-3.2.9/mud/lp-245/doc/examples/
ldmud-3.2.9/mud/lp-245/doc/sefun/
ldmud-3.2.9/mud/lp-245/log/
ldmud-3.2.9/mud/lp-245/obj/Go/
ldmud-3.2.9/mud/lp-245/players/lars/
ldmud-3.2.9/mud/lp-245/room/death/
ldmud-3.2.9/mud/lp-245/room/maze1/
ldmud-3.2.9/mud/lp-245/room/sub/
ldmud-3.2.9/mud/lp-245/secure/
ldmud-3.2.9/mud/morgengrauen/
ldmud-3.2.9/mud/morgengrauen/lib/
ldmud-3.2.9/mud/sticklib/
ldmud-3.2.9/mud/sticklib/src/
ldmud-3.2.9/mudlib/uni-crasher/
ldmud-3.2.9/pkg/
ldmud-3.2.9/pkg/debugger/
ldmud-3.2.9/pkg/diff/
ldmud-3.2.9/pkg/misc/
ldmud-3.2.9/src/autoconf/
ldmud-3.2.9/src/bugs/
ldmud-3.2.9/src/bugs/MudCompress/
ldmud-3.2.9/src/bugs/b-020916-files/
ldmud-3.2.9/src/bugs/doomdark/
ldmud-3.2.9/src/bugs/ferrycode/ferry/
ldmud-3.2.9/src/bugs/ferrycode/obj/
ldmud-3.2.9/src/bugs/psql/
ldmud-3.2.9/src/done/
ldmud-3.2.9/src/done/order_alist/
ldmud-3.2.9/src/done/order_alist/obj/
ldmud-3.2.9/src/done/order_alist/room/
ldmud-3.2.9/src/gcc/
ldmud-3.2.9/src/gcc/2.7.0/
ldmud-3.2.9/src/gcc/2.7.1/
ldmud-3.2.9/src/hosts/
ldmud-3.2.9/src/hosts/GnuWin32/
ldmud-3.2.9/src/hosts/amiga/NetIncl/
ldmud-3.2.9/src/hosts/amiga/NetIncl/netinet/
ldmud-3.2.9/src/hosts/amiga/NetIncl/sys/
ldmud-3.2.9/src/hosts/i386/
ldmud-3.2.9/src/hosts/msdos/byacc/
ldmud-3.2.9/src/hosts/msdos/doc/
ldmud-3.2.9/src/hosts/os2/
ldmud-3.2.9/src/hosts/win32/
ldmud-3.2.9/src/util/
ldmud-3.2.9/src/util/erq/
ldmud-3.2.9/src/util/indent/hosts/next/
ldmud-3.2.9/src/util/xerq/
ldmud-3.2.9/src/util/xerq/lpc/
ldmud-3.2.9/src/util/xerq/lpc/www/
#ifndef REGEXP_H_
#define REGEXP_H_

#include "driver.h"

#define NSUBEXP  50
  /* Number of allowed () expressions.
   */

/* --- struct regexp: regular expression basis ---
 *
 * This structure is used to hold a compiled regular expression as well
 * intermediate results between two match calls.
 *
 * The structure is allocated big enough to fit the whole program
 * starting with .program.
 */

typedef struct regexp
{
    char *startp[NSUBEXP];
    char *endp[NSUBEXP];
      /* After a match, the start and endpointers for the matched
       * () expressions.
       */
    unsigned char regstart;
      /* Internal use: char that must begin a match, '\0' if non obvious
       */
    unsigned char reganch;
      /* Internal use: is the match anchored (at beginning-of-line only)?
       */
    unsigned char *regmust;
      /* Internal use: string (pointer into program) that match must
       * include, or NULL.
       */
    int regmlen;
      /* Internal  use: length of regmust.
       */
    long regalloc;          /* Allocated total length, used by rxcache */
    p_uint refs;            /* Number of refs, used+maintained by rxcache */
    Bool from_ed;           /* TRUE if compiled for ed() */
    unsigned char program[1];  /* The compiled regexp. */
} regexp;

/* --- Prototypes --- */
#ifdef DEBUG
extern Bool regnarrate;
void hs_regdump(regexp *rg);
#endif

extern regexp *hs_regcomp(unsigned char *expr, Bool excompat, Bool from_ed);
extern Bool hs_regexec(regexp *prog, char *string, char *start);
extern char *hs_regsub(regexp *prog, char *source, char *dest, int n, Bool quiet);
extern void hs_regerror(char *);

#endif /* REGEXP_H_ */