home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
514a.lha
/
sregexp.library_v9.0
/
sregexp.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-06-08
|
2KB
|
50 lines
/* This is used for COMPILING sregexp.library, it should not be included
if you just USE the library. See sregexpbase.h */
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <clib/exec_protos.h>
#include <clib/dos_protos.h>
#include <libraries/dosextens.h>
#include "sregexpbase.h"
#define TRUE 1
#define FALSE 0
#define MEM_ERROR ERROR_NO_FREE_STORE /* report no mem */
#define ILLEGAL_ERR ERROR_INVALID_COMPONENT_NAME /* bad sregexp */
/* some handy fingersaving macros. */
#define realen(a) (((a)->sre_Flag&(SRF_REPEAT|SRF_NOT))?0:(a)->sre_MinLen)
#define isfixed(s) (((s)->sre_Flag&(SRF_REPEAT|SRF_NOT|SRF_FIXLEN))==SRF_FIXLEN)
#define matchset(s,c) ((s)->sre_Data.setchar[(c)/8] & 1 << (c)%8)
#define getmem(a) AllocMem(a,0)
static struct SregExp * parsesub(char **, char);
static struct SregExp * makesum(struct SregList *, int);
static struct SregExp * makeor(struct SregList *,int);
static struct SregExp * parseone(char **, char);
static char onechar(char **, char);
static char * makeset(char **);
static int matchsum(struct SregExp *[], int, char *, int, int);
static void report(int);
static struct SpathNode * makespathnode(BPTR, char *, struct SregList *);
static void freespathnode(struct SpathNode *);
static struct SregList * parsepath(char *);
extern struct SregExp * parsesregexp(char *);
extern void freesregexp(struct SregExp *);
extern int matchsregexp(char *, struct SregExp *, int);
extern int matchnsregexp(char *, struct SregExp *, int, int);
extern int iswild(char *);
extern struct SpathInfo * anchorpath(char *, char *);
extern int nextfile(struct SpathInfo *, char *, int, int);
extern int buildpath(struct SpathInfo *, char *, int);
extern void freespathinfo(struct SpathInfo *);