kolibrios-gitea/programs/develop/kosjs/libmujs/regexp.h
maxcodehack 91ae0dee0b kosjs: replace libmujs.a with sources; if argc = 0, see "usage"
git-svn-id: svn://kolibrios.org@8456 a494cfbc-eb01-0410-851d-a64ba20cac60
2020-12-20 08:45:42 +00:00

47 lines
1007 B
C
Executable File

#ifndef regexp_h
#define regexp_h
#define regcompx js_regcompx
#define regfreex js_regfreex
#define regcomp js_regcomp
#define regexec js_regexec
#define regfree js_regfree
typedef struct Reprog Reprog;
typedef struct Resub Resub;
Reprog *regcompx(void *(*alloc)(void *ctx, void *p, int n), void *ctx,
const char *pattern, int cflags, const char **errorp);
void regfreex(void *(*alloc)(void *ctx, void *p, int n), void *ctx,
Reprog *prog);
Reprog *regcomp(const char *pattern, int cflags, const char **errorp);
int regexec(Reprog *prog, const char *string, Resub *sub, int eflags);
void regfree(Reprog *prog);
enum {
/* regcomp flags */
REG_ICASE = 1,
REG_NEWLINE = 2,
/* regexec flags */
REG_NOTBOL = 4,
};
/* If you redefine REG_MAXSUB, you must make sure both the calling
* code and the regexp.c compilation unit use the same value!
*/
#ifndef REG_MAXSUB
#define REG_MAXSUB 10
#endif
struct Resub {
int nsub;
struct {
const char *sp;
const char *ep;
} sub[REG_MAXSUB];
};
#endif