]> granicus.if.org Git - apache/commitdiff
Add missing pcreposix.h from vendor/pcre/5.0.
authorMladen Turk <mturk@apache.org>
Mon, 29 Nov 2004 10:09:15 +0000 (10:09 +0000)
committerMladen Turk <mturk@apache.org>
Mon, 29 Nov 2004 10:09:15 +0000 (10:09 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@106899 13f79535-47bb-0310-9956-ffa450edef68

srclib/pcre/pcreposix.h [new file with mode: 0644]

diff --git a/srclib/pcre/pcreposix.h b/srclib/pcre/pcreposix.h
new file mode 100644 (file)
index 0000000..2214ef9
--- /dev/null
@@ -0,0 +1,117 @@
+/*************************************************\r
+*       Perl-Compatible Regular Expressions      *\r
+*************************************************/\r
+\r
+#ifndef _PCREPOSIX_H\r
+#define _PCREPOSIX_H\r
+\r
+/* This is the header for the POSIX wrapper interface to the PCRE Perl-\r
+Compatible Regular Expression library. It defines the things POSIX says should\r
+be there. I hope.\r
+\r
+            Copyright (c) 1997-2004 University of Cambridge\r
+\r
+-----------------------------------------------------------------------------\r
+Redistribution and use in source and binary forms, with or without\r
+modification, are permitted provided that the following conditions are met:\r
+\r
+    * Redistributions of source code must retain the above copyright notice,\r
+      this list of conditions and the following disclaimer.\r
+\r
+    * Redistributions in binary form must reproduce the above copyright\r
+      notice, this list of conditions and the following disclaimer in the\r
+      documentation and/or other materials provided with the distribution.\r
+\r
+    * Neither the name of the University of Cambridge nor the names of its\r
+      contributors may be used to endorse or promote products derived from\r
+      this software without specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\r
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
+POSSIBILITY OF SUCH DAMAGE.\r
+-----------------------------------------------------------------------------\r
+*/\r
+\r
+/* Have to include stdlib.h in order to ensure that size_t is defined. */\r
+\r
+#include <stdlib.h>\r
+\r
+/* Allow for C++ users */\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/* Options defined by POSIX. */\r
+\r
+#define REG_ICASE     0x01\r
+#define REG_NEWLINE   0x02\r
+#define REG_NOTBOL    0x04\r
+#define REG_NOTEOL    0x08\r
+\r
+/* These are not used by PCRE, but by defining them we make it easier\r
+to slot PCRE into existing programs that make POSIX calls. */\r
+\r
+#define REG_EXTENDED  0\r
+#define REG_NOSUB     0\r
+\r
+/* Error values. Not all these are relevant or used by the wrapper. */\r
+\r
+enum {\r
+  REG_ASSERT = 1,  /* internal error ? */\r
+  REG_BADBR,       /* invalid repeat counts in {} */\r
+  REG_BADPAT,      /* pattern error */\r
+  REG_BADRPT,      /* ? * + invalid */\r
+  REG_EBRACE,      /* unbalanced {} */\r
+  REG_EBRACK,      /* unbalanced [] */\r
+  REG_ECOLLATE,    /* collation error - not relevant */\r
+  REG_ECTYPE,      /* bad class */\r
+  REG_EESCAPE,     /* bad escape sequence */\r
+  REG_EMPTY,       /* empty expression */\r
+  REG_EPAREN,      /* unbalanced () */\r
+  REG_ERANGE,      /* bad range inside [] */\r
+  REG_ESIZE,       /* expression too big */\r
+  REG_ESPACE,      /* failed to get memory */\r
+  REG_ESUBREG,     /* bad back reference */\r
+  REG_INVARG,      /* bad argument */\r
+  REG_NOMATCH      /* match failed */\r
+};\r
+\r
+\r
+/* The structure representing a compiled regular expression. */\r
+\r
+typedef struct {\r
+  void *re_pcre;\r
+  size_t re_nsub;\r
+  size_t re_erroffset;\r
+} regex_t;\r
+\r
+/* The structure in which a captured offset is returned. */\r
+\r
+typedef int regoff_t;\r
+\r
+typedef struct {\r
+  regoff_t rm_so;\r
+  regoff_t rm_eo;\r
+} regmatch_t;\r
+\r
+/* The functions */\r
+\r
+extern int regcomp(regex_t *, const char *, int);\r
+extern int regexec(const regex_t *, const char *, size_t, regmatch_t *, int);\r
+extern size_t regerror(int, const regex_t *, char *, size_t);\r
+extern void regfree(regex_t *);\r
+\r
+#ifdef __cplusplus\r
+}   /* extern "C" */\r
+#endif\r
+\r
+#endif /* End of pcreposix.h */\r