Import tre from https://github.com/laurikari/tre as of 10171117:
- tre_reg*b() functions are added, that take bytes literally. - minor bug fixes
This commit is contained in:
parent
1194b67aec
commit
87736b622d
|
@ -11,9 +11,9 @@ SUBDIRS = lib $(agrep_dirs) tests utils po m4
|
|||
EXTRA_DIST = \
|
||||
LICENSE \
|
||||
win32/tre-config.h win32/config.h \
|
||||
win32/tre.dsw \
|
||||
win32/tre.dsp win32/tre.def \
|
||||
win32/retest.dsp \
|
||||
win32/tre.vcproj \
|
||||
win32/tre.sln \
|
||||
win32/retest.vcproj \
|
||||
python/tre-python.c \
|
||||
python/setup.py \
|
||||
python/example.py
|
||||
|
|
|
@ -0,0 +1,290 @@
|
|||
Introduction
|
||||
============
|
||||
|
||||
TRE is a lightweight, robust, and efficient POSIX compliant regexp
|
||||
matching library with some exciting features such as approximate
|
||||
(fuzzy) matching.
|
||||
|
||||
The matching algorithm used in TRE uses linear worst-case time in
|
||||
the length of the text being searched, and quadratic worst-case
|
||||
time in the length of the used regular expression.
|
||||
|
||||
In other words, the time complexity of the algorithm is O(M^2N), where
|
||||
M is the length of the regular expression and N is the length of the
|
||||
text. The used space is also quadratic on the length of the regex, but
|
||||
does not depend on the searched string. This quadratic behaviour
|
||||
occurs only on pathological cases which are probably very rare in
|
||||
practice.
|
||||
|
||||
|
||||
Hacking
|
||||
=======
|
||||
|
||||
Here's how to work with this code.
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
You will need the following tools installed on your system:
|
||||
|
||||
- autoconf
|
||||
- automake
|
||||
- gettext
|
||||
- libtool
|
||||
- zip (optional)
|
||||
|
||||
|
||||
Building
|
||||
--------
|
||||
|
||||
First, prepare the tre. Change to the root of the source directory
|
||||
and run
|
||||
```
|
||||
./utils/autogen.sh
|
||||
```
|
||||
This will regenerate various things using the prerequisite tools so
|
||||
that you end up with a buildable tree.
|
||||
|
||||
After this, you can run the configure script and build TRE as usual:
|
||||
```
|
||||
./configure
|
||||
make
|
||||
make check
|
||||
make install
|
||||
```
|
||||
|
||||
|
||||
Building a source code package
|
||||
------------------------------
|
||||
|
||||
In a prepared tree, this command creates a source code tarball:
|
||||
```
|
||||
./configure && make dist
|
||||
```
|
||||
|
||||
Alternatively, you can run
|
||||
```
|
||||
./utils/build-sources.sh
|
||||
```
|
||||
which builds the source code packages and puts them in the `dist`
|
||||
subdirectory. This script needs a working `zip` command.
|
||||
|
||||
|
||||
Features
|
||||
========
|
||||
|
||||
TRE is not just yet another regexp matcher. TRE has some features
|
||||
which are not there in most free POSIX compatible implementations.
|
||||
Most of these features are not present in non-free implementations
|
||||
either, for that matter.
|
||||
|
||||
Approximate matching
|
||||
--------------------
|
||||
|
||||
Approximate pattern matching allows matches to be approximate, that
|
||||
is, allows the matches to be close to the searched pattern under
|
||||
some measure of closeness. TRE uses the edit-distance measure (also
|
||||
known as the Levenshtein distance) where characters can be
|
||||
inserted, deleted, or substituted in the searched text in order to
|
||||
get an exact match.
|
||||
|
||||
Each insertion, deletion, or substitution adds the distance, or cost,
|
||||
of the match. TRE can report the matches which have a cost lower than
|
||||
some given threshold value. TRE can also be used to search for matches
|
||||
with the lowest cost.
|
||||
|
||||
TRE includes a version of the agrep (approximate grep) command line
|
||||
tool for approximate regexp matching in the style of grep. Unlike
|
||||
other agrep implementations (like the one by Sun Wu and Udi Manber
|
||||
from University of Arizona) TRE agrep allows full regexps of any
|
||||
length, any number of errors, and non-uniform costs for insertion,
|
||||
deletion and substitution.
|
||||
|
||||
Strict standard conformance
|
||||
---------------------------
|
||||
|
||||
POSIX defines the behaviour of regexp functions precisely. TRE
|
||||
attempts to conform to these specifications as strictly as possible.
|
||||
TRE always returns the correct matches for subpatterns, for example.
|
||||
Very few other implementations do this correctly. In fact, the only
|
||||
other implementations besides TRE that I am aware of (free or not)
|
||||
that get it right are Rx by Tom Lord, Regex++ by John Maddock, and the
|
||||
AT&T ast regex by Glenn Fowler and Doug McIlroy.
|
||||
|
||||
The standard TRE tries to conform to is the IEEE Std 1003.1-2001,
|
||||
or Open Group Base Specifications Issue 6, commonly referred to as
|
||||
"POSIX". It can be found online here. The relevant parts are the
|
||||
base specifications on regular expressions (and the rationale) and
|
||||
the description of the regcomp() API.
|
||||
|
||||
For an excellent survey on POSIX regexp matchers, see the testregex
|
||||
pages by Glenn Fowler of AT&T Labs Research.
|
||||
|
||||
Predictable matching speed
|
||||
--------------------------
|
||||
|
||||
Because of the matching algorithm used in TRE, the maximum time
|
||||
consumed by any regexec() call is always directly proportional to
|
||||
the length of the searched string. There is one exception: if back
|
||||
references are used, the matching may take time that grows
|
||||
exponentially with the length of the string. This is because
|
||||
matching back references is an NP complete problem, and almost
|
||||
certainly requires exponential time to match in the worst case.
|
||||
|
||||
Predictable and modest memory consumption
|
||||
-----------------------------------------
|
||||
|
||||
A regexec() call never allocates memory from the heap. TRE
|
||||
allocates all the memory it needs during a regcomp() call, and some
|
||||
temporary working space from the stack frame for the duration of
|
||||
the regexec() call. The amount of temporary space needed is
|
||||
constant during matching and does not depend on the searched
|
||||
string. For regexps of reasonable size TRE needs less than 50K of
|
||||
dynamically allocated memory during the regcomp() call, less than
|
||||
20K for the compiled pattern buffer, and less than two kilobytes of
|
||||
temporary working space from the stack frame during a regexec()
|
||||
call. There is no time/memory tradeoff. TRE is also small in code
|
||||
size; statically linking with TRE increases the executable size
|
||||
less than 30K (gcc-3.2, x86, GNU/Linux).
|
||||
|
||||
Wide character and multibyte character set support
|
||||
--------------------------------------------------
|
||||
|
||||
TRE supports multibyte character sets. This makes it possible to
|
||||
use regexps seamlessly with, for example, Japanese locales. TRE
|
||||
also provides a wide character API.
|
||||
|
||||
Binary pattern and data support
|
||||
-------------------------------
|
||||
|
||||
TRE provides APIs which allow binary zero characters both in
|
||||
regexps and searched strings. The standard API cannot be easily
|
||||
used to, for example, search for printable words from binary data
|
||||
(although it is possible with some hacking). Searching for patterns
|
||||
which contain binary zeroes embedded is not possible at all with
|
||||
the standard API.
|
||||
|
||||
Completely thread safe
|
||||
----------------------
|
||||
|
||||
TRE is completely thread safe. All the exported functions are
|
||||
re-entrant, and a single compiled regexp object can be used
|
||||
simultaneously in multiple contexts; e.g. in main() and a signal
|
||||
handler, or in many threads of a multithreaded application.
|
||||
|
||||
Portable
|
||||
--------
|
||||
|
||||
TRE is portable across multiple platforms. Here's a table of
|
||||
platforms and compilers that have been successfully used to compile
|
||||
and run TRE:
|
||||
|
||||
<table>
|
||||
<tr><th>Platform(s)</th> <th>Compiler(s)</th></tr>
|
||||
<tr><td>AIX 4.3.2 - 5.3.0</td> <td>GCC, C for AIX compiler version 5</td></tr>
|
||||
<tr><td>Compaq Tru64 UNIX V5.1A/B</td> <td>Compaq C V6.4-014 - V6.5-011</td></tr>
|
||||
<tr><td>Cygwin 1.3 - 1.5</td> <td>GCC</td></tr>
|
||||
<tr><td>Digital UNIX V4.0</td> <td>DEC C V5.9-005</td></tr>
|
||||
<tr><td>FreeBSD 4 and above</td> <td>GCC</td></tr>
|
||||
<tr><td>GNU/Linux systems on x86, x86_64, ppc64, s390</td><td>GCC</td></tr>
|
||||
<tr><td>HP-UX 10.20- 11.00</td> <td>GCC, HP C Compiler</td></tr>
|
||||
<tr><td>IRIX 6.5</td> <td>GCC, MIPSpro Compilers 7.3.1.3m</td></tr>
|
||||
<tr><td>Max OS X</td></tr>
|
||||
<tr><td>NetBSD 1.5 and above</td> <td>GCC, egcs</td></tr>
|
||||
<tr><td>OpenBSD 3.3 and above</td> <td>GCC</td></tr>
|
||||
<tr><td>Solaris 2.7-10 sparc/x86</td> <td>GCC, Sun Workshop 6 compilers</td></tr>
|
||||
<tr><td>Windows 98 - XP</td> <td>Microsoft Visual C++ 6.0</td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
TRE 0.7.5 should compile without changes on all of the above
|
||||
platforms. Tell me if you are using TRE on a platform that is not
|
||||
listed above, and I'll add it to the list. Also let me know if TRE
|
||||
does not work on a listed platform.
|
||||
|
||||
Depending on the platform, you may need to install libutf8 to get
|
||||
wide character and multibyte character set support.
|
||||
|
||||
Free
|
||||
----
|
||||
|
||||
TRE is released under a license which is essentially the same as
|
||||
the "2 clause" BSD-style license used in NetBSD. See the file
|
||||
LICENSE for details.
|
||||
|
||||
Roadmap
|
||||
-------
|
||||
|
||||
There are currently two features, both related to collating
|
||||
elements, missing from 100% POSIX compliance. These are:
|
||||
|
||||
* Support for collating elements (e.g. [[.<X>.]], where <X> is a
|
||||
collating element). It is not possible to support
|
||||
multi-character collating elements portably, since POSIX does
|
||||
not define a way to determine whether a character sequence is a
|
||||
multi-character collating element or not.
|
||||
|
||||
* Support for equivalence classes, for example [[=<X>=]], where
|
||||
<X> is a collating element. An equivalence class matches any
|
||||
character which has the same primary collation weight as
|
||||
<X>. Again, POSIX provides no portable mechanism for
|
||||
determining the primary collation weight of a collating
|
||||
element.
|
||||
|
||||
Note that other portable regexp implementations don't support
|
||||
collating elements either. The single exception is Regex++, which
|
||||
comes with its own database for collating elements for different
|
||||
locales. Support for collating elements and equivalence classes has
|
||||
not been widely requested and is not very high on the TODO list at
|
||||
the moment.
|
||||
|
||||
These are other features I'm planning to implement real soon now:
|
||||
|
||||
* All the missing GNU extensions enabled in GNU regex, such as
|
||||
[[:<:]] and [[:>:]]
|
||||
|
||||
* A REG_SHORTEST regexec() flag for returning the shortest match
|
||||
instead of the longest match.
|
||||
|
||||
* Perl-compatible syntax
|
||||
* `[:^class:]`
|
||||
* Matches anything but the characters in class. Note that
|
||||
* [^[:class:]] works already, this would be just a
|
||||
* convenience shorthand.
|
||||
*
|
||||
* `\A`
|
||||
* Match only at beginning of string
|
||||
*
|
||||
* `\Z`
|
||||
* Match only at end of string, or before newline at the end
|
||||
*
|
||||
* `\z`
|
||||
* Match only at end of string
|
||||
*
|
||||
* `\l`
|
||||
* Lowercase next char (think vi)
|
||||
*
|
||||
* `\u`
|
||||
* Uppercase next char (think vi)
|
||||
*
|
||||
* `\L`
|
||||
* Lowercase till \E (think vi)
|
||||
*
|
||||
* `\U`
|
||||
* Uppercase till \E (think vi)
|
||||
*
|
||||
* `(?=pattern)`
|
||||
* Zero-width positive look-ahead assertions.
|
||||
*
|
||||
* `(?!pattern)`
|
||||
* Zero-width negative look-ahead assertions.
|
||||
*
|
||||
* `(?<=pattern)`
|
||||
* Zero-width positive look-behind assertions.
|
||||
*
|
||||
* `(?<!pattern)`
|
||||
* Zero-width negative look-behind assertions.
|
||||
|
||||
Documentation especially for the nonstandard features of TRE, such
|
||||
as approximate matching, is a work in progress (with "progress"
|
||||
loosely defined...)
|
|
@ -1,9 +1,9 @@
|
|||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(TRE, 0.8.0, [tre-general@lists.laurikari.net])
|
||||
AC_INIT(TRE, 0.8.0)
|
||||
AC_CONFIG_SRCDIR([lib/regcomp.c])
|
||||
AC_CONFIG_AUX_DIR(utils)
|
||||
AC_CANONICAL_TARGET
|
||||
AM_INIT_AUTOMAKE(1.9.0)
|
||||
AM_INIT_AUTOMAKE([foreign])
|
||||
AC_PREREQ(2.59)
|
||||
AM_GNU_GETTEXT_VERSION(0.17)
|
||||
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
/* tre-config.h. This file defines all compile time definitions
|
||||
that are needed in `regex.h' for Win32. */
|
||||
|
||||
/* Define to 1 if you have `alloca', as a function or macro. */
|
||||
#define HAVE_ALLOCA 1
|
||||
|
||||
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
|
||||
*/
|
||||
#define HAVE_ALLOCA_H 1
|
||||
|
||||
/* Define to 1 if you have the <libutf8.h> header file. */
|
||||
/* #undef HAVE_LIBUTF8_H */
|
||||
|
||||
/* Define to 1 if the system has the type `reg_errcode_t'. */
|
||||
/* #undef HAVE_REG_ERRCODE_T */
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <wchar.h> header file. */
|
||||
#define HAVE_WCHAR_H 1
|
||||
|
||||
/* Define if you want to enable approximate matching functionality. */
|
||||
#define TRE_APPROX 1
|
||||
|
||||
/* Define to enable multibyte character set support. */
|
||||
#define TRE_MULTIBYTE 1
|
||||
|
||||
/* Define to the absolute path to the system regex.h */
|
||||
/* #undef TRE_SYSTEM_REGEX_H_PATH */
|
||||
|
||||
/* Define if you want TRE to use alloca() instead of malloc() when allocating
|
||||
memory needed for regexec operations. */
|
||||
#define TRE_USE_ALLOCA 1
|
||||
|
||||
/* Define to include the system regex.h from TRE regex.h */
|
||||
/* #undef TRE_USE_SYSTEM_REGEX_H */
|
||||
|
||||
/* Define to enable wide character (wchar_t) support. */
|
||||
#define TRE_WCHAR 1
|
||||
|
||||
/* TRE version string. */
|
||||
#define TRE_VERSION "0.8.0"
|
||||
|
||||
/* TRE version level 1. */
|
||||
#define TRE_VERSION_1 0
|
||||
|
||||
/* TRE version level 2. */
|
||||
#define TRE_VERSION_2 8
|
||||
|
||||
/* TRE version level 3. */
|
||||
#define TRE_VERSION_3 0
|
|
@ -0,0 +1,276 @@
|
|||
/*
|
||||
tre.h - TRE public API definitions
|
||||
|
||||
This software is released under a BSD-style license.
|
||||
See the file LICENSE for details and copyright.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef TRE_H
|
||||
#define TRE_H 1
|
||||
|
||||
#include "tre-config.h"
|
||||
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif /* HAVE_SYS_TYPES_H */
|
||||
|
||||
#ifdef HAVE_LIBUTF8_H
|
||||
#include <libutf8.h>
|
||||
#endif /* HAVE_LIBUTF8_H */
|
||||
|
||||
#ifdef TRE_USE_SYSTEM_REGEX_H
|
||||
/* Include the system regex.h to make TRE ABI compatible with the
|
||||
system regex. */
|
||||
#include TRE_SYSTEM_REGEX_H_PATH
|
||||
#define tre_regcomp regcomp
|
||||
#define tre_regexec regexec
|
||||
#define tre_regerror regerror
|
||||
#define tre_regfree regfree
|
||||
#endif /* TRE_USE_SYSTEM_REGEX_H */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef TRE_USE_SYSTEM_REGEX_H
|
||||
|
||||
#ifndef REG_OK
|
||||
#define REG_OK 0
|
||||
#endif /* !REG_OK */
|
||||
|
||||
#ifndef HAVE_REG_ERRCODE_T
|
||||
typedef int reg_errcode_t;
|
||||
#endif /* !HAVE_REG_ERRCODE_T */
|
||||
|
||||
#if !defined(REG_NOSPEC) && !defined(REG_LITERAL)
|
||||
#define REG_LITERAL 0x1000
|
||||
#endif
|
||||
|
||||
/* Extra tre_regcomp() flags. */
|
||||
#ifndef REG_BASIC
|
||||
#define REG_BASIC 0
|
||||
#endif /* !REG_BASIC */
|
||||
#define REG_RIGHT_ASSOC (REG_LITERAL << 1)
|
||||
#define REG_UNGREEDY (REG_RIGHT_ASSOC << 1)
|
||||
|
||||
/* Extra tre_regexec() flags. */
|
||||
#define REG_APPROX_MATCHER 0x1000
|
||||
#define REG_BACKTRACKING_MATCHER (REG_APPROX_MATCHER << 1)
|
||||
|
||||
#else /* !TRE_USE_SYSTEM_REGEX_H */
|
||||
|
||||
/* If the we're not using system regex.h, we need to define the
|
||||
structs and enums ourselves. */
|
||||
|
||||
typedef int regoff_t;
|
||||
typedef struct {
|
||||
size_t re_nsub; /* Number of parenthesized subexpressions. */
|
||||
void *value; /* For internal use only. */
|
||||
} regex_t;
|
||||
|
||||
typedef struct {
|
||||
regoff_t rm_so;
|
||||
regoff_t rm_eo;
|
||||
} regmatch_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
REG_OK = 0, /* No error. */
|
||||
/* POSIX tre_regcomp() return error codes. (In the order listed in the
|
||||
standard.) */
|
||||
REG_NOMATCH, /* No match. */
|
||||
REG_BADPAT, /* Invalid regexp. */
|
||||
REG_ECOLLATE, /* Unknown collating element. */
|
||||
REG_ECTYPE, /* Unknown character class name. */
|
||||
REG_EESCAPE, /* Trailing backslash. */
|
||||
REG_ESUBREG, /* Invalid back reference. */
|
||||
REG_EBRACK, /* "[]" imbalance */
|
||||
REG_EPAREN, /* "\(\)" or "()" imbalance */
|
||||
REG_EBRACE, /* "\{\}" or "{}" imbalance */
|
||||
REG_BADBR, /* Invalid content of {} */
|
||||
REG_ERANGE, /* Invalid use of range operator */
|
||||
REG_ESPACE, /* Out of memory. */
|
||||
REG_BADRPT /* Invalid use of repetition operators. */
|
||||
} reg_errcode_t;
|
||||
|
||||
/* POSIX tre_regcomp() flags. */
|
||||
#define REG_EXTENDED 1
|
||||
#define REG_ICASE (REG_EXTENDED << 1)
|
||||
#define REG_NEWLINE (REG_ICASE << 1)
|
||||
#define REG_NOSUB (REG_NEWLINE << 1)
|
||||
|
||||
/* Extra tre_regcomp() flags. */
|
||||
#define REG_BASIC 0
|
||||
#define REG_LITERAL (REG_NOSUB << 1)
|
||||
#define REG_RIGHT_ASSOC (REG_LITERAL << 1)
|
||||
#define REG_UNGREEDY (REG_RIGHT_ASSOC << 1)
|
||||
|
||||
/* POSIX tre_regexec() flags. */
|
||||
#define REG_NOTBOL 1
|
||||
#define REG_NOTEOL (REG_NOTBOL << 1)
|
||||
|
||||
/* Extra tre_regexec() flags. */
|
||||
#define REG_APPROX_MATCHER (REG_NOTEOL << 1)
|
||||
#define REG_BACKTRACKING_MATCHER (REG_APPROX_MATCHER << 1)
|
||||
|
||||
#endif /* !TRE_USE_SYSTEM_REGEX_H */
|
||||
|
||||
/* REG_NOSPEC and REG_LITERAL mean the same thing. */
|
||||
#if defined(REG_LITERAL) && !defined(REG_NOSPEC)
|
||||
#define REG_NOSPEC REG_LITERAL
|
||||
#elif defined(REG_NOSPEC) && !defined(REG_LITERAL)
|
||||
#define REG_LITERAL REG_NOSPEC
|
||||
#endif /* defined(REG_NOSPEC) */
|
||||
|
||||
/* The maximum number of iterations in a bound expression. */
|
||||
#undef RE_DUP_MAX
|
||||
#define RE_DUP_MAX 255
|
||||
|
||||
/* The POSIX.2 regexp functions */
|
||||
extern int
|
||||
tre_regcomp(regex_t *preg, const char *regex, int cflags);
|
||||
|
||||
extern int
|
||||
tre_regexec(const regex_t *preg, const char *string, size_t nmatch,
|
||||
regmatch_t pmatch[], int eflags);
|
||||
|
||||
extern size_t
|
||||
tre_regerror(int errcode, const regex_t *preg, char *errbuf,
|
||||
size_t errbuf_size);
|
||||
|
||||
extern void
|
||||
tre_regfree(regex_t *preg);
|
||||
|
||||
#ifdef TRE_WCHAR
|
||||
#ifdef HAVE_WCHAR_H
|
||||
#include <wchar.h>
|
||||
#endif /* HAVE_WCHAR_H */
|
||||
|
||||
/* Wide character versions (not in POSIX.2). */
|
||||
extern int
|
||||
tre_regwcomp(regex_t *preg, const wchar_t *regex, int cflags);
|
||||
|
||||
extern int
|
||||
tre_regwexec(const regex_t *preg, const wchar_t *string,
|
||||
size_t nmatch, regmatch_t pmatch[], int eflags);
|
||||
#endif /* TRE_WCHAR */
|
||||
|
||||
/* Versions with a maximum length argument and therefore the capability to
|
||||
handle null characters in the middle of the strings (not in POSIX.2). */
|
||||
extern int
|
||||
tre_regncomp(regex_t *preg, const char *regex, size_t len, int cflags);
|
||||
|
||||
extern int
|
||||
tre_regnexec(const regex_t *preg, const char *string, size_t len,
|
||||
size_t nmatch, regmatch_t pmatch[], int eflags);
|
||||
|
||||
#ifdef TRE_WCHAR
|
||||
extern int
|
||||
tre_regwncomp(regex_t *preg, const wchar_t *regex, size_t len, int cflags);
|
||||
|
||||
extern int
|
||||
tre_regwnexec(const regex_t *preg, const wchar_t *string, size_t len,
|
||||
size_t nmatch, regmatch_t pmatch[], int eflags);
|
||||
#endif /* TRE_WCHAR */
|
||||
|
||||
#ifdef TRE_APPROX
|
||||
|
||||
/* Approximate matching parameter struct. */
|
||||
typedef struct {
|
||||
int cost_ins; /* Default cost of an inserted character. */
|
||||
int cost_del; /* Default cost of a deleted character. */
|
||||
int cost_subst; /* Default cost of a substituted character. */
|
||||
int max_cost; /* Maximum allowed cost of a match. */
|
||||
|
||||
int max_ins; /* Maximum allowed number of inserts. */
|
||||
int max_del; /* Maximum allowed number of deletes. */
|
||||
int max_subst; /* Maximum allowed number of substitutes. */
|
||||
int max_err; /* Maximum allowed number of errors total. */
|
||||
} regaparams_t;
|
||||
|
||||
/* Approximate matching result struct. */
|
||||
typedef struct {
|
||||
size_t nmatch; /* Length of pmatch[] array. */
|
||||
regmatch_t *pmatch; /* Submatch data. */
|
||||
int cost; /* Cost of the match. */
|
||||
int num_ins; /* Number of inserts in the match. */
|
||||
int num_del; /* Number of deletes in the match. */
|
||||
int num_subst; /* Number of substitutes in the match. */
|
||||
} regamatch_t;
|
||||
|
||||
|
||||
/* Approximate matching functions. */
|
||||
extern int
|
||||
tre_regaexec(const regex_t *preg, const char *string,
|
||||
regamatch_t *match, regaparams_t params, int eflags);
|
||||
|
||||
extern int
|
||||
tre_reganexec(const regex_t *preg, const char *string, size_t len,
|
||||
regamatch_t *match, regaparams_t params, int eflags);
|
||||
#ifdef TRE_WCHAR
|
||||
/* Wide character approximate matching. */
|
||||
extern int
|
||||
tre_regawexec(const regex_t *preg, const wchar_t *string,
|
||||
regamatch_t *match, regaparams_t params, int eflags);
|
||||
|
||||
extern int
|
||||
tre_regawnexec(const regex_t *preg, const wchar_t *string, size_t len,
|
||||
regamatch_t *match, regaparams_t params, int eflags);
|
||||
#endif /* TRE_WCHAR */
|
||||
|
||||
/* Sets the parameters to default values. */
|
||||
extern void
|
||||
tre_regaparams_default(regaparams_t *params);
|
||||
#endif /* TRE_APPROX */
|
||||
|
||||
#ifdef TRE_WCHAR
|
||||
typedef wchar_t tre_char_t;
|
||||
#else /* !TRE_WCHAR */
|
||||
typedef unsigned char tre_char_t;
|
||||
#endif /* !TRE_WCHAR */
|
||||
|
||||
typedef struct {
|
||||
int (*get_next_char)(tre_char_t *c, unsigned int *pos_add, void *context);
|
||||
void (*rewind)(size_t pos, void *context);
|
||||
int (*compare)(size_t pos1, size_t pos2, size_t len, void *context);
|
||||
void *context;
|
||||
} tre_str_source;
|
||||
|
||||
extern int
|
||||
tre_reguexec(const regex_t *preg, const tre_str_source *string,
|
||||
size_t nmatch, regmatch_t pmatch[], int eflags);
|
||||
|
||||
/* Returns the version string. The returned string is static. */
|
||||
extern char *
|
||||
tre_version(void);
|
||||
|
||||
/* Returns the value for a config parameter. The type to which `result'
|
||||
must point to depends of the value of `query', see documentation for
|
||||
more details. */
|
||||
extern int
|
||||
tre_config(int query, void *result);
|
||||
|
||||
enum {
|
||||
TRE_CONFIG_APPROX,
|
||||
TRE_CONFIG_WCHAR,
|
||||
TRE_CONFIG_MULTIBYTE,
|
||||
TRE_CONFIG_SYSTEM_ABI,
|
||||
TRE_CONFIG_VERSION
|
||||
};
|
||||
|
||||
/* Returns 1 if the compiled pattern has back references, 0 if not. */
|
||||
extern int
|
||||
tre_have_backrefs(const regex_t *preg);
|
||||
|
||||
/* Returns 1 if the compiled pattern uses approximate matching features,
|
||||
0 if not. */
|
||||
extern int
|
||||
tre_have_approx(const regex_t *preg);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* TRE_H */
|
||||
|
||||
/* EOF */
|
|
@ -1,5 +1,4 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
lib_LTLIBRARIES = libtre.la
|
||||
libtre_la_LDFLAGS = -no-undefined -version-info 5:0:0 $(LDFLAGS)
|
||||
libtre_la_LIBADD = $(LTLIBINTL)
|
||||
|
|
|
@ -99,12 +99,59 @@ tre_regncomp(regex_t *preg, const char *regex, size_t n, int cflags)
|
|||
return ret;
|
||||
}
|
||||
|
||||
/* this version takes bytes literally, to be used with raw vectors */
|
||||
int
|
||||
tre_regncompb(regex_t *preg, const char *regex, size_t n, int cflags)
|
||||
{
|
||||
int ret;
|
||||
#if TRE_WCHAR /* wide chars = we need to convert it all to the wide format */
|
||||
tre_char_t *wregex;
|
||||
size_t i;
|
||||
|
||||
wregex = xmalloc(sizeof(tre_char_t) * n);
|
||||
if (wregex == NULL)
|
||||
return REG_ESPACE;
|
||||
|
||||
for (i = 0; i < n; i++)
|
||||
wregex[i] = (tre_char_t) ((unsigned char) regex[i]);
|
||||
|
||||
ret = tre_compile(preg, wregex, n, cflags | REG_USEBYTES);
|
||||
xfree(wregex);
|
||||
#else /* !TRE_WCHAR */
|
||||
ret = tre_compile(preg, (const tre_char_t *)regex, n, cflags | REG_USEBYTES);
|
||||
#endif /* !TRE_WCHAR */
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int
|
||||
tre_regcomp(regex_t *preg, const char *regex, int cflags)
|
||||
{
|
||||
return tre_regncomp(preg, regex, regex ? strlen(regex) : 0, cflags);
|
||||
}
|
||||
|
||||
int
|
||||
tre_regcompb(regex_t *preg, const char *regex, int cflags)
|
||||
{
|
||||
int ret;
|
||||
tre_char_t *wregex;
|
||||
size_t wlen, n = strlen(regex);
|
||||
unsigned int i;
|
||||
const unsigned char *str = (const unsigned char *)regex;
|
||||
tre_char_t *wstr;
|
||||
|
||||
wregex = xmalloc(sizeof(tre_char_t) * (n + 1));
|
||||
if (wregex == NULL) return REG_ESPACE;
|
||||
wstr = wregex;
|
||||
|
||||
for (i = 0; i < n; i++) *(wstr++) = *(str++);
|
||||
wlen = n;
|
||||
wregex[wlen] = L'\0';
|
||||
ret = tre_compile(preg, wregex, wlen, cflags | REG_USEBYTES);
|
||||
xfree(wregex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#ifdef TRE_WCHAR
|
||||
int
|
||||
|
|
|
@ -216,6 +216,24 @@ tre_regexec(const regex_t *preg, const char *str,
|
|||
return tre_regnexec(preg, str, (unsigned)-1, nmatch, pmatch, eflags);
|
||||
}
|
||||
|
||||
int
|
||||
tre_regexecb(const regex_t *preg, const char *str,
|
||||
size_t nmatch, regmatch_t pmatch[], int eflags)
|
||||
{
|
||||
tre_tnfa_t *tnfa = (void *)preg->TRE_REGEX_T_FIELD;
|
||||
|
||||
return tre_match(tnfa, str, (unsigned)-1, STR_BYTE, nmatch, pmatch, eflags);
|
||||
}
|
||||
|
||||
int
|
||||
tre_regnexecb(const regex_t *preg, const char *str, size_t len,
|
||||
size_t nmatch, regmatch_t pmatch[], int eflags)
|
||||
{
|
||||
tre_tnfa_t *tnfa = (void *)preg->TRE_REGEX_T_FIELD;
|
||||
|
||||
return tre_match(tnfa, str, len, STR_BYTE, nmatch, pmatch, eflags);
|
||||
}
|
||||
|
||||
|
||||
#ifdef TRE_WCHAR
|
||||
|
||||
|
@ -309,6 +327,16 @@ tre_regaexec(const regex_t *preg, const char *str,
|
|||
return tre_reganexec(preg, str, (unsigned)-1, match, params, eflags);
|
||||
}
|
||||
|
||||
int
|
||||
tre_regaexecb(const regex_t *preg, const char *str,
|
||||
regamatch_t *match, regaparams_t params, int eflags)
|
||||
{
|
||||
tre_tnfa_t *tnfa = (void *)preg->TRE_REGEX_T_FIELD;
|
||||
|
||||
return tre_match_approx(tnfa, str, (unsigned)-1, STR_BYTE,
|
||||
match, params, eflags);
|
||||
}
|
||||
|
||||
#ifdef TRE_WCHAR
|
||||
|
||||
int
|
||||
|
|
|
@ -1619,8 +1619,8 @@ tre_make_trans(tre_pos_and_tags_t *p1, tre_pos_and_tags_t *p2,
|
|||
(trans + 1)->state = NULL;
|
||||
/* Use the character ranges, assertions, etc. from `p1' for
|
||||
the transition from `p1' to `p2'. */
|
||||
trans->code_min = p1->code_min;
|
||||
trans->code_max = p1->code_max;
|
||||
trans->code_min = (tre_cint_t) p1->code_min;
|
||||
trans->code_max = (tre_cint_t) p1->code_max;
|
||||
trans->state = transitions + offs[p2->position];
|
||||
trans->state_id = p2->position;
|
||||
trans->assertions = p1->assertions | p2->assertions
|
||||
|
@ -1845,10 +1845,10 @@ tre_ast_to_tnfa(tre_ast_node_t *node, tre_tnfa_transition_t *transitions,
|
|||
do \
|
||||
{ \
|
||||
errcode = err; \
|
||||
if (/*CONSTCOND*/1) \
|
||||
if (/*CONSTCOND*/(void)1,1) \
|
||||
goto error_exit; \
|
||||
} \
|
||||
while (/*CONSTCOND*/0)
|
||||
while (/*CONSTCOND*/(void)0,0)
|
||||
|
||||
|
||||
int
|
||||
|
@ -1890,6 +1890,8 @@ tre_compile(regex_t *preg, const tre_char_t *regex, size_t n, int cflags)
|
|||
parse_ctx.len = n;
|
||||
parse_ctx.cflags = cflags;
|
||||
parse_ctx.max_backref = -1;
|
||||
/* workaround for PR#14408: use 8-bit optimizations in 8-bit mode */
|
||||
parse_ctx.cur_max = (cflags & REG_USEBYTES) ? 1 : TRE_MB_CUR_MAX;
|
||||
DPRINT(("tre_compile: parsing '%.*" STRF "'\n", (int)n, regex));
|
||||
errcode = tre_parse(&parse_ctx);
|
||||
if (errcode != REG_OK)
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
tre-filter.c: Histogram filter to quickly find regexp match candidates
|
||||
|
||||
This software is released under a BSD-style license.
|
||||
See the file LICENSE for details and copyright.
|
||||
|
||||
*/
|
||||
|
||||
/* The idea of this filter is quite simple. First, let's assume the
|
||||
search pattern is a simple string. In order for a substring of a
|
||||
longer string to match the search pattern, it must have the same
|
||||
numbers of different characters as the pattern, and those
|
||||
characters must occur in the same order as they occur in pattern. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
#include <stdio.h>
|
||||
#include "tre-internal.h"
|
||||
#include "tre-filter.h"
|
||||
|
||||
int
|
||||
tre_filter_find(const unsigned char *str, size_t len, tre_filter_t *filter)
|
||||
{
|
||||
unsigned short counts[256];
|
||||
unsigned int i;
|
||||
unsigned int window_len = filter->window_len;
|
||||
tre_filter_profile_t *profile = filter->profile;
|
||||
const unsigned char *str_orig = str;
|
||||
|
||||
DPRINT(("tre_filter_find: %.*s\n", len, str));
|
||||
|
||||
for (i = 0; i < elementsof(counts); i++)
|
||||
counts[i] = 0;
|
||||
|
||||
i = 0;
|
||||
while (*str && i < window_len && i < len)
|
||||
{
|
||||
counts[*str]++;
|
||||
i++;
|
||||
str++;
|
||||
len--;
|
||||
}
|
||||
|
||||
while (len > 0)
|
||||
{
|
||||
tre_filter_profile_t *p;
|
||||
counts[*str]++;
|
||||
counts[*(str - window_len)]--;
|
||||
|
||||
p = profile;
|
||||
while (p->ch)
|
||||
{
|
||||
if (counts[p->ch] < p->count)
|
||||
break;
|
||||
p++;
|
||||
}
|
||||
if (!p->ch)
|
||||
{
|
||||
DPRINT(("Found possible match at %d\n",
|
||||
str - str_orig));
|
||||
return str - str_orig;
|
||||
}
|
||||
else
|
||||
{
|
||||
DPRINT(("No match so far...\n"));
|
||||
}
|
||||
len--;
|
||||
str++;
|
||||
}
|
||||
DPRINT(("This string cannot match.\n"));
|
||||
return -1;
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
unsigned char ch;
|
||||
unsigned char count;
|
||||
} tre_filter_profile_t;
|
||||
|
||||
typedef struct {
|
||||
/* Length of the window where the character counts are kept. */
|
||||
int window_len;
|
||||
/* Required character counts table. */
|
||||
tre_filter_profile_t *profile;
|
||||
} tre_filter_t;
|
||||
|
||||
|
||||
int
|
||||
tre_filter_find(const unsigned char *str, size_t len, tre_filter_t *filter);
|
|
@ -22,9 +22,9 @@
|
|||
|
||||
#ifdef TRE_DEBUG
|
||||
#include <stdio.h>
|
||||
#define DPRINT(msg) do {printf msg; fflush(stdout);} while(/*CONSTCOND*/0)
|
||||
#define DPRINT(msg) do {printf msg; fflush(stdout);} while(/*CONSTCOND*/(void)0,0)
|
||||
#else /* !TRE_DEBUG */
|
||||
#define DPRINT(msg) do { } while(/*CONSTCOND*/0)
|
||||
#define DPRINT(msg) do { } while(/*CONSTCOND*/(void)0,0)
|
||||
#endif /* !TRE_DEBUG */
|
||||
|
||||
#define elementsof(x) ( sizeof(x) / sizeof(x[0]) )
|
||||
|
|
|
@ -323,7 +323,7 @@ tre_tnfa_run_approx(const tre_tnfa_t *tnfa, const void *string, int len,
|
|||
GET_NEXT_WCHAR();
|
||||
pos = 0;
|
||||
|
||||
while (/*CONSTCOND*/1)
|
||||
while (/*CONSTCOND*/(void)1,1)
|
||||
{
|
||||
DPRINT(("%03d:%2lc/%05d\n", pos, (tre_cint_t)next_c, (int)next_c));
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ typedef struct tre_backtrack_struct {
|
|||
#ifdef TRE_USE_ALLOCA
|
||||
#define tre_bt_mem_new tre_mem_newa
|
||||
#define tre_bt_mem_alloc tre_mem_alloca
|
||||
#define tre_bt_mem_destroy(obj) do { } while (0)
|
||||
#define tre_bt_mem_destroy(obj) do { } while (0,0)
|
||||
#else /* !TRE_USE_ALLOCA */
|
||||
#define tre_bt_mem_new tre_mem_new
|
||||
#define tre_bt_mem_alloc tre_mem_alloc
|
||||
|
@ -171,7 +171,7 @@ typedef struct tre_backtrack_struct {
|
|||
stack->item.tags[i] = (_tags)[i]; \
|
||||
BT_STACK_MBSTATE_IN; \
|
||||
} \
|
||||
while (/*CONSTCOND*/0)
|
||||
while (/*CONSTCOND*/(void)0,0)
|
||||
|
||||
#define BT_STACK_POP() \
|
||||
do \
|
||||
|
@ -184,13 +184,13 @@ typedef struct tre_backtrack_struct {
|
|||
str_byte = stack->item.str_byte; \
|
||||
BT_STACK_WIDE_OUT; \
|
||||
state = stack->item.state; \
|
||||
next_c = stack->item.next_c; \
|
||||
next_c = (tre_char_t) stack->item.next_c; \
|
||||
for (i = 0; i < tnfa->num_tags; i++) \
|
||||
tags[i] = stack->item.tags[i]; \
|
||||
BT_STACK_MBSTATE_OUT; \
|
||||
stack = stack->prev; \
|
||||
} \
|
||||
while (/*CONSTCOND*/0)
|
||||
while (/*CONSTCOND*/(void)0,0)
|
||||
|
||||
#undef MIN
|
||||
#define MIN(a, b) ((a) <= (b) ? (a) : (b))
|
||||
|
@ -370,7 +370,7 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
|
|||
if (state == NULL)
|
||||
goto backtrack;
|
||||
|
||||
while (/*CONSTCOND*/1)
|
||||
while (/*CONSTCOND*/(void)1,1)
|
||||
{
|
||||
tre_tnfa_transition_t *next_state;
|
||||
int empty_br_match;
|
||||
|
@ -630,7 +630,7 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
|
|||
}
|
||||
}
|
||||
DPRINT(("restarting from next start position\n"));
|
||||
next_c = next_c_start;
|
||||
next_c = (tre_char_t) next_c_start;
|
||||
#ifdef TRE_MBSTATE
|
||||
mbstate = mbstate_start;
|
||||
#endif /* TRE_MBSTATE */
|
||||
|
|
|
@ -269,7 +269,7 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len,
|
|||
DPRINT(("-------------+------------------------------------------------\n"));
|
||||
|
||||
reach_next_i = reach_next;
|
||||
while (/*CONSTCOND*/1)
|
||||
while (/*CONSTCOND*/(void)1,1)
|
||||
{
|
||||
/* If no match found yet, add the initial states to `reach_next'. */
|
||||
if (match_eo < 0)
|
||||
|
@ -320,7 +320,7 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len,
|
|||
else
|
||||
{
|
||||
if (num_tags == 0 || reach_next_i == reach_next)
|
||||
/* We have found a match. */
|
||||
/* We have found a match. */
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@
|
|||
str_user_end = str_source->get_next_char(&next_c, &pos_add_next, \
|
||||
str_source->context); \
|
||||
} \
|
||||
} while(/*CONSTCOND*/0)
|
||||
} while(/*CONSTCOND*/(void)0,0)
|
||||
|
||||
#else /* !TRE_MULTIBYTE */
|
||||
|
||||
|
@ -107,7 +107,7 @@
|
|||
str_user_end = str_source->get_next_char(&next_c, &pos_add_next, \
|
||||
str_source->context); \
|
||||
} \
|
||||
} while(/*CONSTCOND*/0)
|
||||
} while(/*CONSTCOND*/(void)0,0)
|
||||
|
||||
#endif /* !TRE_MULTIBYTE */
|
||||
|
||||
|
@ -132,7 +132,7 @@
|
|||
str_user_end = str_source->get_next_char(&next_c, &pos_add_next, \
|
||||
str_source->context); \
|
||||
} \
|
||||
} while(/*CONSTCOND*/0)
|
||||
} while(/*CONSTCOND*/(void)0,0)
|
||||
|
||||
#endif /* !TRE_WCHAR */
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ tre_expand_ctype(tre_mem_t mem, tre_ctype_t class, tre_ast_node_t ***items,
|
|||
DPRINT((" expanding class to character ranges\n"));
|
||||
for (j = 0; (j < 256) && (status == REG_OK); j++)
|
||||
{
|
||||
c = j;
|
||||
c = (tre_cint_t) j;
|
||||
if (tre_isctype(c, class)
|
||||
|| ((cflags & REG_ICASE)
|
||||
&& (tre_isctype(tre_tolower(c), class)
|
||||
|
@ -332,7 +332,7 @@ tre_parse_bracket_items(tre_parse_ctx_t *ctx, int negate,
|
|||
if (!class)
|
||||
status = REG_ECTYPE;
|
||||
/* Optimize character classes for 8 bit character sets. */
|
||||
if (status == REG_OK && TRE_MB_CUR_MAX == 1)
|
||||
if (status == REG_OK && ctx->cur_max == 1)
|
||||
{
|
||||
status = tre_expand_ctype(ctx->mem, class, items,
|
||||
&i, &max_i, ctx->cflags);
|
||||
|
@ -1210,7 +1210,7 @@ tre_parse(tre_parse_ctx_t *ctx)
|
|||
DPRINT(("tre_parse: extension: '%.*" STRF "\n",
|
||||
REST(ctx->re)));
|
||||
ctx->re += 2;
|
||||
while (/*CONSTCOND*/1)
|
||||
while (/*CONSTCOND*/(void)1,1)
|
||||
{
|
||||
if (*ctx->re == L'i')
|
||||
{
|
||||
|
|
|
@ -38,6 +38,8 @@ typedef struct {
|
|||
int nofirstsub;
|
||||
/* The currently set approximate matching parameters. */
|
||||
int params[TRE_PARAM_LAST];
|
||||
/* the CUR_MAX in use */
|
||||
int cur_max;
|
||||
} tre_parse_ctx_t;
|
||||
|
||||
/* Parses a wide character regexp pattern into a syntax tree. This parser
|
||||
|
|
|
@ -54,7 +54,7 @@ declare_popf(int, int);
|
|||
{ \
|
||||
status = tre_stack_push_ ## typetag(s, value); \
|
||||
} \
|
||||
while (/*CONSTCOND*/0)
|
||||
while (/*CONSTCOND*/(void)0,0)
|
||||
|
||||
#define STACK_PUSHX(s, typetag, value) \
|
||||
{ \
|
||||
|
|
|
@ -106,6 +106,8 @@ typedef enum {
|
|||
#define REG_RIGHT_ASSOC (REG_LITERAL << 1)
|
||||
#define REG_UNGREEDY (REG_RIGHT_ASSOC << 1)
|
||||
|
||||
#define REG_USEBYTES (REG_UNGREEDY << 1)
|
||||
|
||||
/* POSIX tre_regexec() flags. */
|
||||
#define REG_NOTBOL 1
|
||||
#define REG_NOTEOL (REG_NOTBOL << 1)
|
||||
|
@ -135,6 +137,13 @@ extern int
|
|||
tre_regexec(const regex_t *preg, const char *string, size_t nmatch,
|
||||
regmatch_t pmatch[], int eflags);
|
||||
|
||||
extern int
|
||||
tre_regcompb(regex_t *preg, const char *regex, int cflags);
|
||||
|
||||
extern int
|
||||
tre_regexecb(const regex_t *preg, const char *string, size_t nmatch,
|
||||
regmatch_t pmatch[], int eflags);
|
||||
|
||||
extern size_t
|
||||
tre_regerror(int errcode, const regex_t *preg, char *errbuf,
|
||||
size_t errbuf_size);
|
||||
|
@ -165,6 +174,14 @@ extern int
|
|||
tre_regnexec(const regex_t *preg, const char *string, size_t len,
|
||||
size_t nmatch, regmatch_t pmatch[], int eflags);
|
||||
|
||||
/* regn*b versions take byte literally as 8-bit values */
|
||||
extern int
|
||||
tre_regncompb(regex_t *preg, const char *regex, size_t n, int cflags);
|
||||
|
||||
extern int
|
||||
tre_regnexecb(const regex_t *preg, const char *str, size_t len,
|
||||
size_t nmatch, regmatch_t pmatch[], int eflags);
|
||||
|
||||
#ifdef TRE_WCHAR
|
||||
extern int
|
||||
tre_regwncomp(regex_t *preg, const wchar_t *regex, size_t len, int cflags);
|
||||
|
@ -208,6 +225,11 @@ tre_regaexec(const regex_t *preg, const char *string,
|
|||
extern int
|
||||
tre_reganexec(const regex_t *preg, const char *string, size_t len,
|
||||
regamatch_t *match, regaparams_t params, int eflags);
|
||||
|
||||
extern int
|
||||
tre_regaexecb(const regex_t *preg, const char *string,
|
||||
regamatch_t *match, regaparams_t params, int eflags);
|
||||
|
||||
#ifdef TRE_WCHAR
|
||||
/* Wide character approximate matching. */
|
||||
extern int
|
||||
|
|
|
@ -5,10 +5,11 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: TRE 0.7.4\n"
|
||||
"Report-Msgid-Bugs-To: tre-general@lists.laurikari.net\n"
|
||||
"POT-Creation-Date: 2009-09-18 15:41+0300\n"
|
||||
"POT-Creation-Date: 2016-12-08 11:31+0200\n"
|
||||
"PO-Revision-Date: 2002-07-29 23:46+0300\n"
|
||||
"Last-Translator: Ville Laurikari <vl@iki.fi>\n"
|
||||
"Language-Team: Finnish <translation-team-fi@lists.sourceforge.net>\n"
|
||||
"Language: fi\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=ISO-8859-1\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
|
|
@ -6,10 +6,11 @@ msgid ""
|
|||
msgstr ""
|
||||
"Project-Id-Version: tre\n"
|
||||
"Report-Msgid-Bugs-To: tre-general@lists.laurikari.net\n"
|
||||
"POT-Creation-Date: 2009-09-18 15:41+0300\n"
|
||||
"POT-Creation-Date: 2016-12-08 11:31+0200\n"
|
||||
"PO-Revision-Date: 2006-05-23 21:27+0100\n"
|
||||
"Last-Translator: Daniel Nylander <po@danielnylander.se>\n"
|
||||
"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
|
||||
"Language: sv\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=utf-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
# Copyright (c) 2009 Ville Laurikari <ville@laurikari.net>
|
||||
#
|
||||
|
||||
import distutils.sysconfig
|
||||
from distutils.core import setup, Extension
|
||||
import sys
|
||||
import os
|
||||
|
@ -14,7 +15,8 @@ include_dirs = ["../lib"]
|
|||
libraries = ["tre"]
|
||||
|
||||
if sys.platform == "win32":
|
||||
data_files = ["tre.dll"]
|
||||
# Place tre.dll in site-packages, next to tre.pyd.
|
||||
data_files = [(distutils.sysconfig.get_python_lib(), ["tre.dll"])]
|
||||
include_dirs += ["../win32"]
|
||||
shutil.copy("../win32/Release/tre.dll", ".")
|
||||
libraries = ["../win32/Release/tre"]
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
# setup.py - Builds and installs the TRE Python language bindings module
|
||||
#
|
||||
# Copyright (c) 2009 Ville Laurikari <ville@laurikari.net>
|
||||
#
|
||||
|
||||
import distutils.sysconfig
|
||||
from distutils.core import setup, Extension
|
||||
import sys
|
||||
import os
|
||||
import shutil
|
||||
|
||||
version = "@TRE_VERSION@"
|
||||
data_files = []
|
||||
include_dirs = ["../lib"]
|
||||
libraries = ["tre"]
|
||||
|
||||
if sys.platform == "win32":
|
||||
# Place tre.dll in site-packages, next to tre.pyd.
|
||||
data_files = [(distutils.sysconfig.get_python_lib(), ["tre.dll"])]
|
||||
include_dirs += ["../win32"]
|
||||
shutil.copy("../win32/Release/tre.dll", ".")
|
||||
libraries = ["../win32/Release/tre"]
|
||||
|
||||
setup(name = "tre",
|
||||
version = version,
|
||||
description = "Python module for TRE",
|
||||
author = "Ville Laurikari",
|
||||
author_email = "ville@laurikari.net",
|
||||
license = "2-clause BSD",
|
||||
url = "http://laurikari.net/tre/",
|
||||
data_files = data_files,
|
||||
ext_modules = [Extension("tre",
|
||||
sources = ["tre-python.c"],
|
||||
define_macros = [("HAVE_CONFIG_H", None)],
|
||||
include_dirs = include_dirs,
|
||||
libraries = libraries
|
||||
),
|
||||
],
|
||||
)
|
|
@ -337,9 +337,18 @@ PyTrePattern_search(TrePatternObject *self, PyObject *args)
|
|||
char *targ;
|
||||
size_t tlen;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "SO!|i:match", &pstring, &TreFuzzynessType,
|
||||
if (PyTuple_Size(args) > 0 && PyUnicode_Check(PyTuple_GetItem(args, 0)))
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, "UO!|i:search", &pstring, &TreFuzzynessType,
|
||||
&fz, &eflags))
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, "SO!|i:search", &pstring, &TreFuzzynessType,
|
||||
&fz, &eflags))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
mo = newTreMatchObject();
|
||||
if (mo == NULL)
|
||||
|
@ -347,23 +356,36 @@ PyTrePattern_search(TrePatternObject *self, PyObject *args)
|
|||
|
||||
nsub = self->rgx.re_nsub + 1;
|
||||
pm = PyMem_New(regmatch_t, nsub);
|
||||
if (pm != NULL)
|
||||
if (!pm)
|
||||
{
|
||||
mo->am.nmatch = nsub;
|
||||
mo->am.pmatch = pm;
|
||||
Py_DECREF(mo);
|
||||
return PyErr_NoMemory();
|
||||
}
|
||||
|
||||
mo->am.nmatch = nsub;
|
||||
mo->am.pmatch = pm;
|
||||
|
||||
if (PyUnicode_Check(pstring))
|
||||
{
|
||||
Py_ssize_t len = PyUnicode_GetSize(pstring);
|
||||
wchar_t *buf = calloc(sizeof(wchar_t), len);
|
||||
if(!buf)
|
||||
{
|
||||
Py_DECREF(mo);
|
||||
return PyErr_NoMemory();
|
||||
}
|
||||
PyUnicode_AsWideChar(pstring, buf, len);
|
||||
rc = tre_regawnexec(&self->rgx, buf, len, &mo->am, fz->ap, eflags);
|
||||
free(buf);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* XXX */
|
||||
Py_DECREF(mo);
|
||||
return NULL;
|
||||
targ = PyString_AsString(pstring);
|
||||
tlen = PyString_Size(pstring);
|
||||
|
||||
rc = tre_reganexec(&self->rgx, targ, tlen, &mo->am, fz->ap, eflags);
|
||||
}
|
||||
|
||||
targ = PyString_AsString(pstring);
|
||||
tlen = PyString_Size(pstring);
|
||||
|
||||
rc = tre_reganexec(&self->rgx, targ, tlen, &mo->am, fz->ap, eflags);
|
||||
|
||||
if (PyErr_Occurred())
|
||||
{
|
||||
Py_DECREF(mo);
|
||||
|
@ -392,7 +414,7 @@ PyTrePattern_search(TrePatternObject *self, PyObject *args)
|
|||
|
||||
static PyMethodDef TrePattern_methods[] = {
|
||||
{ "search", (PyCFunction)PyTrePattern_search, METH_VARARGS,
|
||||
"try to match against given string, returning " TRE_MODULE ".match object "
|
||||
"try to search in the given string, returning " TRE_MODULE ".match object "
|
||||
"or None on failure" },
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
@ -445,7 +467,7 @@ static PyTypeObject TrePatternType = {
|
|||
};
|
||||
|
||||
static TrePatternObject *
|
||||
newTrePatternObject(PyObject *args)
|
||||
newTrePatternObject()
|
||||
{
|
||||
TrePatternObject *self;
|
||||
|
||||
|
@ -460,19 +482,43 @@ static PyObject *
|
|||
PyTre_ncompile(PyObject *self, PyObject *args)
|
||||
{
|
||||
TrePatternObject *rv;
|
||||
char *pattern;
|
||||
PyUnicodeObject *upattern = NULL;
|
||||
char *pattern = NULL;
|
||||
int pattlen;
|
||||
int cflags = 0;
|
||||
int rc;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "s#|i:compile", &pattern, &pattlen, &cflags))
|
||||
return NULL;
|
||||
if (PyTuple_Size(args) > 0 && PyUnicode_Check(PyTuple_GetItem(args, 0)))
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, "U|i:compile", &upattern, &cflags))
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, "s#|i:compile", &pattern, &pattlen, &cflags))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rv = newTrePatternObject(args);
|
||||
rv = newTrePatternObject();
|
||||
if (rv == NULL)
|
||||
return NULL;
|
||||
|
||||
rc = tre_regncomp(&rv->rgx, (char*)pattern, pattlen, cflags);
|
||||
if (upattern != NULL)
|
||||
{
|
||||
Py_ssize_t len = PyUnicode_GetSize(upattern);
|
||||
wchar_t *buf = calloc(sizeof(wchar_t), len);
|
||||
if(!buf)
|
||||
{
|
||||
Py_DECREF(rv);
|
||||
return PyErr_NoMemory();
|
||||
}
|
||||
PyUnicode_AsWideChar(upattern, buf, len);
|
||||
rc = tre_regwncomp(&rv->rgx, buf, len, cflags);
|
||||
free(buf);
|
||||
}
|
||||
else
|
||||
rc = tre_regncomp(&rv->rgx, (char*)pattern, pattlen, cflags);
|
||||
|
||||
if (rc != REG_OK)
|
||||
{
|
||||
if (!PyErr_Occurred())
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
localedir = $(datadir)/locale
|
||||
INCLUDES = -I$(top_srcdir)/lib
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/lib
|
||||
|
||||
if TRE_AGREP
|
||||
bin_PROGRAMS = agrep
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
AUTOMAKE_OPTIONS = subdir-objects
|
||||
|
||||
SUBDIRS = agrep
|
||||
|
||||
|
@ -59,7 +60,7 @@ endif TRE_MULTIBYTE
|
|||
randtest_LDADD = libxtre.la $(LDADD)
|
||||
endif !TRE_DEBUG
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/lib
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/lib
|
||||
|
||||
EXTRA_DIST = build-tests.sh
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
host=ahma
|
|
@ -0,0 +1 @@
|
|||
host=earthquake.cs.hut.fi
|
|
@ -0,0 +1 @@
|
|||
host=hemuli
|
|
@ -0,0 +1,14 @@
|
|||
# The host to log in and run the build.
|
||||
host=jolly.cs.hut.fi
|
||||
|
||||
# (optional) The host where to copy the distribution and scripts. It
|
||||
# seems that the scp subsystem is broken on jolly.
|
||||
scp_host=earthquake.cs.hut.fi
|
||||
|
||||
# (optional) The command to use instead of `make'.
|
||||
make=gmake
|
||||
export make
|
||||
|
||||
# Any environment variables to set before building should go here.
|
||||
CC=cc
|
||||
export CC
|
|
@ -0,0 +1,49 @@
|
|||
#! /bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if test -z "$BUILD_HAVE_SOURCES"; then
|
||||
echo -n "Building source code distribution..."
|
||||
./utils/build-sources.sh > /dev/null
|
||||
echo "OK"
|
||||
fi
|
||||
|
||||
if test -z "$*"; then
|
||||
for f in tests/build-hosts/*; do
|
||||
if test -f $f; then
|
||||
hosts="$hosts `basename $f`"
|
||||
fi
|
||||
done
|
||||
else
|
||||
hosts="$*"
|
||||
fi
|
||||
|
||||
for hostfile in $hosts; do
|
||||
(
|
||||
. tests/build-hosts/$hostfile
|
||||
pkg=`ls dist/tre-*.tar.gz`
|
||||
pkg=`basename $pkg`
|
||||
dir=`basename $pkg .tar.gz`
|
||||
if test -z "$scp_host"; then
|
||||
echo foo
|
||||
scp_host="$host"
|
||||
fi
|
||||
|
||||
cat tests/build-hosts/$hostfile > $hostfile.tmp
|
||||
echo "pkg=$pkg" >> $hostfile.tmp
|
||||
echo "dir=$dir" >> $hostfile.tmp
|
||||
chmod +x $hostfile.tmp
|
||||
|
||||
echo "Copying files to $scp_host..."
|
||||
scp dist/$pkg tests/build-run.sh $scp_host:build-tmp
|
||||
scp $hostfile.tmp $scp_host:build-tmp/build-params.sh
|
||||
rm -f $hostfile.tmp
|
||||
echo "Starting job on $host..."
|
||||
( ssh $host "cd build-tmp; ./build-run.sh";
|
||||
if test $? -ne 0; then
|
||||
echo "$host: FAILED:"
|
||||
exit 1
|
||||
fi )
|
||||
) &
|
||||
done
|
||||
wait
|
|
@ -0,0 +1,27 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
# Try to synchronize the file system in case $scp_host and $host are
|
||||
# different (NFS complains about stale file handles and whatnot
|
||||
# without this).
|
||||
sync
|
||||
sleep 1
|
||||
sync
|
||||
|
||||
. ./build-params.sh
|
||||
|
||||
# Make a unique temporary directory name.
|
||||
hostname=`hostname`
|
||||
tmpdir=build-tmp-$dir-$hostname-$$
|
||||
|
||||
rm -rf $tmpdir
|
||||
mkdir $tmpdir
|
||||
cp $pkg $tmpdir
|
||||
cd $tmpdir
|
||||
|
||||
gunzip -c $pkg | tar xf -
|
||||
cd $dir
|
||||
|
||||
./tests/build-tests.sh
|
|
@ -1,4 +1,3 @@
|
|||
EXTRA_DIST = \
|
||||
autogen.sh \
|
||||
build-rpm.sh \
|
||||
mkinstalldirs
|
||||
build-rpm.sh
|
||||
|
|
|
@ -5,9 +5,6 @@ set -e
|
|||
# Clear the cache to get a clean rebuild.
|
||||
rm -rf autom4te.cache
|
||||
|
||||
# Generate the ChangeLog file.
|
||||
darcs changes --summary > ChangeLog
|
||||
|
||||
# Replace variables here and there to get a consistent tree.
|
||||
./utils/replace-vars.sh
|
||||
|
||||
|
@ -15,9 +12,14 @@ darcs changes --summary > ChangeLog
|
|||
autopoint
|
||||
|
||||
# Set up libtool stuff for use with Automake.
|
||||
libtoolize --automake
|
||||
if type glibtoolize > /dev/null 2>&1; then
|
||||
# On macOS, this name is used for some reason.
|
||||
glibtoolize --automake
|
||||
else
|
||||
libtoolize --automake
|
||||
fi
|
||||
|
||||
# Update aclocal.m4, using the macros from the m4 directories.
|
||||
# Update aclocal.m4, using the macros from the m4 directory.
|
||||
aclocal -I m4
|
||||
|
||||
# Run autoheader to generate config.h.in.
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
rm -rf dist
|
||||
./utils/autogen.sh
|
||||
./utils/build-sources.sh
|
||||
|
||||
pkg=`ls dist/tre-*.tar.gz`
|
||||
pkg=`basename $pkg`
|
||||
dir=`basename $pkg .tar.gz`
|
||||
|
||||
scp dist/$pkg hemuli:build-tmp
|
||||
ssh hemuli "cd build-tmp; rm -rf $dir; tar xzf $pkg; cd $dir; ./utils/build-rpm.sh"
|
||||
scp hemuli:build-tmp/$dir/\*.rpm dist
|
|
@ -0,0 +1,46 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# Creates the source code distribution packages.
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
rm -rf tmp-build
|
||||
mkdir tmp-build
|
||||
cd tmp-build
|
||||
|
||||
../configure
|
||||
make dist
|
||||
|
||||
mkdir stage1-tree
|
||||
cd stage1-tree
|
||||
tar xzvf ../tre-*.tar.gz
|
||||
cd ..
|
||||
|
||||
mkdir stage2
|
||||
cd stage2
|
||||
tar xzvf ../tre-*.tar.gz
|
||||
cd tre-*
|
||||
./configure
|
||||
make dist
|
||||
cd ../..
|
||||
|
||||
mkdir stage2-tree
|
||||
cd stage2-tree
|
||||
tar xzvf ../stage2/tre-*/tre-*.tar.gz
|
||||
cd ..
|
||||
|
||||
diff -r -wibu stage1-tree stage2-tree
|
||||
|
||||
base=`basename tre-*.tar.gz .tar.gz`
|
||||
gunzip -c tre-*.tar.gz | bzip2 -9 -c > $base.tar.bz2
|
||||
bunzip2 -c < $base.tar.bz2 | tar xf -
|
||||
zip -9 -r $base.zip $base
|
||||
chmod a+r $base.tar.gz $base.tar.bz2 $base.zip
|
||||
|
||||
cd ..
|
||||
if test ! -d dist; then
|
||||
mkdir dist
|
||||
fi
|
||||
mv tmp-build/$base.tar.gz tmp-build/$base.tar.bz2 tmp-build/$base.zip dist
|
||||
ls -l dist
|
|
@ -0,0 +1,30 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# This script gets the version number from the configure.ac file and
|
||||
# fills it in to other places where the version number is needed but
|
||||
# cannot be filled in by the configure script.
|
||||
#
|
||||
|
||||
version=`grep AC_INIT configure.ac | cut -d , -f 2 | cut -d ')' -f 1`
|
||||
version=`echo $version`
|
||||
version_1=`echo $version | cut -d . -f 1`
|
||||
version_2=`echo $version | cut -d . -f 2`
|
||||
version_3=`echo $version | cut -d . -f 3`
|
||||
|
||||
for file in python/setup.py \
|
||||
win32/tre-config.h; do
|
||||
cp $file.in $file.tmp
|
||||
for replace in @TRE_VERSION@:$version \
|
||||
@TRE_VERSION_1@:$version_1 \
|
||||
@TRE_VERSION_2@:$version_2 \
|
||||
@TRE_VERSION_3@:$version_3; do
|
||||
var=`echo $replace | cut -d : -f 1`
|
||||
val=`echo $replace | cut -d : -f 2`
|
||||
echo "Replacing $var by $val to $file"
|
||||
cat $file.tmp \
|
||||
| sed "s/$var/$val/g" \
|
||||
> $file.tmp2
|
||||
mv $file.tmp2 $file.tmp
|
||||
done
|
||||
mv $file.tmp $file
|
||||
done
|
|
@ -0,0 +1,98 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\include\tre\tre-config.h" />
|
||||
<ClInclude Include="..\include\tre\tre.h" />
|
||||
<ClInclude Include="..\lib\regex.h" />
|
||||
<ClInclude Include="..\lib\tre-ast.h" />
|
||||
<ClInclude Include="..\lib\tre-compile.h" />
|
||||
<ClInclude Include="..\lib\tre-internal.h" />
|
||||
<ClInclude Include="..\lib\tre-match-utils.h" />
|
||||
<ClInclude Include="..\lib\tre-mem.h" />
|
||||
<ClInclude Include="..\lib\tre-parse.h" />
|
||||
<ClInclude Include="..\lib\tre-stack.h" />
|
||||
<ClInclude Include="..\lib\xmalloc.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\lib\regcomp.c" />
|
||||
<ClCompile Include="..\lib\regerror.c" />
|
||||
<ClCompile Include="..\lib\regexec.c" />
|
||||
<ClCompile Include="..\lib\tre-ast.c" />
|
||||
<ClCompile Include="..\lib\tre-compile.c" />
|
||||
<ClCompile Include="..\lib\tre-match-approx.c" />
|
||||
<ClCompile Include="..\lib\tre-match-backtrack.c" />
|
||||
<ClCompile Include="..\lib\tre-match-parallel.c" />
|
||||
<ClCompile Include="..\lib\tre-mem.c" />
|
||||
<ClCompile Include="..\lib\tre-parse.c" />
|
||||
<ClCompile Include="..\lib\tre-stack.c" />
|
||||
<ClCompile Include="..\lib\xmalloc.c" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{7AC78BF5-037C-4CFA-929D-C64AED9B6597}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>pcre</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<BrowseInformation>true</BrowseInformation>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_CONFIG_H</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>../win32;../include/tre</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level4</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<StringPooling>true</StringPooling>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_CONFIG_H</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>../win32;../include/tre</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\include">
|
||||
<UniqueIdentifier>{e723f78a-61bf-410b-a5ef-be8a0869ad56}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\include\tre\tre.h">
|
||||
<Filter>Header Files\include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\include\tre\tre-config.h">
|
||||
<Filter>Header Files\include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\lib\regex.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\lib\tre-ast.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\lib\tre-compile.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\lib\tre-internal.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\lib\tre-match-utils.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\lib\tre-mem.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\lib\tre-parse.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\lib\tre-stack.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\lib\xmalloc.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\lib\regcomp.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\regerror.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\regexec.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\tre-ast.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\tre-compile.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\tre-match-approx.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\tre-match-backtrack.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\tre-match-parallel.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\tre-mem.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\tre-parse.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\tre-stack.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\lib\xmalloc.c">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,232 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="retest"
|
||||
ProjectGUID="{F9A3C846-B5B3-4A68-9F8D-A918942FFB29}"
|
||||
TargetFrameworkVersion="0"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/retest.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../lib,../win32"
|
||||
PreprocessorDefinitions="NDEBUG;WIN32;_CONSOLE;HAVE_CONFIG_H"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\Release/retest.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1035"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Release/tre.lib msvcprt.lib"
|
||||
OutputFile=".\Release/retest.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile=".\Release/retest.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Release/retest.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/retest.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../lib,../win32"
|
||||
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE;HAVE_CONFIG_H"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile=".\Debug/retest.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1035"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="Debug/tre.lib msvcprt.lib"
|
||||
OutputFile=".\Debug/retest.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/retest.pdb"
|
||||
SubSystem="1"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Debug/retest.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\tests\retest.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -0,0 +1,52 @@
|
|||
/* tre-config.h. This file defines all compile time definitions
|
||||
that are needed in `regex.h' for Win32. */
|
||||
|
||||
/* Define to 1 if you have `alloca', as a function or macro. */
|
||||
#define HAVE_ALLOCA 1
|
||||
|
||||
/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
|
||||
*/
|
||||
#define HAVE_ALLOCA_H 1
|
||||
|
||||
/* Define to 1 if you have the <libutf8.h> header file. */
|
||||
/* #undef HAVE_LIBUTF8_H */
|
||||
|
||||
/* Define to 1 if the system has the type `reg_errcode_t'. */
|
||||
/* #undef HAVE_REG_ERRCODE_T */
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#define HAVE_SYS_TYPES_H 1
|
||||
|
||||
/* Define to 1 if you have the <wchar.h> header file. */
|
||||
#define HAVE_WCHAR_H 1
|
||||
|
||||
/* Define if you want to enable approximate matching functionality. */
|
||||
#define TRE_APPROX 1
|
||||
|
||||
/* Define to enable multibyte character set support. */
|
||||
#define TRE_MULTIBYTE 1
|
||||
|
||||
/* Define to the absolute path to the system regex.h */
|
||||
/* #undef TRE_SYSTEM_REGEX_H_PATH */
|
||||
|
||||
/* Define if you want TRE to use alloca() instead of malloc() when allocating
|
||||
memory needed for regexec operations. */
|
||||
#define TRE_USE_ALLOCA 1
|
||||
|
||||
/* Define to include the system regex.h from TRE regex.h */
|
||||
/* #undef TRE_USE_SYSTEM_REGEX_H */
|
||||
|
||||
/* Define to enable wide character (wchar_t) support. */
|
||||
#define TRE_WCHAR 1
|
||||
|
||||
/* TRE version string. */
|
||||
#define TRE_VERSION "@TRE_VERSION@"
|
||||
|
||||
/* TRE version level 1. */
|
||||
#define TRE_VERSION_1 @TRE_VERSION_1@
|
||||
|
||||
/* TRE version level 2. */
|
||||
#define TRE_VERSION_2 @TRE_VERSION_2@
|
||||
|
||||
/* TRE version level 3. */
|
||||
#define TRE_VERSION_3 @TRE_VERSION_3@
|
|
@ -0,0 +1,29 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual C++ Express 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "retest", "retest.vcproj", "{F9A3C846-B5B3-4A68-9F8D-A918942FFB29}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{69258B5D-ECAE-40E4-8F64-5F063B05C998} = {69258B5D-ECAE-40E4-8F64-5F063B05C998}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tre", "tre.vcproj", "{69258B5D-ECAE-40E4-8F64-5F063B05C998}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{F9A3C846-B5B3-4A68-9F8D-A918942FFB29}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{F9A3C846-B5B3-4A68-9F8D-A918942FFB29}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{F9A3C846-B5B3-4A68-9F8D-A918942FFB29}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{F9A3C846-B5B3-4A68-9F8D-A918942FFB29}.Release|Win32.Build.0 = Release|Win32
|
||||
{69258B5D-ECAE-40E4-8F64-5F063B05C998}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{69258B5D-ECAE-40E4-8F64-5F063B05C998}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{69258B5D-ECAE-40E4-8F64-5F063B05C998}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{69258B5D-ECAE-40E4-8F64-5F063B05C998}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,516 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="tre"
|
||||
ProjectGUID="{69258B5D-ECAE-40E4-8F64-5F063B05C998}"
|
||||
TargetFrameworkVersion="0"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Debug/tre.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="../win32,../lib"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;TRE_EXPORTS;TRE_DEBUG;HAVE_CONFIG_H"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
PrecompiledHeaderFile=".\Debug/tre.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1036"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="msvcprt.lib"
|
||||
OutputFile=".\Debug/tre.dll"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
ModuleDefinitionFile=".\tre.def"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/tre.pdb"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
ImportLibrary=".\Debug/tre.lib"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Debug/tre.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="2"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
MkTypLibCompatible="true"
|
||||
SuppressStartupBanner="true"
|
||||
TargetEnvironment="1"
|
||||
TypeLibraryName=".\Release/tre.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="../win32,../lib"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TRE_EXPORTS;HAVE_CONFIG_H"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile=".\Release/tre.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1036"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="msvcrt.lib msvcprt.lib"
|
||||
OutputFile=".\Release/tre.dll"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ModuleDefinitionFile=".\tre.def"
|
||||
ProgramDatabaseFile=".\Release/tre.pdb"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
ImportLibrary=".\Release/tre.lib"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile=".\Release/tre.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\lib\regcomp.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\regerror.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\regexec.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\tre-ast.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\tre-compile.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\tre-match-approx.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\tre-match-backtrack.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\tre-match-parallel.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\tre-mem.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\tre-parse.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\tre-stack.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
>
|
||||
<File
|
||||
RelativePath="config.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\regex.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\tre-ast.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\tre-compile.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="tre-config.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\tre-internal.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\tre-match-utils.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\tre-mem.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\tre-parse.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\tre-stack.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="tre.def"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\lib\xmalloc.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
Loading…
Reference in New Issue