123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- #ifndef _PCREPOSIX_H
- #define _PCREPOSIX_H
- #include <stdlib.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define REG_ICASE 0x0001
- #define REG_NEWLINE 0x0002
- #define REG_NOTBOL 0x0004
- #define REG_NOTEOL 0x0008
- #define REG_DOTALL 0x0010
- #define REG_NOSUB 0x0020
- #define REG_UTF8 0x0040
- #define REG_STARTEND 0x0080
- #define REG_NOTEMPTY 0x0100
- #define REG_UNGREEDY 0x0200
- #define REG_UCP 0x0400
- #define REG_EXTENDED 0
- enum {
- REG_ASSERT = 1,
- REG_BADBR,
- REG_BADPAT,
- REG_BADRPT,
- REG_EBRACE,
- REG_EBRACK,
- REG_ECOLLATE,
- REG_ECTYPE,
- REG_EESCAPE,
- REG_EMPTY,
- REG_EPAREN,
- REG_ERANGE,
- REG_ESIZE,
- REG_ESPACE,
- REG_ESUBREG,
- REG_INVARG,
- REG_NOMATCH
- };
- typedef struct {
- void *re_pcre;
- size_t re_nsub;
- size_t re_erroffset;
- } regex_t;
- typedef int regoff_t;
- typedef struct {
- regoff_t rm_so;
- regoff_t rm_eo;
- } regmatch_t;
- #if defined(_WIN32) && !defined(PCRE_STATIC) && !defined(PCREPOSIX_EXP_DECL)
- # define PCREPOSIX_EXP_DECL extern __declspec(dllimport)
- # define PCREPOSIX_EXP_DEFN __declspec(dllimport)
- #endif
- #ifndef PCREPOSIX_EXP_DECL
- # ifdef __cplusplus
- # define PCREPOSIX_EXP_DECL extern "C"
- # define PCREPOSIX_EXP_DEFN extern "C"
- # else
- # define PCREPOSIX_EXP_DECL extern
- # define PCREPOSIX_EXP_DEFN extern
- # endif
- #endif
- PCREPOSIX_EXP_DECL int regcomp(regex_t *, const char *, int);
- PCREPOSIX_EXP_DECL int regexec(const regex_t *, const char *, size_t,
- regmatch_t *, int);
- PCREPOSIX_EXP_DECL size_t regerror(int, const regex_t *, char *, size_t);
- PCREPOSIX_EXP_DECL void regfree(regex_t *);
- #ifdef __cplusplus
- }
- #endif
- #endif
|