| 9 |
Compatible Regular Expression library. It defines the things POSIX says should |
Compatible Regular Expression library. It defines the things POSIX says should |
| 10 |
be there. I hope. |
be there. I hope. |
| 11 |
|
|
| 12 |
Copyright (c) 1997-2007 University of Cambridge |
Copyright (c) 1997-2009 University of Cambridge |
| 13 |
|
|
| 14 |
----------------------------------------------------------------------------- |
----------------------------------------------------------------------------- |
| 15 |
Redistribution and use in source and binary forms, with or without |
Redistribution and use in source and binary forms, with or without |
| 50 |
extern "C" { |
extern "C" { |
| 51 |
#endif |
#endif |
| 52 |
|
|
| 53 |
/* Options, mostly defined by POSIX, but with a couple of extras. */ |
/* Options, mostly defined by POSIX, but with some extras. */ |
| 54 |
|
|
| 55 |
#define REG_ICASE 0x0001 |
#define REG_ICASE 0x0001 /* Maps to PCRE_CASELESS */ |
| 56 |
#define REG_NEWLINE 0x0002 |
#define REG_NEWLINE 0x0002 /* Maps to PCRE_MULTILINE */ |
| 57 |
#define REG_NOTBOL 0x0004 |
#define REG_NOTBOL 0x0004 /* Maps to PCRE_NOTBOL */ |
| 58 |
#define REG_NOTEOL 0x0008 |
#define REG_NOTEOL 0x0008 /* Maps to PCRE_NOTEOL */ |
| 59 |
#define REG_DOTALL 0x0010 /* NOT defined by POSIX. */ |
#define REG_DOTALL 0x0010 /* NOT defined by POSIX; maps to PCRE_DOTALL */ |
| 60 |
#define REG_NOSUB 0x0020 |
#define REG_NOSUB 0x0020 /* Maps to PCRE_NO_AUTO_CAPTURE */ |
| 61 |
#define REG_UTF8 0x0040 /* NOT defined by POSIX. */ |
#define REG_UTF8 0x0040 /* NOT defined by POSIX; maps to PCRE_UTF8 */ |
| 62 |
|
#define REG_STARTEND 0x0080 /* BSD feature: pass subject string by so,eo */ |
| 63 |
|
#define REG_NOTEMPTY 0x0100 /* NOT defined by POSIX; maps to PCRE_NOTEMPTY */ |
| 64 |
|
#define REG_UNGREEDY 0x0200 /* NOT defined by POSIX; maps to PCRE_UNGREEDY */ |
| 65 |
|
#define REG_UCP 0x0400 /* NOT defined by POSIX; maps to PCRE_UCP */ |
| 66 |
|
|
| 67 |
/* This is not used by PCRE, but by defining it we make it easier |
/* This is not used by PCRE, but by defining it we make it easier |
| 68 |
to slot PCRE into existing programs that make POSIX calls. */ |
to slot PCRE into existing programs that make POSIX calls. */ |
| 109 |
regoff_t rm_eo; |
regoff_t rm_eo; |
| 110 |
} regmatch_t; |
} regmatch_t; |
| 111 |
|
|
| 112 |
/* Win32 uses DLL by default; it needs special stuff for exported functions |
/* When an application links to a PCRE DLL in Windows, the symbols that are |
| 113 |
when building PCRE. */ |
imported have to be identified as such. When building PCRE, the appropriate |
| 114 |
|
export settings are needed, and are set in pcreposix.c before including this |
| 115 |
#ifndef PCRE_DATA_SCOPE |
file. */ |
| 116 |
#ifdef _WIN32 |
|
| 117 |
# ifdef PCRE_DEFINITION |
#if defined(_WIN32) && !defined(PCRE_STATIC) && !defined(PCREPOSIX_EXP_DECL) |
| 118 |
# ifdef DLL_EXPORT |
# define PCREPOSIX_EXP_DECL extern __declspec(dllimport) |
| 119 |
# define PCRE_DATA_SCOPE __declspec(dllexport) |
# define PCREPOSIX_EXP_DEFN __declspec(dllimport) |
|
# endif |
|
|
# else |
|
|
# ifndef PCRE_STATIC |
|
|
# define PCRE_DATA_SCOPE extern __declspec(dllimport) |
|
|
# endif |
|
|
# endif |
|
|
#endif |
|
| 120 |
#endif |
#endif |
| 121 |
|
|
| 122 |
/* Otherwise, we use the standard "extern". */ |
/* By default, we use the standard "extern" declarations. */ |
| 123 |
|
|
| 124 |
#ifndef PCRE_DATA_SCOPE |
#ifndef PCREPOSIX_EXP_DECL |
| 125 |
# ifdef __cplusplus |
# ifdef __cplusplus |
| 126 |
# define PCRE_DATA_SCOPE extern "C" |
# define PCREPOSIX_EXP_DECL extern "C" |
| 127 |
|
# define PCREPOSIX_EXP_DEFN extern "C" |
| 128 |
# else |
# else |
| 129 |
# define PCRE_DATA_SCOPE extern |
# define PCREPOSIX_EXP_DECL extern |
| 130 |
|
# define PCREPOSIX_EXP_DEFN extern |
| 131 |
# endif |
# endif |
| 132 |
#endif |
#endif |
| 133 |
|
|
| 134 |
/* The functions */ |
/* The functions */ |
| 135 |
|
|
| 136 |
PCRE_DATA_SCOPE int regcomp(regex_t *, const char *, int); |
PCREPOSIX_EXP_DECL int regcomp(regex_t *, const char *, int); |
| 137 |
PCRE_DATA_SCOPE int regexec(const regex_t *, const char *, size_t, |
PCREPOSIX_EXP_DECL int regexec(const regex_t *, const char *, size_t, |
| 138 |
regmatch_t *, int); |
regmatch_t *, int); |
| 139 |
PCRE_DATA_SCOPE size_t regerror(int, const regex_t *, char *, size_t); |
PCREPOSIX_EXP_DECL size_t regerror(int, const regex_t *, char *, size_t); |
| 140 |
PCRE_DATA_SCOPE void regfree(regex_t *); |
PCREPOSIX_EXP_DECL void regfree(regex_t *); |
| 141 |
|
|
| 142 |
#ifdef __cplusplus |
#ifdef __cplusplus |
| 143 |
} /* extern "C" */ |
} /* extern "C" */ |