1226035Sgabor/* $FreeBSD$ */ 2226035Sgabor 3226035Sgabor#ifndef FASTMATCH_H 4226035Sgabor#define FASTMATCH_H 1 5226035Sgabor 6226035Sgabor#include <limits.h> 7226035Sgabor#include <regex.h> 8226035Sgabor#include <stdbool.h> 9226035Sgabor#include <wchar.h> 10226035Sgabor 11226035Sgabortypedef struct { 12226035Sgabor size_t wlen; 13226035Sgabor size_t len; 14226035Sgabor wchar_t *wpattern; 15226035Sgabor bool *wescmap; 16226035Sgabor unsigned int qsBc[UCHAR_MAX + 1]; 17226035Sgabor unsigned int *bmGs; 18226035Sgabor char *pattern; 19226035Sgabor bool *escmap; 20226035Sgabor unsigned int defBc; 21226035Sgabor void *qsBc_table; 22226035Sgabor unsigned int *sbmGs; 23226035Sgabor const char *re_endp; 24226035Sgabor 25226035Sgabor /* flags */ 26226035Sgabor bool hasdot; 27226035Sgabor bool bol; 28226035Sgabor bool eol; 29226035Sgabor bool word; 30226035Sgabor bool icase; 31226035Sgabor bool newline; 32226035Sgabor bool nosub; 33226035Sgabor bool matchall; 34226035Sgabor bool reversed; 35226035Sgabor} fastmatch_t; 36226035Sgabor 37226035Sgaborextern int 38226035Sgabortre_fixcomp(fastmatch_t *preg, const char *regex, int cflags); 39226035Sgabor 40226035Sgaborextern int 41226035Sgabortre_fastcomp(fastmatch_t *preg, const char *regex, int cflags); 42226035Sgabor 43226035Sgaborextern int 44226035Sgabortre_fastexec(const fastmatch_t *preg, const char *string, size_t nmatch, 45226035Sgabor regmatch_t pmatch[], int eflags); 46226035Sgabor 47226035Sgaborextern void 48226035Sgabortre_fastfree(fastmatch_t *preg); 49226035Sgabor 50226035Sgaborextern int 51226035Sgabortre_fixwcomp(fastmatch_t *preg, const wchar_t *regex, int cflags); 52226035Sgabor 53226035Sgaborextern int 54226035Sgabortre_fastwcomp(fastmatch_t *preg, const wchar_t *regex, int cflags); 55226035Sgabor 56226035Sgaborextern int 57226035Sgabortre_fastwexec(const fastmatch_t *preg, const wchar_t *string, 58226035Sgabor size_t nmatch, regmatch_t pmatch[], int eflags); 59226035Sgabor 60226035Sgabor/* Versions with a maximum length argument and therefore the capability to 61226035Sgabor handle null characters in the middle of the strings. */ 62226035Sgaborextern int 63226035Sgabortre_fixncomp(fastmatch_t *preg, const char *regex, size_t len, int cflags); 64226035Sgabor 65226035Sgaborextern int 66226035Sgabortre_fastncomp(fastmatch_t *preg, const char *regex, size_t len, int cflags); 67226035Sgabor 68226035Sgaborextern int 69226035Sgabortre_fastnexec(const fastmatch_t *preg, const char *string, size_t len, 70226035Sgabor size_t nmatch, regmatch_t pmatch[], int eflags); 71226035Sgabor 72226035Sgaborextern int 73226035Sgabortre_fixwncomp(fastmatch_t *preg, const wchar_t *regex, size_t len, int cflags); 74226035Sgabor 75226035Sgaborextern int 76226035Sgabortre_fastwncomp(fastmatch_t *preg, const wchar_t *regex, size_t len, int cflags); 77226035Sgabor 78226035Sgaborextern int 79226035Sgabortre_fastwnexec(const fastmatch_t *preg, const wchar_t *string, size_t len, 80226035Sgabor size_t nmatch, regmatch_t pmatch[], int eflags); 81226035Sgabor 82226035Sgabor#define fixncomp tre_fixncomp 83226035Sgabor#define fastncomp tre_fastncomp 84226035Sgabor#define fixcomp tre_fixcomp 85226035Sgabor#define fastcomp tre_fastcomp 86226035Sgabor#define fixwncomp tre_fixwncomp 87226035Sgabor#define fastwncomp tre_fastwncomp 88226035Sgabor#define fixwcomp tre_fixwcomp 89226035Sgabor#define fastwcomp tre_fastwcomp 90226035Sgabor#define fastfree tre_fastfree 91226035Sgabor#define fastnexec tre_fastnexec 92226035Sgabor#define fastexec tre_fastexec 93226035Sgabor#define fastwnexec tre_fastwnexec 94226035Sgabor#define fastwexec tre_fastwexec 95226035Sgabor#define fixcomp tre_fixcomp 96226035Sgabor#define fastcomp tre_fastcomp 97226035Sgabor#define fastexec tre_fastexec 98226035Sgabor#define fastfree tre_fastfree 99226035Sgabor#define fixwcomp tre_fixwcomp 100226035Sgabor#define fastwcomp tre_fastwcomp 101226035Sgabor#define fastwexec tre_fastwexec 102226035Sgabor#define fixncomp tre_fixncomp 103226035Sgabor#define fastncomp tre_fastncomp 104226035Sgabor#define fastnexec tre_fastnexec 105226035Sgabor#define fixwncomp tre_fixwncomp 106226035Sgabor#define fastwncomp tre_fastwncomp 107226035Sgabor#define fastwnexec tre_fastwnexec 108226035Sgabor#endif /* FASTMATCH_H */ 109