mirror of
https://github.com/pissnet/pissircd.git
synced 2025-08-17 23:51:53 +01:00
Updated the TRE library source code to 0.6.3
This commit is contained in:
parent
56cb95f189
commit
1ff17b798e
53 changed files with 26669 additions and 10155 deletions
Changes
extras/tre
Makefile.amMakefile.inNOTICETHANKSaclocal.m4config.h.inconfigureconfigure.ac
lib
Makefile.amMakefile.inregcomp.cregerror.cregex.hregexec.ctre-compile.ctre-config.h.intre-internal.htre-match-approx.ctre-match-backtrack.ctre-match-parallel.ctre-match-utils.htre-mem.ctre-mem.hxmalloc.cxmalloc.h
m4
po
src
tests
tre.spec.inutils
1
Changes
1
Changes
|
@ -2688,3 +2688,4 @@ seen. gmtime warning still there
|
|||
Also made tk->usermask static (USERLEN+2) instead of dynamic.
|
||||
These changes should give enough speed improvement to make the new anti-spam/anti-ads
|
||||
feature fast enough.
|
||||
- Updated the TRE library source to 0.6.3 (not yet used)
|
||||
|
|
|
@ -8,7 +8,10 @@ endif
|
|||
|
||||
SUBDIRS = lib $(agrep_dir) tests utils po m4
|
||||
|
||||
EXTRA_DIST = LICENSE \
|
||||
EXTRA_DIST = utils/config.rpath \
|
||||
LICENSE \
|
||||
doc/tre-api.html \
|
||||
doc/tre-syntax.html \
|
||||
win32/tre-config.h win32/config.h \
|
||||
win32/tre.dsw \
|
||||
win32/tre.dsp win32/tre.def \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.7.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.7.8 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
|
@ -41,6 +41,7 @@ ALLOCA = @ALLOCA@
|
|||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
@ -50,6 +51,10 @@ CCDEPMODE = @CCDEPMODE@
|
|||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
|
@ -59,6 +64,8 @@ ECHO_N = @ECHO_N@
|
|||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
@ -100,14 +107,20 @@ TRE_DEBUG_FALSE = @TRE_DEBUG_FALSE@
|
|||
TRE_DEBUG_TRUE = @TRE_DEBUG_TRUE@
|
||||
TRE_PROFILE_FALSE = @TRE_PROFILE_FALSE@
|
||||
TRE_PROFILE_TRUE = @TRE_PROFILE_TRUE@
|
||||
TRE_VERSION = @TRE_VERSION@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
|
@ -148,7 +161,10 @@ target_vendor = @target_vendor@
|
|||
|
||||
SUBDIRS = lib $(agrep_dir) tests utils po m4
|
||||
|
||||
EXTRA_DIST = LICENSE \
|
||||
EXTRA_DIST = utils/config.rpath \
|
||||
LICENSE \
|
||||
doc/tre-api.html \
|
||||
doc/tre-syntax.html \
|
||||
win32/tre-config.h win32/config.h \
|
||||
win32/tre.dsw \
|
||||
win32/tre.dsp win32/tre.def \
|
||||
|
@ -164,7 +180,7 @@ subdir = .
|
|||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/utils/mkinstalldirs
|
||||
CONFIG_HEADER = config.h $(top_builddir)/lib/tre-config.h
|
||||
CONFIG_CLEAN_FILES = tre.pc
|
||||
CONFIG_CLEAN_FILES = tre.pc tre.spec
|
||||
DIST_SOURCES =
|
||||
DATA = $(pkgconfig_DATA)
|
||||
|
||||
|
@ -174,9 +190,10 @@ RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
|
|||
all-recursive install-data-recursive install-exec-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive \
|
||||
check-recursive installcheck-recursive
|
||||
DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL \
|
||||
Makefile.am Makefile.in NEWS THANKS TODO aclocal.m4 config.h.in \
|
||||
configure configure.ac tre.pc.in
|
||||
DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/configure \
|
||||
ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL Makefile.am NEWS \
|
||||
THANKS TODO aclocal.m4 config.h.in configure configure.ac \
|
||||
tre.pc.in tre.spec.in
|
||||
DIST_SUBDIRS = lib src tests utils po m4
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
@ -217,6 +234,8 @@ distclean-hdr:
|
|||
-rm -f config.h stamp-h1
|
||||
tre.pc: $(top_builddir)/config.status tre.pc.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
tre.spec: $(top_builddir)/config.status tre.spec.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
@ -326,9 +345,15 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
|||
$(TAGS_FILES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
if (etags --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
test -f $$subdir/TAGS && \
|
||||
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
|
@ -380,7 +405,7 @@ distcleancheck_listfiles = find . -type f -print
|
|||
distdir: $(DISTFILES)
|
||||
$(am__remove_distdir)
|
||||
mkdir $(distdir)
|
||||
$(mkinstalldirs) $(distdir)/. $(distdir)/po $(distdir)/win32
|
||||
$(mkinstalldirs) $(distdir)/. $(distdir)/doc $(distdir)/po $(distdir)/utils $(distdir)/win32
|
||||
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
|
||||
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
|
||||
list='$(DISTFILES)'; for file in $$list; do \
|
||||
|
@ -472,7 +497,7 @@ distcheck: dist
|
|||
@echo "$(distdir).tar.gz is ready for distribution" | \
|
||||
sed 'h;s/./=/g;p;x;p;x'
|
||||
distuninstallcheck:
|
||||
cd $(distuninstallcheck_dir) \
|
||||
@cd $(distuninstallcheck_dir) \
|
||||
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|
||||
|| { echo "ERROR: files left after uninstall:" ; \
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
|
@ -481,11 +506,11 @@ distuninstallcheck:
|
|||
$(distuninstallcheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
distcleancheck: distclean
|
||||
if test '$(srcdir)' = . ; then \
|
||||
@if test '$(srcdir)' = . ; then \
|
||||
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
|
||||
exit 1 ; \
|
||||
fi
|
||||
test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|
||||
|| { echo "ERROR: files left in build directory after distclean:" ; \
|
||||
$(distcleancheck_listfiles) ; \
|
||||
exit 1; } >&2
|
||||
|
@ -515,7 +540,7 @@ mostlyclean-generic:
|
|||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
|
@ -526,6 +551,7 @@ clean-am: clean-generic clean-libtool mostlyclean-am
|
|||
|
||||
distclean: distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-tags
|
||||
|
||||
|
@ -549,7 +575,8 @@ installcheck-am:
|
|||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf autom4te.cache
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
|
2
extras/tre/NOTICE
Normal file
2
extras/tre/NOTICE
Normal file
|
@ -0,0 +1,2 @@
|
|||
Some files have been removed from the TRE library (ChangeLog, etc.) to conserve space. If
|
||||
you would like to obtain the complete TRE library visit http://www.laurikari.net/tre/
|
|
@ -2,9 +2,10 @@
|
|||
Acknowledgements
|
||||
|
||||
|
||||
Thanks for suggestions, interesting discussions, spotting bugs, and
|
||||
patches:
|
||||
Thanks for suggestions, interesting discussions, spotting bugs,
|
||||
patches, and contributions (in alphabetical order):
|
||||
|
||||
Matthew Berg <galt@gothpoodle.com>
|
||||
Angelo Borsotti <angelo.borsotti@alcatel.it>
|
||||
Glenn Fowler <gsf@research.att.com>
|
||||
George Harpur <gfh@neurascript.com>
|
||||
|
@ -12,4 +13,5 @@ Rune Kleveland <runekl@opoint.com>
|
|||
Rici Lake <RLake@oxfam.org.uk>
|
||||
Dominick Meglio <codemstr@ptd.net>
|
||||
Aymeric Moizard <jack@atosc.org>
|
||||
Santiago Vila
|
||||
Bill Yerazunis <wsy@merl.com>
|
||||
|
|
7749
extras/tre/aclocal.m4
vendored
7749
extras/tre/aclocal.m4
vendored
File diff suppressed because it is too large
Load diff
|
@ -179,9 +179,25 @@
|
|||
/* 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. */
|
||||
#undef TRE_USE_ALLOCA
|
||||
|
||||
/* Define to include the system regex.h from TRE regex.h */
|
||||
#undef TRE_USE_SYSTEM_REGEX_H
|
||||
|
||||
/* TRE version string. */
|
||||
#undef TRE_VERSION
|
||||
|
||||
/* TRE version level 1. */
|
||||
#undef TRE_VERSION_1
|
||||
|
||||
/* TRE version level 2. */
|
||||
#undef TRE_VERSION_2
|
||||
|
||||
/* TRE version level 3. */
|
||||
#undef TRE_VERSION_3
|
||||
|
||||
/* Define to enable wide character (wchar_t) support. */
|
||||
#undef TRE_WCHAR
|
||||
|
||||
|
|
15219
extras/tre/configure
vendored
15219
extras/tre/configure
vendored
File diff suppressed because it is too large
Load diff
|
@ -1,17 +1,26 @@
|
|||
dnl Process this file with autoconf to produce a configure script.
|
||||
AC_INIT(TRE, 0.5.3, [Ville Laurikari <vl@iki.fi>])
|
||||
AC_INIT(TRE, 0.6.3, [Ville Laurikari <vl@iki.fi>])
|
||||
AC_CONFIG_SRCDIR([lib/regcomp.c])
|
||||
AC_CONFIG_AUX_DIR(utils)
|
||||
AC_CANONICAL_TARGET([])
|
||||
AC_CANONICAL_TARGET
|
||||
AM_INIT_AUTOMAKE
|
||||
AC_PREREQ(2.57)
|
||||
|
||||
dnl Checks for programs.
|
||||
CFLAGS="-g"
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
AC_PROG_INSTALL
|
||||
|
||||
tre_version_1=0
|
||||
tre_version_2=6
|
||||
tre_version_3=3
|
||||
tre_version=$tre_version_1.$tre_version_2.$tre_version_3
|
||||
AC_DEFINE_UNQUOTED(TRE_VERSION, "$tre_version", [ TRE version string. ])
|
||||
AC_DEFINE_UNQUOTED(TRE_VERSION_1, $tre_version_1, [ TRE version level 1. ])
|
||||
AC_DEFINE_UNQUOTED(TRE_VERSION_2, $tre_version_2, [ TRE version level 2. ])
|
||||
AC_DEFINE_UNQUOTED(TRE_VERSION_3, $tre_version_3, [ TRE version level 3. ])
|
||||
AC_SUBST(TRE_VERSION, $tre_version)
|
||||
|
||||
dnl Options
|
||||
AC_ARG_ENABLE(profile,
|
||||
AC_HELP_STRING([--enable-profile],
|
||||
|
@ -34,11 +43,11 @@ AC_ARG_ENABLE(debug,
|
|||
if test "$tre_debug" = "yes"; then
|
||||
AM_CONDITIONAL(TRE_DEBUG, true)
|
||||
AC_DEFINE(TRE_DEBUG, 1,
|
||||
[Define if you want TRE to print debug messages to stdout.])
|
||||
[ Define if you want TRE to print debug messages to stdout. ])
|
||||
else
|
||||
AM_CONDITIONAL(TRE_DEBUG, false)
|
||||
TRE_PROG_CC_OPTIMIZATIONS
|
||||
AC_DEFINE(NDEBUG, 1, [Define if you want to disable debug assertions.])
|
||||
AC_DEFINE(NDEBUG, 1, [ Define if you want to disable debug assertions. ])
|
||||
fi
|
||||
|
||||
AC_ARG_ENABLE(warnings,
|
||||
|
@ -59,7 +68,7 @@ AC_ARG_ENABLE(approx,
|
|||
[ tre_approx="yes" ])
|
||||
if test "$tre_approx" = "yes"; then
|
||||
AC_DEFINE(TRE_APPROX, 1,
|
||||
[Define if you want to enable approximate matching functionality.])
|
||||
[ Define if you want to enable approximate matching functionality. ])
|
||||
AM_CONDITIONAL(TRE_APPROX, true)
|
||||
else
|
||||
AM_CONDITIONAL(TRE_APPROX, false)
|
||||
|
@ -83,7 +92,23 @@ AC_C_INLINE
|
|||
|
||||
dnl Checks for headers, functions, types, and macros
|
||||
AC_HEADER_STDC
|
||||
AC_FUNC_ALLOCA
|
||||
|
||||
AC_ARG_WITH(alloca,
|
||||
AC_HELP_STRING(
|
||||
[--without-alloca],
|
||||
[don't use alloca @<:@default=use@:>@]),
|
||||
[ tre_use_alloca="$withval" ],
|
||||
[ tre_use_alloca="yes" ])
|
||||
if test "$tre_use_alloca" = "yes"; then
|
||||
ALLOCA=""
|
||||
AC_FUNC_ALLOCA
|
||||
if test -z "$ALLOCA"; then
|
||||
# alloca() works.
|
||||
AC_DEFINE(TRE_USE_ALLOCA, 1,
|
||||
[ Define if you want TRE to use alloca() instead of malloc() when
|
||||
allocating memory needed for regexec operations. ])
|
||||
fi
|
||||
fi
|
||||
AC_CHECK_HEADERS([getopt.h])
|
||||
|
||||
AC_CHECK_FUNCS([getopt_long],,
|
||||
|
@ -93,10 +118,11 @@ AC_CHECK_FUNCS([getopt_long],,
|
|||
|
||||
AC_ARG_ENABLE(system-abi,
|
||||
AC_HELP_STRING(
|
||||
[--disable-system-abi],
|
||||
[don't include system regex.h from TRE regex.h @<:@default=enabled@:>@]),
|
||||
[--enable-system-abi],
|
||||
[try to make TRE compatible with the system \
|
||||
regex ABI @<:@default=disabled@:>@]),
|
||||
[ tre_system_abi="$enableval" ],
|
||||
[ tre_system_abi="yes" ])
|
||||
[ tre_system_abi="no" ])
|
||||
|
||||
# If we are building a version compatible with the system ABI, we need to
|
||||
# find an absolute path to the system regex.h (so it can be included from
|
||||
|
@ -113,8 +139,6 @@ if test "$tre_system_abi" = "yes"; then
|
|||
#include <sys/types.h>
|
||||
#endif
|
||||
])
|
||||
else
|
||||
tre_system_abi="no (disabled with --disable-system-abi)"
|
||||
fi
|
||||
|
||||
if test "$tre_system_abi" = "yes"; then
|
||||
|
@ -158,13 +182,14 @@ if test "$tre_system_abi" = "yes"; then
|
|||
if test -z "$tre_regex_t_field"; then
|
||||
AC_MSG_RESULT(no)
|
||||
tre_system_abi="no (unknown regex_t contents, report to \
|
||||
Ville Laurikari <vl@iki.fi>)"
|
||||
$PACKAGE_BUGREPORT)"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if we can redefine the functions...
|
||||
if test "$tre_system_abi" = "yes"; then
|
||||
AC_DEFINE(_REGCOMP_INTERNAL, 1, [Define on IRIX])
|
||||
# IRIX has some macro magic which we need to turn off.
|
||||
AC_DEFINE(_REGCOMP_INTERNAL, 1, [ Define on IRIX ])
|
||||
AC_MSG_CHECKING([if POSIX regex functions can be redefined])
|
||||
AC_COMPILE_IFELSE(
|
||||
[ AC_LANG_PROGRAM([
|
||||
|
@ -211,12 +236,12 @@ if test "$tre_system_abi" = "yes"; then
|
|||
])
|
||||
|
||||
AC_DEFINE(TRE_USE_SYSTEM_REGEX_H, 1,
|
||||
[Define to include the system regex.h from TRE regex.h])
|
||||
[ Define to include the system regex.h from TRE regex.h ])
|
||||
AC_DEFINE_UNQUOTED(TRE_SYSTEM_REGEX_H_PATH, "$tre_system_regex_h",
|
||||
[Define to the absolute path to the system regex.h])
|
||||
[ Define to the absolute path to the system regex.h ])
|
||||
AC_DEFINE_UNQUOTED(TRE_REGEX_T_FIELD, $tre_regex_t_field,
|
||||
[Define to a field in the regex_t struct where TRE should store a pointer to
|
||||
the internal tre_tnfa_t structure])
|
||||
[ Define to a field in the regex_t struct where TRE should store a
|
||||
pointer to the internal tre_tnfa_t structure ])
|
||||
else
|
||||
AC_DEFINE(TRE_REGEX_T_FIELD, value)
|
||||
fi
|
||||
|
@ -275,7 +300,7 @@ fi
|
|||
|
||||
if test "$tre_wchar" = "yes"; then
|
||||
AC_DEFINE(TRE_WCHAR, 1,
|
||||
[Define to enable wide character (wchar_t) support.])
|
||||
[ Define to enable wide character (wchar_t) support. ])
|
||||
fi
|
||||
|
||||
dnl Check for multibyte character set support
|
||||
|
@ -319,7 +344,7 @@ fi
|
|||
|
||||
if test "$tre_multibyte" = "yes"; then
|
||||
AC_DEFINE(TRE_MULTIBYTE, 1,
|
||||
[Define to enable multibyte character set support.])
|
||||
[ Define to enable multibyte character set support. ])
|
||||
fi
|
||||
|
||||
AM_GNU_GETTEXT([external])
|
||||
|
@ -327,8 +352,8 @@ AC_PROG_LIBTOOL
|
|||
|
||||
dnl Output files
|
||||
AC_CONFIG_HEADERS([config.h lib/tre-config.h])
|
||||
AC_CONFIG_FILES([Makefile lib/Makefile src/Makefile tests/Makefile \
|
||||
po/Makefile.in m4/Makefile utils/Makefile tre.pc])
|
||||
AC_CONFIG_FILES([Makefile lib/Makefile src/Makefile tests/Makefile po/Makefile.in
|
||||
m4/Makefile utils/Makefile tre.pc tre.spec])
|
||||
AC_OUTPUT
|
||||
|
||||
|
||||
|
@ -350,14 +375,15 @@ TRE is now configured as follows:
|
|||
CPPFLAGS = $CPPFLAGS
|
||||
LD = $LD
|
||||
LDFLAGS = $LDFLAGS
|
||||
Use alloca(): $tre_use_alloca
|
||||
|
||||
* TRE options
|
||||
|
||||
Development-time debugging: $tre_debug
|
||||
System regex ABI compatibility: $tre_system_abi
|
||||
Wide character (wchar_t) support: $tre_wchar
|
||||
Multibyte character set support: $tre_multibyte
|
||||
Approximate matching support: $tre_approx
|
||||
Build and install agrep: $tre_agrep
|
||||
Development-time debugging: $tre_debug
|
||||
System regex ABI compatibility: $tre_system_abi
|
||||
Wide character (wchar_t) support: $tre_wchar
|
||||
Multibyte character set support: $tre_multibyte
|
||||
Approximate matching support: $tre_approx
|
||||
Build and install agrep: $tre_agrep
|
||||
|
||||
EOF
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
lib_LTLIBRARIES = libtre.la
|
||||
libtre_la_LDFLAGS = -version-info 3:1:0
|
||||
libtre_la_LDFLAGS = -version-info 4:3:0
|
||||
|
||||
noinst_HEADERS = \
|
||||
tre-internal.h \
|
||||
|
@ -12,6 +12,7 @@ noinst_HEADERS = \
|
|||
|
||||
libtre_la_SOURCES = \
|
||||
tre-mem.c \
|
||||
tre-compile.c \
|
||||
tre-match-parallel.c \
|
||||
tre-match-backtrack.c \
|
||||
tre-match-approx.c \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.7.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.7.8 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
|
@ -41,6 +41,7 @@ ALLOCA = @ALLOCA@
|
|||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
@ -50,6 +51,10 @@ CCDEPMODE = @CCDEPMODE@
|
|||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
|
@ -59,6 +64,8 @@ ECHO_N = @ECHO_N@
|
|||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
@ -100,14 +107,20 @@ TRE_DEBUG_FALSE = @TRE_DEBUG_FALSE@
|
|||
TRE_DEBUG_TRUE = @TRE_DEBUG_TRUE@
|
||||
TRE_PROFILE_FALSE = @TRE_PROFILE_FALSE@
|
||||
TRE_PROFILE_TRUE = @TRE_PROFILE_TRUE@
|
||||
TRE_VERSION = @TRE_VERSION@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
|
@ -144,7 +157,7 @@ target_os = @target_os@
|
|||
target_vendor = @target_vendor@
|
||||
|
||||
lib_LTLIBRARIES = libtre.la
|
||||
libtre_la_LDFLAGS = -version-info 3:1:0
|
||||
libtre_la_LDFLAGS = -version-info 4:3:0
|
||||
|
||||
noinst_HEADERS = \
|
||||
tre-internal.h \
|
||||
|
@ -156,6 +169,7 @@ noinst_HEADERS = \
|
|||
|
||||
libtre_la_SOURCES = \
|
||||
tre-mem.c \
|
||||
tre-compile.c \
|
||||
tre-match-parallel.c \
|
||||
tre-match-backtrack.c \
|
||||
tre-match-approx.c \
|
||||
|
@ -169,13 +183,14 @@ libtre_la_LIBADD = $(LTLIBINTL)
|
|||
dist_pkginclude_HEADERS = regex.h
|
||||
nodist_pkginclude_HEADERS = tre-config.h
|
||||
subdir = lib
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/utils/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h tre-config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
|
||||
libtre_la_DEPENDENCIES =
|
||||
am_libtre_la_OBJECTS = tre-mem.lo tre-match-parallel.lo \
|
||||
am_libtre_la_OBJECTS = tre-mem.lo tre-compile.lo tre-match-parallel.lo \
|
||||
tre-match-backtrack.lo tre-match-approx.lo regcomp.lo \
|
||||
regexec.lo regerror.lo
|
||||
libtre_la_OBJECTS = $(am_libtre_la_OBJECTS)
|
||||
|
@ -184,7 +199,7 @@ DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -I.
|
|||
depcomp = $(SHELL) $(top_srcdir)/utils/depcomp
|
||||
am__depfiles_maybe = depfiles
|
||||
@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/regcomp.Plo ./$(DEPDIR)/regerror.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/regexec.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/regexec.Plo ./$(DEPDIR)/tre-compile.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/tre-match-approx.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/tre-match-backtrack.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/tre-match-parallel.Plo \
|
||||
|
@ -201,7 +216,7 @@ HEADERS = $(dist_pkginclude_HEADERS) $(nodist_pkginclude_HEADERS) \
|
|||
$(noinst_HEADERS)
|
||||
|
||||
DIST_COMMON = README $(dist_pkginclude_HEADERS) $(noinst_HEADERS) \
|
||||
Makefile.am Makefile.in tre-config.h.in
|
||||
$(srcdir)/Makefile.in Makefile.am tre-config.h.in
|
||||
SOURCES = $(libtre_la_SOURCES)
|
||||
|
||||
all: tre-config.h
|
||||
|
@ -271,18 +286,16 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regcomp.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regerror.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regexec.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tre-compile.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tre-match-approx.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tre-match-backtrack.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tre-match-parallel.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tre-mem.Plo@am__quote@
|
||||
|
||||
distclean-depend:
|
||||
-rm -rf ./$(DEPDIR)
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -293,7 +306,7 @@ distclean-depend:
|
|||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -304,7 +317,7 @@ distclean-depend:
|
|||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
|
@ -449,7 +462,6 @@ all-am: Makefile $(LTLIBRARIES) $(HEADERS) tre-config.h
|
|||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(pkgincludedir) $(DESTDIR)$(pkgincludedir)
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
@ -469,7 +481,7 @@ mostlyclean-generic:
|
|||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
|
@ -480,10 +492,10 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
|
|||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
distclean-am: clean-am distclean-compile distclean-depend \
|
||||
distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-tags
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
|
@ -505,7 +517,8 @@ install-man:
|
|||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
@ -526,12 +539,11 @@ uninstall-am: uninstall-dist_pkgincludeHEADERS uninstall-info-am \
|
|||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libLTLIBRARIES clean-libtool ctags distclean \
|
||||
distclean-compile distclean-depend distclean-generic \
|
||||
distclean-hdr distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am info info-am install install-am install-data \
|
||||
install-data-am install-dist_pkgincludeHEADERS install-exec \
|
||||
install-exec-am install-info install-info-am \
|
||||
install-libLTLIBRARIES install-man \
|
||||
distclean-compile distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags distdir dvi dvi-am info \
|
||||
info-am install install-am install-data install-data-am \
|
||||
install-dist_pkgincludeHEADERS install-exec install-exec-am \
|
||||
install-info install-info-am install-libLTLIBRARIES install-man \
|
||||
install-nodist_pkgincludeHEADERS install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -38,7 +38,7 @@
|
|||
|
||||
/* Error message strings for error codes listed in `regex.h'. This list
|
||||
needs to be in sync with the codes listed there, naturally. */
|
||||
static const char *error_messages[] =
|
||||
static const char *tre_error_messages[] =
|
||||
{ gettext_noop("No error"), /* REG_OK */
|
||||
gettext_noop("No match"), /* REG_NOMATCH */
|
||||
gettext_noop("Invalid regexp"), /* REG_BADPAT */
|
||||
|
@ -56,15 +56,14 @@ static const char *error_messages[] =
|
|||
};
|
||||
|
||||
size_t
|
||||
regerror(int errcode, const regex_t *preg, char *errbuf,
|
||||
size_t errbuf_size)
|
||||
regerror(int errcode, const regex_t *preg, char *errbuf, size_t errbuf_size)
|
||||
{
|
||||
const char *err;
|
||||
size_t err_len;
|
||||
|
||||
if (errcode >= 0
|
||||
&& errcode < (sizeof(error_messages) / sizeof(*error_messages)))
|
||||
err = gettext(error_messages[errcode]);
|
||||
&& errcode < (sizeof(tre_error_messages) / sizeof(*tre_error_messages)))
|
||||
err = gettext(tre_error_messages[errcode]);
|
||||
else
|
||||
err = gettext("Unknown error");
|
||||
|
||||
|
|
|
@ -89,12 +89,23 @@ typedef enum {
|
|||
#define REG_NEWLINE (REG_ICASE << 1)
|
||||
#define REG_NOSUB (REG_NEWLINE << 1)
|
||||
|
||||
/* Extra regcomp() flags. */
|
||||
#define REG_BASIC 0
|
||||
#define REG_LITERAL (REG_NOSUB << 1)
|
||||
|
||||
/* POSIX regexec() flags. */
|
||||
#define REG_NOTBOL 1
|
||||
#define REG_NOTEOL (REG_NOTBOL << 1)
|
||||
|
||||
#endif /* !TRE_USE_SYSTEM_REGEX_H */
|
||||
|
||||
/* REG_NOSPEC and REG_LITERAL mean the same thing. */
|
||||
#if defined(REG_LITERAL)
|
||||
#define REG_NOSPEC REG_LITERAL
|
||||
#elif defined(REG_NOSPEC)
|
||||
#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
|
||||
|
@ -137,6 +148,11 @@ typedef struct {
|
|||
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. */
|
||||
|
@ -144,6 +160,9 @@ 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;
|
||||
|
||||
|
||||
|
@ -159,6 +178,9 @@ int regawexec(const regex_t *preg, const wchar_t *string,
|
|||
int 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. */
|
||||
void regaparams_default(regaparams_t *params);
|
||||
#endif /* TRE_APPROX */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#ifdef TRE_USE_ALLOCA
|
||||
/* AIX requires this to be the first thing in the file. */
|
||||
#ifndef __GNUC__
|
||||
# if HAVE_ALLOCA_H
|
||||
|
@ -36,6 +37,7 @@ char *alloca ();
|
|||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#endif /* TRE_USE_ALLOCA */
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -52,6 +54,7 @@ char *alloca ();
|
|||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif /* HAVE_MALLOC_H */
|
||||
#include <limits.h>
|
||||
|
||||
#include "regex.h"
|
||||
#include "tre-internal.h"
|
||||
|
@ -61,7 +64,7 @@ char *alloca ();
|
|||
/* Fills the POSIX.2 regmatch_t array according to the TNFA tag and match
|
||||
endpoint values. */
|
||||
void
|
||||
tre_fill_pmatch(size_t nmatch, regmatch_t pmatch[],
|
||||
tre_fill_pmatch(size_t nmatch, regmatch_t pmatch[], int cflags,
|
||||
const tre_tnfa_t *tnfa, int *tags, int match_eo)
|
||||
{
|
||||
tre_submatch_data_t *submatch_data;
|
||||
|
@ -69,7 +72,7 @@ tre_fill_pmatch(size_t nmatch, regmatch_t pmatch[],
|
|||
int *parents;
|
||||
|
||||
i = 0;
|
||||
if (match_eo >= 0 && !(tnfa->cflags & REG_NOSUB))
|
||||
if (match_eo >= 0 && !(cflags & REG_NOSUB))
|
||||
{
|
||||
/* Construct submatch offsets from the tags. */
|
||||
DPRINT(("end tag = t%d = %d\n", tnfa->end_tag, match_eo));
|
||||
|
@ -139,21 +142,37 @@ tre_match(const tre_tnfa_t *tnfa, const void *string, size_t len,
|
|||
{
|
||||
reg_errcode_t status;
|
||||
int *tags = NULL, eo;
|
||||
if (nmatch == 0)
|
||||
eflags |= REG_NOTAGS;
|
||||
if (tnfa->num_tags > 0 && !(eflags & REG_NOTAGS))
|
||||
if (tnfa->num_tags > 0 && nmatch > 0)
|
||||
{
|
||||
#ifdef TRE_USE_ALLOCA
|
||||
tags = alloca(sizeof(*tags) * tnfa->num_tags);
|
||||
#else /* !TRE_USE_ALLOCA */
|
||||
tags = xmalloc(sizeof(*tags) * tnfa->num_tags);
|
||||
#endif /* !TRE_USE_ALLOCA */
|
||||
if (tags == NULL)
|
||||
return REG_ESPACE;
|
||||
}
|
||||
if (tnfa->have_backrefs)
|
||||
status = tre_tnfa_run_backtrack(tnfa, string, len, type, tags, eflags, &eo);
|
||||
else if (tnfa->have_approx)
|
||||
{
|
||||
regamatch_t match;
|
||||
regaparams_t params;
|
||||
regaparams_default(¶ms);
|
||||
params.max_err = 0;
|
||||
params.max_cost = 0;
|
||||
status = tre_tnfa_run_approx(tnfa, string, len, type, tags,
|
||||
&match, params, eflags, &eo);
|
||||
}
|
||||
else
|
||||
status = tre_tnfa_run_parallel(tnfa, string, len, type, tags, eflags, &eo);
|
||||
|
||||
if (status == REG_OK)
|
||||
tre_fill_pmatch(nmatch, pmatch, tnfa, tags, eo);
|
||||
tre_fill_pmatch(nmatch, pmatch, tnfa->cflags, tnfa, tags, eo);
|
||||
#ifndef TRE_USE_ALLOCA
|
||||
if (tags)
|
||||
xfree(tags);
|
||||
#endif /* !TRE_USE_ALLOCA */
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -213,18 +232,29 @@ tre_match_approx(const tre_tnfa_t *tnfa, const void *string, size_t len,
|
|||
{
|
||||
reg_errcode_t status;
|
||||
int *tags = NULL, eo;
|
||||
if (match->nmatch == 0)
|
||||
eflags |= REG_NOTAGS;
|
||||
if (tnfa->num_tags > 0 && !(eflags & REG_NOTAGS))
|
||||
|
||||
/* Back references are not supported by the approximate matcher. */
|
||||
if (tnfa->have_backrefs)
|
||||
return REG_BADPAT;
|
||||
|
||||
if (tnfa->num_tags > 0 && match->nmatch > 0)
|
||||
{
|
||||
#if TRE_USE_ALLOCA
|
||||
tags = alloca(sizeof(*tags) * tnfa->num_tags);
|
||||
#else /* !TRE_USE_ALLOCA */
|
||||
tags = xmalloc(sizeof(*tags) * tnfa->num_tags);
|
||||
#endif /* !TRE_USE_ALLOCA */
|
||||
if (tags == NULL)
|
||||
return REG_ESPACE;
|
||||
}
|
||||
status = tre_tnfa_run_approx(tnfa, string, len, type, tags,
|
||||
match, params, eflags, &eo);
|
||||
if (status == REG_OK)
|
||||
tre_fill_pmatch(match->nmatch, match->pmatch, tnfa, tags, eo);
|
||||
tre_fill_pmatch(match->nmatch, match->pmatch, tnfa->cflags, tnfa, tags, eo);
|
||||
#ifndef TRE_USE_ALLOCA
|
||||
if (tags)
|
||||
xfree(tags);
|
||||
#endif /* !TRE_USE_ALLOCA */
|
||||
return status;
|
||||
}
|
||||
|
||||
|
@ -273,6 +303,20 @@ regawexec(const regex_t *preg, const wchar_t *str,
|
|||
|
||||
#endif /* TRE_WCHAR */
|
||||
|
||||
void
|
||||
regaparams_default(regaparams_t *params)
|
||||
{
|
||||
memset(params, 0, sizeof(*params));
|
||||
params->cost_ins = 1;
|
||||
params->cost_del = 1;
|
||||
params->cost_subst = 1;
|
||||
params->max_cost = INT_MAX;
|
||||
params->max_ins = INT_MAX;
|
||||
params->max_del = INT_MAX;
|
||||
params->max_subst = INT_MAX;
|
||||
params->max_err = INT_MAX;
|
||||
}
|
||||
|
||||
#endif /* TRE_APPROX */
|
||||
|
||||
/* EOF */
|
||||
|
|
4179
extras/tre/lib/tre-compile.c
Normal file
4179
extras/tre/lib/tre-compile.c
Normal file
File diff suppressed because it is too large
Load diff
|
@ -24,3 +24,15 @@
|
|||
|
||||
/* Define to enable wide character (wchar_t) support. */
|
||||
#undef TRE_WCHAR
|
||||
|
||||
/* TRE version string. */
|
||||
#undef TRE_VERSION
|
||||
|
||||
/* TRE version level 1. */
|
||||
#undef TRE_VERSION_1
|
||||
|
||||
/* TRE version level 2. */
|
||||
#undef TRE_VERSION_2
|
||||
|
||||
/* TRE version level 3. */
|
||||
#undef TRE_VERSION_3
|
||||
|
|
|
@ -86,7 +86,6 @@ tre_ctype_t tre_ctype(const char *name);
|
|||
#define tre_strlen strlen
|
||||
#endif /* !TRE_WCHAR */
|
||||
|
||||
#define REG_NOTAGS (REG_NOTEOL << 1)
|
||||
typedef enum { STR_WIDE, STR_BYTE, STR_MBS } tre_str_type_t;
|
||||
|
||||
/* Returns number of bytes to add to (char *)ptr to make it
|
||||
|
@ -101,24 +100,32 @@ typedef enum { STR_WIDE, STR_BYTE, STR_MBS } tre_str_type_t;
|
|||
#define MAX(a, b) (((a) >= (b)) ? (a) : (b))
|
||||
#define MIN(a, b) (((a) <= (b)) ? (a) : (b))
|
||||
|
||||
/* TNFA transition definition. Each transition has a range of accepted
|
||||
characters, pointer to the next state and the ID number of that state,
|
||||
a -1 -terminated array of tags, assertion bitmap, and character class
|
||||
assertions. A TNFA state is an array of transitions, the terminator is
|
||||
a transition with state == NULL: */
|
||||
/* TNFA transition type. A TNFA state is an array of transitions,
|
||||
the terminator is a transition with NULL `state'. */
|
||||
typedef struct tnfa_transition tre_tnfa_transition_t;
|
||||
|
||||
struct tnfa_transition {
|
||||
/* Range of accepted characters. */
|
||||
tre_cint_t code_min;
|
||||
tre_cint_t code_max;
|
||||
/* Pointer to the destination state. */
|
||||
tre_tnfa_transition_t *state;
|
||||
/* ID number of the destination state. */
|
||||
int state_id;
|
||||
/* -1 terminated array of tags (or NULL). */
|
||||
int *tags;
|
||||
/* Matching parameters settings (or NULL). */
|
||||
int *params;
|
||||
/* Assertion bitmap. */
|
||||
int assertions;
|
||||
/* Assertion parameters. */
|
||||
union {
|
||||
/* Character class assertion. */
|
||||
tre_ctype_t class;
|
||||
/* Back reference assertion. */
|
||||
int backref;
|
||||
} u;
|
||||
/* Negative character class assertions. */
|
||||
tre_ctype_t *neg_classes;
|
||||
};
|
||||
|
||||
|
@ -141,6 +148,25 @@ typedef enum {
|
|||
TRE_TAG_MAXIMIZE = 1
|
||||
} tre_tag_direction_t;
|
||||
|
||||
/* Parameters that can be changed dynamically while matching. */
|
||||
typedef enum {
|
||||
TRE_PARAM_COST_INS = 0,
|
||||
TRE_PARAM_COST_DEL = 1,
|
||||
TRE_PARAM_COST_SUBST = 2,
|
||||
TRE_PARAM_COST_MAX = 3,
|
||||
TRE_PARAM_MAX_INS = 4,
|
||||
TRE_PARAM_MAX_DEL = 5,
|
||||
TRE_PARAM_MAX_SUBST = 6,
|
||||
TRE_PARAM_MAX_ERR = 7,
|
||||
TRE_PARAM_DEPTH = 8,
|
||||
TRE_PARAM_LAST = 9
|
||||
} tre_param_t;
|
||||
|
||||
/* Unset matching parameter */
|
||||
#define TRE_PARAM_UNSET -1
|
||||
|
||||
/* Signifies the default matching parameter value. */
|
||||
#define TRE_PARAM_DEFAULT -2
|
||||
|
||||
/* Instructions to compute submatch register values from tag values
|
||||
after a successful match. */
|
||||
|
@ -170,17 +196,24 @@ struct tnfa {
|
|||
unsigned int num_submatches;
|
||||
tre_tag_direction_t *tag_directions;
|
||||
int *minimal_tags;
|
||||
int *marker_offs;
|
||||
int num_tags;
|
||||
int num_minimals;
|
||||
int end_tag;
|
||||
int num_states;
|
||||
int cflags;
|
||||
int have_backrefs;
|
||||
int have_approx;
|
||||
int params_depth;
|
||||
};
|
||||
|
||||
int
|
||||
tre_compile(regex_t *preg, const tre_char_t *regex, size_t n, int cflags);
|
||||
|
||||
void
|
||||
tre_fill_pmatch(size_t nmatch, regmatch_t pmatch[],
|
||||
tre_free(regex_t *preg);
|
||||
|
||||
void
|
||||
tre_fill_pmatch(size_t nmatch, regmatch_t pmatch[], int cflags,
|
||||
const tre_tnfa_t *tnfa, int *tags, int match_eo);
|
||||
|
||||
reg_errcode_t
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -46,6 +46,7 @@
|
|||
#include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#ifdef TRE_USE_ALLOCA
|
||||
/* AIX requires this to be the first thing in the file. */
|
||||
#ifndef __GNUC__
|
||||
# if HAVE_ALLOCA_H
|
||||
|
@ -60,6 +61,7 @@ char *alloca ();
|
|||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#endif /* TRE_USE_ALLOCA */
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -90,6 +92,7 @@ typedef struct {
|
|||
const wchar_t *str_wide;
|
||||
#endif /* TRE_WCHAR */
|
||||
tre_tnfa_transition_t *state;
|
||||
int state_id;
|
||||
int next_c;
|
||||
int *tags;
|
||||
#ifdef TRE_MBSTATE
|
||||
|
@ -119,21 +122,40 @@ typedef struct tre_backtrack_struct {
|
|||
#define BT_STACK_MBSTATE_OUT
|
||||
#endif /* !TRE_MBSTATE */
|
||||
|
||||
#define BT_STACK_PUSH(_pos, _str_byte, _str_wide, _state, _next_c, _tags, _mbstate) \
|
||||
|
||||
#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)
|
||||
#else /* !TRE_USE_ALLOCA */
|
||||
#define tre_bt_mem_new tre_mem_new
|
||||
#define tre_bt_mem_alloc tre_mem_alloc
|
||||
#define tre_bt_mem_destroy tre_mem_destroy
|
||||
#endif /* !TRE_USE_ALLOCA */
|
||||
|
||||
|
||||
#define BT_STACK_PUSH(_pos, _str_byte, _str_wide, _state, _state_id, _next_c, _tags, _mbstate) \
|
||||
do \
|
||||
{ \
|
||||
int i; \
|
||||
if (!stack->next) \
|
||||
{ \
|
||||
tre_backtrack_t s; \
|
||||
s = tre_mem_alloca(mem, sizeof(*s)); \
|
||||
s = tre_bt_mem_alloc(mem, sizeof(*s)); \
|
||||
if (!s) \
|
||||
return REG_ESPACE; \
|
||||
{ \
|
||||
tre_bt_mem_destroy(mem); \
|
||||
return REG_ESPACE; \
|
||||
} \
|
||||
s->prev = stack; \
|
||||
s->next = NULL; \
|
||||
s->item.tags = tre_mem_alloca(mem, sizeof(*tags) * tnfa->num_tags); \
|
||||
s->item.tags = tre_bt_mem_alloc(mem, \
|
||||
sizeof(*tags) * tnfa->num_tags); \
|
||||
if (!s->item.tags) \
|
||||
return REG_ESPACE; \
|
||||
{ \
|
||||
tre_bt_mem_destroy(mem); \
|
||||
return REG_ESPACE; \
|
||||
} \
|
||||
stack->next = s; \
|
||||
stack = s; \
|
||||
} \
|
||||
|
@ -143,6 +165,7 @@ typedef struct tre_backtrack_struct {
|
|||
stack->item.str_byte = (_str_byte); \
|
||||
BT_STACK_WIDE_IN; \
|
||||
stack->item.state = (_state); \
|
||||
stack->item.state_id = (_state_id); \
|
||||
stack->item.next_c = (_next_c); \
|
||||
for (i = 0; i < tnfa->num_tags; i++) \
|
||||
stack->item.tags[i] = (_tags)[i]; \
|
||||
|
@ -175,35 +198,68 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
|
|||
int len, tre_str_type_t type, int *match_tags,
|
||||
int eflags, int *match_end_ofs)
|
||||
{
|
||||
int pos = 0, pos_start = -1, pos_add_next = 1;
|
||||
int match_eo = -1;
|
||||
int *next_tags, *tags;
|
||||
tre_tnfa_transition_t *trans_i;
|
||||
tre_tnfa_transition_t *state;
|
||||
tre_char_t prev_c = 0, next_c_start, next_c = 0;
|
||||
/* State variables required by GET_NEXT_WCHAR. */
|
||||
tre_char_t prev_c = 0, next_c = 0;
|
||||
const char *str_byte = string;
|
||||
const char *str_byte_start;
|
||||
int cflags = tnfa->cflags;
|
||||
int reg_notbol = eflags & REG_NOTBOL;
|
||||
int reg_noteol = eflags & REG_NOTEOL;
|
||||
int reg_newline = cflags & REG_NEWLINE;
|
||||
regmatch_t *pmatch;
|
||||
tre_mem_t mem = tre_mem_newa();
|
||||
tre_backtrack_t stack;
|
||||
int pos = 0;
|
||||
#ifdef TRE_MULTIBYTE
|
||||
int pos_add_next = 1;
|
||||
#endif /* TRE_MULTIBYTE */
|
||||
#ifdef TRE_WCHAR
|
||||
const wchar_t *str_wide = string;
|
||||
const wchar_t *str_wide_start;
|
||||
#endif /* TRE_WCHAR */
|
||||
#ifdef TRE_MBSTATE
|
||||
mbstate_t mbstate;
|
||||
#endif /* TRE_MBSTATE */
|
||||
int reg_notbol = eflags & REG_NOTBOL;
|
||||
int reg_noteol = eflags & REG_NOTEOL;
|
||||
int reg_newline = tnfa->cflags & REG_NEWLINE;
|
||||
|
||||
/* These are used to remember the necessary values of the above
|
||||
variables to return to the position where the current search
|
||||
started from. */
|
||||
int next_c_start;
|
||||
const char *str_byte_start;
|
||||
int pos_start = -1;
|
||||
#ifdef TRE_WCHAR
|
||||
const wchar_t *str_wide_start;
|
||||
#endif /* TRE_WCHAR */
|
||||
#ifdef TRE_MBSTATE
|
||||
mbstate_t mbstate_start;
|
||||
#endif /* TRE_MBSTATE */
|
||||
|
||||
/* Compilation flags for this regexp. */
|
||||
int cflags = tnfa->cflags;
|
||||
|
||||
/* End offset of best match so far, or -1 if no match found yet. */
|
||||
int match_eo = -1;
|
||||
/* Tag arrays. */
|
||||
int *next_tags, *tags;
|
||||
/* Current TNFA state. */
|
||||
tre_tnfa_transition_t *state;
|
||||
int *states_seen;
|
||||
|
||||
/* Memory allocator to for allocating the backtracking stack. */
|
||||
tre_mem_t mem = tre_bt_mem_new();
|
||||
|
||||
/* The backtracking stack. */
|
||||
tre_backtrack_t stack;
|
||||
|
||||
tre_tnfa_transition_t *trans_i;
|
||||
regmatch_t *pmatch;
|
||||
|
||||
#ifdef TRE_MBSTATE
|
||||
mbstate_t mbstate, mbstate_start;
|
||||
memset(&mbstate, '\0', sizeof(mbstate));
|
||||
#endif /* TRE_MBSTATE */
|
||||
#endif /* TRE_WCHAR */
|
||||
|
||||
if (!mem)
|
||||
return REG_ESPACE;
|
||||
stack = tre_mem_alloca(mem, sizeof(*stack));
|
||||
stack = tre_bt_mem_alloc(mem, sizeof(*stack));
|
||||
if (!stack)
|
||||
return REG_ESPACE;
|
||||
{
|
||||
tre_bt_mem_destroy(mem);
|
||||
return REG_ESPACE;
|
||||
}
|
||||
stack->prev = NULL;
|
||||
stack->next = NULL;
|
||||
|
||||
|
@ -212,12 +268,15 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
|
|||
|
||||
tags = alloca(sizeof(*tags) * tnfa->num_tags);
|
||||
pmatch = alloca(sizeof(*pmatch) * tnfa->num_submatches);
|
||||
states_seen = alloca(sizeof(*states_seen) * tnfa->num_states);
|
||||
|
||||
retry:
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < tnfa->num_tags; i++)
|
||||
tags[i] = match_tags[i] = -1;
|
||||
for (i = 0; i < tnfa->num_states; i++)
|
||||
states_seen[i] = 0;
|
||||
}
|
||||
|
||||
state = NULL;
|
||||
|
@ -252,9 +311,9 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
|
|||
else
|
||||
{
|
||||
/* Backtrack to this state. */
|
||||
DPRINT(("saving state %p for backtracking\n", trans_i->state));
|
||||
BT_STACK_PUSH(pos, str_byte, str_wide, trans_i->state, next_c,
|
||||
tags, mbstate);
|
||||
DPRINT(("saving state %d for backtracking\n", trans_i->state_id));
|
||||
BT_STACK_PUSH(pos, str_byte, str_wide, trans_i->state,
|
||||
trans_i->state_id, next_c, tags, mbstate);
|
||||
{
|
||||
int *tmp = trans_i->tags;
|
||||
if (tmp)
|
||||
|
@ -279,6 +338,7 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
|
|||
while (1)
|
||||
{
|
||||
tre_tnfa_transition_t *trans_i, *next_state;
|
||||
int empty_br_match;
|
||||
|
||||
DPRINT(("start loop\n"));
|
||||
if (state == tnfa->final)
|
||||
|
@ -286,8 +346,8 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
|
|||
DPRINT((" match found, %d %d\n", match_eo, pos));
|
||||
if (match_eo < pos
|
||||
|| (match_eo == pos
|
||||
&& tag_order(tnfa->num_tags, tnfa->tag_directions,
|
||||
tags, match_tags)))
|
||||
&& tre_tag_order(tnfa->num_tags, tnfa->tag_directions,
|
||||
tags, match_tags)))
|
||||
{
|
||||
int i;
|
||||
/* This match wins the previous match. */
|
||||
|
@ -313,6 +373,7 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
|
|||
#endif /* TRE_DEBUG */
|
||||
|
||||
/* Go to the next character in the input string. */
|
||||
empty_br_match = 0;
|
||||
trans_i = state;
|
||||
if (trans_i->state && trans_i->assertions & ASSERT_BACKREF)
|
||||
{
|
||||
|
@ -322,15 +383,16 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
|
|||
int so, eo, bt = trans_i->u.backref;
|
||||
int bt_len;
|
||||
int result;
|
||||
|
||||
DPRINT((" should match back reference %d\n", bt));
|
||||
/* Get the substring we need to match against. */
|
||||
tre_fill_pmatch(bt + 1, pmatch, tnfa, tags, pos);
|
||||
/* Get the substring we need to match against. Remember to
|
||||
turn off REG_NOSUB temporarily. */
|
||||
tre_fill_pmatch(bt + 1, pmatch, tnfa->cflags & !REG_NOSUB,
|
||||
tnfa, tags, pos);
|
||||
so = pmatch[bt].rm_so;
|
||||
eo = pmatch[bt].rm_eo;
|
||||
bt_len = eo - so;
|
||||
/* XXX - implement for STR_WIDE */
|
||||
DPRINT((" substring (len %d) is [%d, %d[: '%.*s'\n",
|
||||
bt_len, so, eo, bt_len, (char*)string + so));
|
||||
|
||||
#ifdef TRE_DEBUG
|
||||
{
|
||||
int slen;
|
||||
|
@ -338,12 +400,31 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
|
|||
slen = bt_len;
|
||||
else
|
||||
slen = MIN(bt_len, len - pos);
|
||||
DPRINT((" current string is '%.*s'\n", slen, str_byte - 1));
|
||||
|
||||
if (type == STR_BYTE)
|
||||
{
|
||||
DPRINT((" substring (len %d) is [%d, %d[: '%.*s'\n",
|
||||
bt_len, so, eo, bt_len, (char*)string + so));
|
||||
DPRINT((" current string is '%.*s'\n", slen, str_byte - 1));
|
||||
}
|
||||
else if (type == STR_WIDE)
|
||||
{
|
||||
DPRINT((" substring (len %d) is [%d, %d[: '%.*ls'\n",
|
||||
bt_len, so, eo, bt_len, (wchar_t*)string + so));
|
||||
DPRINT((" current string is '%.*ls'\n", slen, str_wide - 1));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (len < 0)
|
||||
result = strncmp((char*)string + so, str_byte - 1, bt_len);
|
||||
{
|
||||
#ifdef TRE_WCHAR
|
||||
if (type == STR_WIDE)
|
||||
result = wcsncmp((wchar_t*)string + so, str_wide - 1, bt_len);
|
||||
else
|
||||
#endif /* TRE_WCHAR */
|
||||
result = strncmp((char*)string + so, str_byte - 1, bt_len);
|
||||
}
|
||||
else if (len - pos < bt_len)
|
||||
result = 1;
|
||||
else
|
||||
|
@ -353,8 +434,19 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
|
|||
string is already aligned at character boundaries. */
|
||||
if (result == 0)
|
||||
{
|
||||
/* Back reference matched. Advance in input string and resync
|
||||
`prev_c', `next_c' and pos. */
|
||||
/* Back reference matched. Check for infinite loop. */
|
||||
if (bt_len == 0)
|
||||
empty_br_match = 1;
|
||||
if (empty_br_match && states_seen[trans_i->state_id])
|
||||
{
|
||||
DPRINT((" avoid loop\n"));
|
||||
goto backtrack;
|
||||
}
|
||||
|
||||
states_seen[trans_i->state_id] = empty_br_match;
|
||||
|
||||
/* Advance in input string and resync `prev_c', `next_c'
|
||||
and pos. */
|
||||
DPRINT((" back reference matched\n"));
|
||||
str_byte += bt_len - 1;
|
||||
pos += bt_len - 1;
|
||||
|
@ -388,10 +480,10 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
|
|||
next_state = NULL;
|
||||
for (trans_i = state; trans_i->state; trans_i++)
|
||||
{
|
||||
DPRINT((" transition %d-%d (%c-%c) %d to %p\n",
|
||||
DPRINT((" transition %d-%d (%c-%c) %d to %d\n",
|
||||
trans_i->code_min, trans_i->code_max,
|
||||
trans_i->code_min, trans_i->code_max,
|
||||
trans_i->assertions, trans_i->state));
|
||||
trans_i->assertions, trans_i->state_id));
|
||||
if (trans_i->code_min <= prev_c && trans_i->code_max >= prev_c)
|
||||
{
|
||||
if (trans_i->assertions
|
||||
|
@ -407,9 +499,9 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
|
|||
&& !tre_isctype(tre_toupper((tre_cint_t)prev_c),
|
||||
trans_i->u.class)))
|
||||
|| ((trans_i->assertions & ASSERT_CHAR_CLASS_NEG)
|
||||
&& neg_char_classes_match(trans_i->neg_classes,
|
||||
(tre_cint_t)prev_c,
|
||||
cflags & REG_ICASE))))
|
||||
&& tre_neg_char_classes_match(trans_i->neg_classes,
|
||||
(tre_cint_t)prev_c,
|
||||
cflags & REG_ICASE))))
|
||||
{
|
||||
DPRINT((" assertion failed\n"));
|
||||
continue;
|
||||
|
@ -418,7 +510,7 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
|
|||
if (next_state == NULL)
|
||||
{
|
||||
/* First matching transition. */
|
||||
DPRINT((" Next state is %p\n", trans_i->state));
|
||||
DPRINT((" Next state is %d\n", trans_i->state_id));
|
||||
next_state = trans_i->state;
|
||||
next_tags = trans_i->tags;
|
||||
}
|
||||
|
@ -428,10 +520,10 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
|
|||
to take this transition instead of the first one, so we
|
||||
push this transition in the backtracking stack so we can
|
||||
jump back here if needed. */
|
||||
DPRINT((" saving state %p for backtracking\n",
|
||||
trans_i->state));
|
||||
DPRINT((" saving state %d for backtracking\n",
|
||||
trans_i->state_id));
|
||||
BT_STACK_PUSH(pos, str_byte, str_wide, trans_i->state,
|
||||
next_c, tags, mbstate);
|
||||
trans_i->state_id, next_c, tags, mbstate);
|
||||
{
|
||||
int *tmp;
|
||||
for (tmp = trans_i->tags; tmp && *tmp >= 0; tmp++)
|
||||
|
@ -462,6 +554,13 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
|
|||
if (stack->prev)
|
||||
{
|
||||
DPRINT((" backtracking\n"));
|
||||
if (stack->item.state->assertions && ASSERT_BACKREF)
|
||||
{
|
||||
DPRINT((" states_seen[%d] = 0\n",
|
||||
stack->item.state_id));
|
||||
states_seen[stack->item.state_id] = 0;
|
||||
}
|
||||
|
||||
BT_STACK_POP();
|
||||
}
|
||||
else if (match_eo < 0)
|
||||
|
@ -503,6 +602,8 @@ tre_tnfa_run_backtrack(const tre_tnfa_t *tnfa, const void *string,
|
|||
}
|
||||
}
|
||||
|
||||
tre_bt_mem_destroy(mem);
|
||||
|
||||
*match_end_ofs = match_eo;
|
||||
return match_eo >= 0 ? REG_OK : REG_NOMATCH;
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#ifdef TRE_USE_ALLOCA
|
||||
/* AIX requires this to be the first thing in the file. */
|
||||
#ifndef __GNUC__
|
||||
# if HAVE_ALLOCA_H
|
||||
|
@ -53,6 +54,7 @@ char *alloca ();
|
|||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#endif /* TRE_USE_ALLOCA */
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -90,7 +92,7 @@ typedef struct {
|
|||
|
||||
#ifdef TRE_DEBUG
|
||||
static void
|
||||
print_reach(const tre_tnfa_t *tnfa, tre_tnfa_reach_t *reach)
|
||||
tre_print_reach(const tre_tnfa_t *tnfa, tre_tnfa_reach_t *reach)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -128,7 +130,10 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len,
|
|||
tre_char_t prev_c = 0, next_c = 0;
|
||||
const char *str_byte = string;
|
||||
char *buf;
|
||||
int pos = -1, pos_add_next = 1;
|
||||
int pos = -1;
|
||||
#ifdef TRE_MULTIBYTE
|
||||
int pos_add_next = 1;
|
||||
#endif /* TRE_MULTIBYTE */
|
||||
tre_tnfa_transition_t *trans_i;
|
||||
tre_tnfa_reach_t *reach, *reach_next, *reach_i, *reach_next_i;
|
||||
tre_reach_pos_t *reach_pos;
|
||||
|
@ -152,7 +157,7 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len,
|
|||
|
||||
DPRINT(("tre_tnfa_run_parallel, input type %d\n", type));
|
||||
|
||||
if (eflags & REG_NOTAGS)
|
||||
if (!match_tags)
|
||||
num_tags = 0;
|
||||
else
|
||||
num_tags = tnfa->num_tags;
|
||||
|
@ -173,7 +178,11 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len,
|
|||
+ (rbytes + xbytes * tnfa->num_states) * 2 + tbytes + pbytes;
|
||||
|
||||
/* Allocate the memory. */
|
||||
#ifdef TRE_USE_ALLOCA
|
||||
buf = alloca(total_bytes);
|
||||
#else /* !TRE_USE_ALLOCA */
|
||||
buf = xmalloc(total_bytes);
|
||||
#endif /* !TRE_USE_ALLOCA */
|
||||
if (buf == NULL)
|
||||
return REG_ESPACE;
|
||||
memset(buf, 0, total_bytes);
|
||||
|
@ -217,7 +226,13 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len,
|
|||
/* XXX - use memchr(), wcschr() and wmemchr() as well! */
|
||||
str_byte = strchr(orig_str, first);
|
||||
if (str_byte == NULL)
|
||||
return REG_NOMATCH;
|
||||
{
|
||||
#ifndef TRE_USE_ALLOCA
|
||||
if (buf)
|
||||
xfree(buf);
|
||||
#endif /* !TRE_USE_ALLOCA */
|
||||
return REG_NOMATCH;
|
||||
}
|
||||
prev_c = *(str_byte - 2);
|
||||
next_c = *(str_byte - 1);
|
||||
pos += str_byte - orig_str;
|
||||
|
@ -289,7 +304,8 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len,
|
|||
if (tag_i)
|
||||
while (*tag_i >= 0)
|
||||
{
|
||||
reach_next_i->tags[*tag_i] = pos;
|
||||
if (*tag_i < num_tags)
|
||||
reach_next_i->tags[*tag_i] = pos;
|
||||
tag_i++;
|
||||
}
|
||||
if (reach_next_i->state == tnfa->final)
|
||||
|
@ -320,7 +336,7 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len,
|
|||
|
||||
#ifdef TRE_DEBUG
|
||||
DPRINT(("%3d:%2lc/%05d |", pos - 1, (tre_cint_t)prev_c, (int)prev_c));
|
||||
print_reach(tnfa, reach_next);
|
||||
tre_print_reach(tnfa, reach_next);
|
||||
#endif /* TRE_DEBUG */
|
||||
|
||||
/* Check for end of string. */
|
||||
|
@ -391,12 +407,10 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len,
|
|||
/* For each state in `reach' see if there is a transition leaving with
|
||||
the current input symbol to a state not yet in `reach_next', and
|
||||
add the destination states to `reach_next'. */
|
||||
reach_i = reach;
|
||||
reach_next_i = reach_next;
|
||||
while (reach_i->state != NULL)
|
||||
for (reach_i = reach; reach_i->state; reach_i++)
|
||||
{
|
||||
trans_i = reach_i->state;
|
||||
while (trans_i->state != NULL)
|
||||
for (trans_i = reach_i->state; trans_i->state; trans_i++)
|
||||
{
|
||||
/* Does this transition match the input symbol? */
|
||||
if (trans_i->code_min <= prev_c &&
|
||||
|
@ -415,12 +429,11 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len,
|
|||
&& !tre_isctype(tre_toupper((tre_cint_t)prev_c),
|
||||
trans_i->u.class)))
|
||||
|| ((trans_i->assertions & ASSERT_CHAR_CLASS_NEG)
|
||||
&& neg_char_classes_match(trans_i->neg_classes,
|
||||
(tre_cint_t)prev_c,
|
||||
cflags & REG_ICASE))))
|
||||
&& tre_neg_char_classes_match(trans_i->neg_classes,
|
||||
(tre_cint_t)prev_c,
|
||||
cflags & REG_ICASE))))
|
||||
{
|
||||
DPRINT(("assertion failed\n"));
|
||||
trans_i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -431,7 +444,8 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len,
|
|||
if (tag_i != NULL)
|
||||
while (*tag_i >= 0)
|
||||
{
|
||||
tmp_tags[*tag_i] = pos;
|
||||
if (*tag_i < num_tags)
|
||||
tmp_tags[*tag_i] = pos;
|
||||
tag_i++;
|
||||
}
|
||||
|
||||
|
@ -465,8 +479,9 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len,
|
|||
/* Another path has also reached this state. We choose
|
||||
the winner by examining the tag values for both
|
||||
paths. */
|
||||
if (tag_order(num_tags, tnfa->tag_directions, tmp_tags,
|
||||
*reach_pos[trans_i->state_id].tags))
|
||||
if (tre_tag_order(num_tags, tnfa->tag_directions,
|
||||
tmp_tags,
|
||||
*reach_pos[trans_i->state_id].tags))
|
||||
{
|
||||
/* The new path wins. */
|
||||
tmp_iptr = *reach_pos[trans_i->state_id].tags;
|
||||
|
@ -483,15 +498,18 @@ tre_tnfa_run_parallel(const tre_tnfa_t *tnfa, const void *string, int len,
|
|||
}
|
||||
}
|
||||
}
|
||||
trans_i++;
|
||||
}
|
||||
reach_i++;
|
||||
}
|
||||
reach_next_i->state = NULL;
|
||||
}
|
||||
|
||||
DPRINT(("match end offset = %d\n", match_eo));
|
||||
|
||||
#ifndef TRE_USE_ALLOCA
|
||||
if (buf)
|
||||
xfree(buf);
|
||||
#endif /* !TRE_USE_ALLOCA */
|
||||
|
||||
*match_end_ofs = match_eo;
|
||||
return match_eo >= 0 ? REG_OK : REG_NOMATCH;
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
else \
|
||||
{ \
|
||||
w = tre_mbrtowc(&next_c, str_byte, max, &mbstate); \
|
||||
if (w < 0) \
|
||||
if (w == (size_t)-1 || w == (size_t)-2) \
|
||||
return REG_NOMATCH; \
|
||||
pos_add_next = w; \
|
||||
str_byte += w; \
|
||||
|
@ -125,19 +125,15 @@
|
|||
|
||||
/* Returns 1 if `t1' wins `t2', 0 otherwise. */
|
||||
inline static int
|
||||
tag_order(int num_tags, tre_tag_direction_t *tag_directions, int *t1, int *t2)
|
||||
tre_tag_order(int num_tags, tre_tag_direction_t *tag_directions,
|
||||
int *t1, int *t2)
|
||||
{
|
||||
int i;
|
||||
/*
|
||||
DPRINT(("tag_order\n"));
|
||||
DPRINT(("t1[0] = %d, t2[0] = %d\n", *t1, *t2));
|
||||
*/
|
||||
i = 0;
|
||||
while (i < num_tags)
|
||||
{
|
||||
if (tag_directions[i] == TRE_TAG_MINIMIZE)
|
||||
{
|
||||
DPRINT(("< t1[%d] = %d, t2[%d] = %d\n", i, t1[i], i, t2[i]));
|
||||
if (t1[i] > t2[i])
|
||||
return 0;
|
||||
if (t1[i] < t2[i])
|
||||
|
@ -145,7 +141,6 @@ tag_order(int num_tags, tre_tag_direction_t *tag_directions, int *t1, int *t2)
|
|||
}
|
||||
else
|
||||
{
|
||||
DPRINT(("> t1[%d] = %d, t2[%d] = %d\n", i, t1[i], i, t2[i]));
|
||||
if (t1[i] > t2[i])
|
||||
return 1;
|
||||
if (t1[i] < t2[i])
|
||||
|
@ -158,7 +153,7 @@ tag_order(int num_tags, tre_tag_direction_t *tag_directions, int *t1, int *t2)
|
|||
}
|
||||
|
||||
inline static int
|
||||
neg_char_classes_match(tre_ctype_t *classes, tre_cint_t wc, int icase)
|
||||
tre_neg_char_classes_match(tre_ctype_t *classes, tre_cint_t wc, int icase)
|
||||
{
|
||||
DPRINT(("neg_char_classes_test: %p, %d, %d\n", classes, wc, icase));
|
||||
while (*classes != (tre_ctype_t)0)
|
||||
|
|
|
@ -76,7 +76,7 @@ tre_mem_destroy(tre_mem_t mem)
|
|||
allocated block or NULL if an underlying malloc() failed. */
|
||||
void *
|
||||
tre_mem_alloc_impl(tre_mem_t mem, int provided, void *provided_block,
|
||||
size_t size)
|
||||
int zero, size_t size)
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
|
@ -149,16 +149,19 @@ tre_mem_alloc_impl(tre_mem_t mem, int provided, void *provided_block,
|
|||
mem->n = block_size;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Make sure the next pointer will be aligned. */
|
||||
size += ALIGN(mem->ptr + size, long);
|
||||
}
|
||||
|
||||
/* Make sure the next pointer will be aligned. */
|
||||
size += ALIGN(mem->ptr + size, long);
|
||||
|
||||
/* Allocate from current block. */
|
||||
ptr = mem->ptr;
|
||||
mem->ptr += size;
|
||||
mem->n -= size;
|
||||
|
||||
/* Set to zero if needed. */
|
||||
if (zero)
|
||||
memset(ptr, 0, size);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,23 +42,33 @@ typedef struct tre_mem_struct {
|
|||
|
||||
tre_mem_t tre_mem_new_impl(int provided, void *provided_block);
|
||||
void *tre_mem_alloc_impl(tre_mem_t mem, int provided, void *provided_block,
|
||||
size_t size);
|
||||
int zero, size_t size);
|
||||
|
||||
/* Returns a new memory allocator or NULL if out of memory. */
|
||||
#define tre_mem_new() tre_mem_new_impl(0, NULL)
|
||||
#define tre_mem_newa() \
|
||||
tre_mem_new_impl(1, alloca(sizeof(struct tre_mem_struct)))
|
||||
|
||||
/* Allocates a block of `size' bytes from `mem'. Returns a pointer to the
|
||||
allocated block or NULL if an underlying malloc() failed. */
|
||||
#define tre_mem_alloc(mem, size) tre_mem_alloc_impl(mem, 0, NULL, size)
|
||||
#define tre_mem_alloc(mem, size) tre_mem_alloc_impl(mem, 0, NULL, 0, size)
|
||||
|
||||
/* Allocates a block of `size' bytes from `mem'. Returns a pointer to the
|
||||
allocated block or NULL if an underlying malloc() failed. The memory
|
||||
is set to zero. */
|
||||
#define tre_mem_calloc(mem, size) tre_mem_alloc_impl(mem, 0, NULL, 1, size)
|
||||
|
||||
#ifdef TRE_USE_ALLOCA
|
||||
/* alloca() versions. Like above, but memory is allocated with alloca()
|
||||
instead of malloc(). */
|
||||
|
||||
#define tre_mem_newa() \
|
||||
tre_mem_new_impl(1, alloca(sizeof(struct tre_mem_struct)))
|
||||
|
||||
/* Like tre_mem_alloc but memory is allocated with alloca() instead of
|
||||
malloc(). */
|
||||
#define tre_mem_alloca(mem, size) \
|
||||
((mem)->n >= (size) \
|
||||
? tre_mem_alloc_impl((mem), 1, NULL, (size)) \
|
||||
: tre_mem_alloc_impl((mem), 1, alloca(TRE_MEM_BLOCK_SIZE), (size)))
|
||||
? tre_mem_alloc_impl((mem), 1, NULL, 0, (size)) \
|
||||
: tre_mem_alloc_impl((mem), 1, alloca(TRE_MEM_BLOCK_SIZE), 0, (size)))
|
||||
#endif /* TRE_USE_ALLOCA */
|
||||
|
||||
|
||||
/* Frees the memory allocator and all memory allocated with it. */
|
||||
void tre_mem_destroy(tre_mem_t mem);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
xmalloc.c - Simple malloc debugger library implementation
|
||||
|
||||
Copyright (C) 2001, 2002 Ville Laurikari <vl@iki.fi>.
|
||||
Copyright (C) 2001-2003 Ville Laurikari <vl@iki.fi>.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2 (June
|
||||
|
@ -21,6 +21,7 @@
|
|||
/*
|
||||
TODO:
|
||||
- red zones
|
||||
- group dumps by source location
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -60,7 +61,7 @@ static int xmalloc_fail_after;
|
|||
#define TABLE_SIZE (1 << TABLE_BITS)
|
||||
|
||||
static hashTable *
|
||||
hash_table_new()
|
||||
hash_table_new(void)
|
||||
{
|
||||
hashTable *tbl;
|
||||
|
||||
|
@ -177,7 +178,7 @@ hash_table_del(hashTable *tbl, void *ptr)
|
|||
static hashTable *xmalloc_table = NULL;
|
||||
|
||||
static void
|
||||
xmalloc_init()
|
||||
xmalloc_init(void)
|
||||
{
|
||||
if (xmalloc_table == NULL)
|
||||
{
|
||||
|
@ -205,8 +206,8 @@ xmalloc_configure(int fail_after)
|
|||
xmalloc_fail_after = fail_after;
|
||||
}
|
||||
|
||||
void
|
||||
xmalloc_dump_leaks()
|
||||
int
|
||||
xmalloc_dump_leaks(void)
|
||||
{
|
||||
int i;
|
||||
int num_leaks = 0;
|
||||
|
@ -242,6 +243,8 @@ xmalloc_dump_leaks()
|
|||
else
|
||||
printf("N/A");
|
||||
printf(" bytes per block).\n");
|
||||
|
||||
return num_leaks;
|
||||
}
|
||||
|
||||
void *
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
xmalloc.h - Simple malloc debugger library API
|
||||
|
||||
Copyright (C) 2001, 2002 Ville Laurikari <vl@iki.fi>.
|
||||
Copyright (C) 2001-2003 Ville Laurikari <vl@iki.fi>.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2 (June
|
||||
|
@ -58,7 +58,7 @@ void *xcalloc_impl(size_t nmemb, size_t size, const char *file, int line,
|
|||
void xfree_impl(void *ptr, const char *file, int line, const char *func);
|
||||
void *xrealloc_impl(void *ptr, size_t new_size, const char *file, int line,
|
||||
const char *func);
|
||||
void xmalloc_dump_leaks();
|
||||
int xmalloc_dump_leaks(void);
|
||||
void xmalloc_configure(int fail_after);
|
||||
|
||||
#undef malloc
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.7.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.7.8 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
|
@ -41,6 +41,7 @@ ALLOCA = @ALLOCA@
|
|||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
@ -50,6 +51,10 @@ CCDEPMODE = @CCDEPMODE@
|
|||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
|
@ -59,6 +64,8 @@ ECHO_N = @ECHO_N@
|
|||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
@ -100,14 +107,20 @@ TRE_DEBUG_FALSE = @TRE_DEBUG_FALSE@
|
|||
TRE_DEBUG_TRUE = @TRE_DEBUG_TRUE@
|
||||
TRE_PROFILE_FALSE = @TRE_PROFILE_FALSE@
|
||||
TRE_PROFILE_TRUE = @TRE_PROFILE_TRUE@
|
||||
TRE_VERSION = @TRE_VERSION@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
|
@ -149,12 +162,13 @@ EXTRA_DIST = \
|
|||
vl_prog_cc_warnings.m4
|
||||
|
||||
subdir = m4
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/utils/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h \
|
||||
$(top_builddir)/lib/tre-config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_SOURCES =
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
@ -216,7 +230,6 @@ check: check-am
|
|||
all-am: Makefile
|
||||
|
||||
installdirs:
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
@ -236,7 +249,7 @@ mostlyclean-generic:
|
|||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
|
@ -246,7 +259,7 @@ clean: clean-am
|
|||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-libtool
|
||||
|
||||
dvi: dvi-am
|
||||
|
@ -268,7 +281,7 @@ install-man:
|
|||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
|
|
@ -3,27 +3,28 @@ dnl
|
|||
dnl Sets C compiler optimizations which have been found to give
|
||||
dnl best results for TRE with this compiler and architecture.
|
||||
dnl
|
||||
dnl @version 1.2
|
||||
dnl @version 1.3
|
||||
dnl @author Ville Laurikari <vl@iki.fi>
|
||||
dnl
|
||||
AC_DEFUN([TRE_PROG_CC_OPTIMIZATIONS], [
|
||||
# Don't override if CFLAGS was already set.
|
||||
if test -z "$ac_env_CFLAGS_set"; then
|
||||
AC_MSG_CHECKING([for the best optimization flags])
|
||||
tre_cflags=""
|
||||
if test "$GCC" = "yes"; then
|
||||
# -pg and -fomit-frame-pointer are incompatible
|
||||
if echo $CFLAGS | grep -e -pg > /dev/null 2>&1; then
|
||||
tre_opt_omit_fp=""
|
||||
else
|
||||
tre_opt_omit_fp="-fomit-frame-pointer"
|
||||
fi
|
||||
# The default CFLAGS is `-g -O2' (`-O2' on systems where gcc does
|
||||
# not accept `-g').
|
||||
case "$target" in
|
||||
i686-*-*-* )
|
||||
OPT_CFLAGS="-O1 $tre_opt_omit_fp"
|
||||
tre_cflags="-O1 -fomit-frame-pointer"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
AC_MSG_RESULT($OPT_CFLAGS)
|
||||
CFLAGS="$CFLAGS $OPT_CFLAGS"
|
||||
if test -n "$tre_cflags"; then
|
||||
AC_MSG_RESULT([$tre_cflags])
|
||||
CFLAGS="$tre_cflags"
|
||||
else
|
||||
AC_MSG_RESULT(unknown)
|
||||
fi
|
||||
fi
|
||||
])dnl
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# Makefile for PO directory in any package using GNU gettext.
|
||||
# Copyright (C) 1995-1997, 2000-2002 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
||||
# Copyright (C) 1995-1997, 2000-2003 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
|
||||
#
|
||||
# This file can be copied and used freely without restrictions. It can
|
||||
# be used in projects which are not available under the GNU General Public
|
||||
|
@ -27,7 +27,7 @@ gettextsrcdir = $(datadir)/gettext/po
|
|||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
MKINSTALLDIRS = @MKINSTALLDIRS@
|
||||
mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac`
|
||||
mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
|
||||
|
||||
GMSGFMT = @GMSGFMT@
|
||||
MSGFMT = @MSGFMT@
|
||||
|
@ -42,9 +42,9 @@ POFILES = @POFILES@
|
|||
GMOFILES = @GMOFILES@
|
||||
UPDATEPOFILES = @UPDATEPOFILES@
|
||||
DUMMYPOFILES = @DUMMYPOFILES@
|
||||
DISTFILES.common = Makefile.in.in Makevars remove-potcdate.sin \
|
||||
DISTFILES.common = Makefile.in.in remove-potcdate.sin \
|
||||
$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
|
||||
DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot \
|
||||
DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \
|
||||
$(POFILES) $(GMOFILES) \
|
||||
$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
|
||||
|
||||
|
@ -74,18 +74,35 @@ CATALOGS = @CATALOGS@
|
|||
|
||||
all: all-@USE_NLS@
|
||||
|
||||
all-yes: $(CATALOGS)
|
||||
all-yes: stamp-po
|
||||
all-no:
|
||||
|
||||
# stamp-po is a timestamp denoting the last time at which the CATALOGS have
|
||||
# been loosely updated. Its purpose is that when a developer or translator
|
||||
# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
|
||||
# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
|
||||
# invocations of "make" will do nothing. This timestamp would not be necessary
|
||||
# if updating the $(CATALOGS) would always touch them; however, the rule for
|
||||
# $(POFILES) has been designed to not touch files that don't need to be
|
||||
# changed.
|
||||
stamp-po: $(srcdir)/$(DOMAIN).pot
|
||||
test -z "$(CATALOGS)" || $(MAKE) $(CATALOGS)
|
||||
@echo "touch stamp-po"
|
||||
@echo timestamp > stamp-poT
|
||||
@mv stamp-poT stamp-po
|
||||
|
||||
# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
|
||||
# otherwise packages like GCC can not be built if only parts of the source
|
||||
# have been downloaded.
|
||||
|
||||
# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
|
||||
# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
|
||||
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
|
||||
$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
|
||||
--add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
|
||||
--files-from=$(srcdir)/POTFILES.in \
|
||||
--copyright-holder='$(COPYRIGHT_HOLDER)'
|
||||
--copyright-holder='$(COPYRIGHT_HOLDER)' \
|
||||
--msgid-bugs-address='$(MSGID_BUGS_ADDRESS)'
|
||||
test ! -f $(DOMAIN).po || { \
|
||||
if test -f $(srcdir)/$(DOMAIN).pot; then \
|
||||
sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
|
||||
|
@ -101,9 +118,14 @@ $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
|
|||
fi; \
|
||||
}
|
||||
|
||||
# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
|
||||
# every "make" invocation, only create it when it is missing.
|
||||
# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
|
||||
$(srcdir)/$(DOMAIN).pot:
|
||||
$(MAKE) $(DOMAIN).pot-update
|
||||
|
||||
# This target rebuilds a PO file if $(DOMAIN).pot has changed.
|
||||
# Note that a PO file is not touched if it doesn't need to be changed.
|
||||
$(POFILES): $(srcdir)/$(DOMAIN).pot
|
||||
@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
|
||||
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
|
||||
|
@ -114,12 +136,15 @@ $(POFILES): $(srcdir)/$(DOMAIN).pot
|
|||
install: install-exec install-data
|
||||
install-exec:
|
||||
install-data: install-data-@USE_NLS@
|
||||
if test "$(PACKAGE)" = "gettext"; then \
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then \
|
||||
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
|
||||
for file in $(DISTFILES.common); do \
|
||||
for file in $(DISTFILES.common) Makevars.template; do \
|
||||
$(INSTALL_DATA) $(srcdir)/$$file \
|
||||
$(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||
done; \
|
||||
for file in Makevars; do \
|
||||
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||
done; \
|
||||
else \
|
||||
: ; \
|
||||
fi
|
||||
|
@ -170,7 +195,7 @@ install-strip: install
|
|||
installdirs: installdirs-exec installdirs-data
|
||||
installdirs-exec:
|
||||
installdirs-data: installdirs-data-@USE_NLS@
|
||||
if test "$(PACKAGE)" = "gettext"; then \
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then \
|
||||
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
|
||||
else \
|
||||
: ; \
|
||||
|
@ -215,8 +240,8 @@ installcheck:
|
|||
uninstall: uninstall-exec uninstall-data
|
||||
uninstall-exec:
|
||||
uninstall-data: uninstall-data-@USE_NLS@
|
||||
if test "$(PACKAGE)" = "gettext"; then \
|
||||
for file in $(DISTFILES.common); do \
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then \
|
||||
for file in $(DISTFILES.common) Makevars.template; do \
|
||||
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
|
||||
done; \
|
||||
else \
|
||||
|
@ -235,10 +260,11 @@ uninstall-data-yes:
|
|||
|
||||
check: all
|
||||
|
||||
dvi info tags TAGS ID:
|
||||
info dvi ps pdf html tags TAGS ctags CTAGS ID:
|
||||
|
||||
mostlyclean:
|
||||
rm -f remove-potcdate.sed
|
||||
rm -f stamp-poT
|
||||
rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
|
||||
rm -fr *.o
|
||||
|
||||
|
@ -250,7 +276,7 @@ distclean: clean
|
|||
maintainer-clean: distclean
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
rm -f $(GMOFILES)
|
||||
rm -f stamp-po $(GMOFILES)
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
dist distdir:
|
||||
|
@ -259,7 +285,17 @@ dist distdir:
|
|||
# This is a separate target because 'update-po' must be executed before.
|
||||
dist2: $(DISTFILES)
|
||||
dists="$(DISTFILES)"; \
|
||||
if test -f $(srcdir)/ChangeLog; then dists="$$dists ChangeLog"; fi; \
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then \
|
||||
dists="$$dists Makevars.template"; \
|
||||
fi; \
|
||||
if test -f $(srcdir)/ChangeLog; then \
|
||||
dists="$$dists ChangeLog"; \
|
||||
fi; \
|
||||
for i in 0 1 2 3 4 5 6 7 8 9; do \
|
||||
if test -f $(srcdir)/ChangeLog.$$i; then \
|
||||
dists="$$dists ChangeLog.$$i"; \
|
||||
fi; \
|
||||
done; \
|
||||
if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
|
||||
for file in $$dists; do \
|
||||
if test -f $$file; then \
|
||||
|
@ -271,14 +307,14 @@ dist2: $(DISTFILES)
|
|||
|
||||
update-po: Makefile
|
||||
$(MAKE) $(DOMAIN).pot-update
|
||||
$(MAKE) $(UPDATEPOFILES)
|
||||
test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
|
||||
$(MAKE) update-gmo
|
||||
|
||||
# General rule for updating PO files.
|
||||
|
||||
.nop.po-update:
|
||||
@lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
|
||||
if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \
|
||||
if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
|
||||
tmpdir=`pwd`; \
|
||||
echo "$$lang:"; \
|
||||
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
|
||||
|
@ -305,7 +341,7 @@ $(DUMMYPOFILES):
|
|||
update-gmo: Makefile $(GMOFILES)
|
||||
@:
|
||||
|
||||
Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
|
||||
Makefile: Makefile.in.in $(top_builddir)/config.status @POMAKEFILEDEPS@
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
|
||||
$(SHELL) ./config.status
|
||||
|
|
|
@ -18,7 +18,23 @@ XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
|
|||
# or entity, or to disclaim their copyright. The empty string stands for
|
||||
# the public domain; in this case the translators are expected to disclaim
|
||||
# their copyright.
|
||||
COPYRIGHT_HOLDER = Free Software Foundation, Inc.
|
||||
COPYRIGHT_HOLDER = Ville Laurikari
|
||||
|
||||
# This is the email address or URL to which the translators shall report
|
||||
# bugs in the untranslated strings:
|
||||
# - Strings which are not entire sentences, see the maintainer guidelines
|
||||
# in the GNU gettext documentation, section 'Preparing Strings'.
|
||||
# - Strings which use unclear terms or require additional context to be
|
||||
# understood.
|
||||
# - Strings which make invalid assumptions about notation of date, time or
|
||||
# money.
|
||||
# - Pluralisation problems.
|
||||
# - Incorrect English spelling.
|
||||
# - Incorrect formatting.
|
||||
# It can be your email address, or a mailing list address where translators
|
||||
# can write to without being subscribed, or the URL of a web page through
|
||||
# which the translators can contact you.
|
||||
MSGID_BUGS_ADDRESS = vl@iki.fi
|
||||
|
||||
# This is the list of locale categories, beyond LC_MESSAGES, for which the
|
||||
# message catalogs shall be used. It is usually empty.
|
||||
|
|
Binary file not shown.
|
@ -6,7 +6,8 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: TRE 0.4.0\n"
|
||||
"POT-Creation-Date: 2003-04-15 22:32+0300\n"
|
||||
"Report-Msgid-Bugs-To: vl@iki.fi\n"
|
||||
"POT-Creation-Date: 2003-11-04 16:21+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"
|
||||
|
@ -68,7 +69,7 @@ msgstr "Virheellinen merkkialue"
|
|||
msgid "Out of memory"
|
||||
msgstr "Muisti loppu"
|
||||
|
||||
#: lib/regerror.c:69
|
||||
#: lib/regerror.c:68
|
||||
msgid "Unknown error"
|
||||
msgstr "Tuntematon virhe"
|
||||
|
||||
|
|
1
extras/tre/po/stamp-po
Normal file
1
extras/tre/po/stamp-po
Normal file
|
@ -0,0 +1 @@
|
|||
timestamp
|
|
@ -1,5 +1,5 @@
|
|||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR Free Software Foundation, Inc.
|
||||
# Copyright (C) YEAR Ville Laurikari
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
|
@ -7,7 +7,8 @@
|
|||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"POT-Creation-Date: 2003-04-15 22:32+0300\n"
|
||||
"Report-Msgid-Bugs-To: vl@iki.fi\n"
|
||||
"POT-Creation-Date: 2003-11-04 16:21+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
|
@ -68,7 +69,7 @@ msgstr ""
|
|||
msgid "Out of memory"
|
||||
msgstr ""
|
||||
|
||||
#: lib/regerror.c:69
|
||||
#: lib/regerror.c:68
|
||||
msgid "Unknown error"
|
||||
msgstr ""
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.7.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.7.8 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
|
@ -41,6 +41,7 @@ ALLOCA = @ALLOCA@
|
|||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
@ -50,6 +51,10 @@ CCDEPMODE = @CCDEPMODE@
|
|||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
|
@ -59,6 +64,8 @@ ECHO_N = @ECHO_N@
|
|||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
@ -100,14 +107,20 @@ TRE_DEBUG_FALSE = @TRE_DEBUG_FALSE@
|
|||
TRE_DEBUG_TRUE = @TRE_DEBUG_TRUE@
|
||||
TRE_PROFILE_FALSE = @TRE_PROFILE_FALSE@
|
||||
TRE_PROFILE_TRUE = @TRE_PROFILE_TRUE@
|
||||
TRE_VERSION = @TRE_VERSION@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
|
@ -153,6 +166,7 @@ INCLUDES = -I$(top_srcdir)/lib
|
|||
@TRE_APPROX_TRUE@agrep_CFLAGS = -DLOCALEDIR=\"$(localedir)\"
|
||||
@TRE_APPROX_TRUE@@TRE_PROFILE_TRUE@agrep_LDFLAGS = -static
|
||||
subdir = src
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/utils/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h \
|
||||
$(top_builddir)/lib/tre-config.h
|
||||
|
@ -179,7 +193,7 @@ CCLD = $(CC)
|
|||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
||||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
DIST_SOURCES = $(am__agrep_SOURCES_DIST)
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
|
||||
SOURCES = $(agrep_SOURCES)
|
||||
|
||||
all: all-am
|
||||
|
@ -232,13 +246,10 @@ distclean-compile:
|
|||
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/agrep-agrep.Po@am__quote@
|
||||
|
||||
distclean-depend:
|
||||
-rm -rf ./$(DEPDIR)
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -249,7 +260,7 @@ distclean-depend:
|
|||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -260,7 +271,7 @@ distclean-depend:
|
|||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
|
@ -271,7 +282,7 @@ distclean-depend:
|
|||
agrep-agrep.o: agrep.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(agrep_CFLAGS) $(CFLAGS) -MT agrep-agrep.o -MD -MP -MF "$(DEPDIR)/agrep-agrep.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o agrep-agrep.o `test -f 'agrep.c' || echo '$(srcdir)/'`agrep.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/agrep-agrep.Tpo" "$(DEPDIR)/agrep-agrep.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/agrep-agrep.Tpo" "$(DEPDIR)/agrep-agrep.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/agrep-agrep.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='agrep.c' object='agrep-agrep.o' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -282,7 +293,7 @@ agrep-agrep.o: agrep.c
|
|||
agrep-agrep.obj: agrep.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(agrep_CFLAGS) $(CFLAGS) -MT agrep-agrep.obj -MD -MP -MF "$(DEPDIR)/agrep-agrep.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o agrep-agrep.obj `if test -f 'agrep.c'; then $(CYGPATH_W) 'agrep.c'; else $(CYGPATH_W) '$(srcdir)/agrep.c'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/agrep-agrep.Tpo" "$(DEPDIR)/agrep-agrep.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/agrep-agrep.Tpo" "$(DEPDIR)/agrep-agrep.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/agrep-agrep.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='agrep.c' object='agrep-agrep.obj' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -293,7 +304,7 @@ agrep-agrep.obj: agrep.c
|
|||
agrep-agrep.lo: agrep.c
|
||||
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(agrep_CFLAGS) $(CFLAGS) -MT agrep-agrep.lo -MD -MP -MF "$(DEPDIR)/agrep-agrep.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o agrep-agrep.lo `test -f 'agrep.c' || echo '$(srcdir)/'`agrep.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/agrep-agrep.Tpo" "$(DEPDIR)/agrep-agrep.Plo"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/agrep-agrep.Tpo" "$(DEPDIR)/agrep-agrep.Plo"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/agrep-agrep.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='agrep.c' object='agrep-agrep.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
|
@ -402,7 +413,6 @@ all-am: Makefile $(PROGRAMS)
|
|||
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
@ -422,7 +432,7 @@ mostlyclean-generic:
|
|||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
|
@ -432,9 +442,10 @@ clean: clean-am
|
|||
clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
distclean-am: clean-am distclean-compile distclean-depend \
|
||||
distclean-generic distclean-libtool distclean-tags
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
|
@ -455,7 +466,8 @@ install-man:
|
|||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
@ -475,15 +487,15 @@ uninstall-am: uninstall-binPROGRAMS uninstall-info-am
|
|||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
|
||||
clean-generic clean-libtool ctags distclean distclean-compile \
|
||||
distclean-depend distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am info info-am install \
|
||||
install-am install-binPROGRAMS install-data install-data-am \
|
||||
install-exec install-exec-am install-info install-info-am \
|
||||
install-man install-strip installcheck installcheck-am \
|
||||
installdirs maintainer-clean maintainer-clean-generic \
|
||||
mostlyclean mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
|
||||
uninstall-am uninstall-binPROGRAMS uninstall-info-am
|
||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am info info-am install install-am install-binPROGRAMS \
|
||||
install-data install-data-am install-exec install-exec-am \
|
||||
install-info install-info-am install-man install-strip \
|
||||
installcheck installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-binPROGRAMS \
|
||||
uninstall-info-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
|
|
567
extras/tre/src/agrep.c
Normal file
567
extras/tre/src/agrep.c
Normal file
|
@ -0,0 +1,567 @@
|
|||
/*
|
||||
agrep.c - Approximate grep
|
||||
|
||||
Copyright (C) 2002-2003 Ville Laurikari <vl@iki.fi>.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2 (June
|
||||
1991) as published by the Free Software Foundation.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#endif /* HAVE_GETOPT_H */
|
||||
#include <locale.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
#include <unistd.h>
|
||||
#include <limits.h>
|
||||
#include "regex.h"
|
||||
#include "gettext.h"
|
||||
#define _(String) gettext(String)
|
||||
|
||||
/* Short options. */
|
||||
static char const short_options[] =
|
||||
"cd:e:hilnsvwBD:E:HI:S:V0123456789";
|
||||
|
||||
static int show_help;
|
||||
char *program_name;
|
||||
|
||||
#ifdef HAVE_GETOPT_LONG
|
||||
/* Long option equivalences. */
|
||||
static struct option const long_options[] =
|
||||
{
|
||||
{"count", no_argument, NULL, 'c'},
|
||||
{"delimiter", no_argument, NULL, 'd'},
|
||||
{"regexp", required_argument, NULL, 'e'},
|
||||
{"no-filename", no_argument, NULL, 'h'},
|
||||
{"ignore-case", no_argument, NULL, 'i'},
|
||||
{"files-with-matches", no_argument, NULL, 'l'},
|
||||
{"line-number", no_argument, NULL, 'n'},
|
||||
{"show-cost", no_argument, NULL, 's'},
|
||||
{"invert-match", no_argument, NULL, 'v'},
|
||||
{"word-regexp", no_argument, NULL, 'w'},
|
||||
{"best-match", no_argument, NULL, 'B'},
|
||||
{"delete-cost", required_argument, NULL, 'D'},
|
||||
{"max-errors", required_argument, NULL, 'E'},
|
||||
{"insert-cost", required_argument, NULL, 'I'},
|
||||
{"substitute-cost", required_argument, NULL, 'S'},
|
||||
{"version", no_argument, NULL, 'V'},
|
||||
{"help", no_argument, &show_help, 'H'},
|
||||
{0, 0, 0, 0}
|
||||
};
|
||||
#endif /* HAVE_GETOPT_LONG */
|
||||
|
||||
static void
|
||||
usage (int status)
|
||||
{
|
||||
if (status != 0)
|
||||
{
|
||||
fprintf(stderr, _("Usage: %s [OPTION]... PATTERN [FILE]...\n"),
|
||||
program_name);
|
||||
#ifdef HAVE_GETOPT_LONG
|
||||
fprintf(stderr, _("Try `%s --help' for more information.\n"),
|
||||
program_name);
|
||||
#else /* !HAVE_GETOPT_LONG */
|
||||
fprintf(stderr, _("Try `%s -H' for more information.\n"),
|
||||
program_name);
|
||||
#endif /* !HAVE_GETOPT_LONG */
|
||||
}
|
||||
else
|
||||
{
|
||||
printf(_("Usage: %s [OPTION]... PATTERN [FILE]...\n"), program_name);
|
||||
printf(_("\
|
||||
Searches for approximate matches of PATTERN in each FILE or standard input.\n\
|
||||
Example: `%s -2 optimize foo.txt' outputs all lines in file `foo.txt' that\n\
|
||||
match \"optimize\" within two errors. E.g. lines which contain \"optimise\",\n\
|
||||
\"optmise\", and \"opitmize\" all match.\n"), program_name);
|
||||
printf("\n");
|
||||
printf(_("\
|
||||
Regexp selection and interpretation:\n\
|
||||
-e, --regexp=PATTERN use PATTERN as a regular expression\n\
|
||||
-i, --ignore-case ignore case distinctions\n\
|
||||
-w, --word-regexp force PATTERN to match only whole words\n\
|
||||
\n\
|
||||
Approximate matching settings:\n\
|
||||
-D, --delete-cost=NUM set cost of missing characters\n\
|
||||
-I, --insert-cost=NUM set cost of extra characters\n\
|
||||
-S, --substitute-cost=NUM set cost of wrong characters\n\
|
||||
-E, --max-errors=NUM select records that have at most NUM errors\n\
|
||||
-# select records that have at most # errors (# is a\n\
|
||||
digit between 0 and 9)\n\
|
||||
\n\
|
||||
Miscellaneous:\n\
|
||||
-d, --delimiter=PATTERN set the record delimiter regular expression\n\
|
||||
-v, --invert-match select non-matching records\n\
|
||||
-V, --version print version information and exit\n\
|
||||
-H, --help display this help and exit\n\
|
||||
\n\
|
||||
Output control:\n\
|
||||
-B, --best-match only output records with least errors\n\
|
||||
-c, --count only print a count of matching records per FILE\n\
|
||||
-h, --no-filename suppress the prefixing filename on output\n\
|
||||
-l, --files-with-matches only print FILE names containing matches\n\
|
||||
-n, --record-number print record number with output\n\
|
||||
-s, --show-cost print match cost with output\n"));
|
||||
printf("\n");
|
||||
printf(_("\
|
||||
With no FILE, or when FILE is -, reads standard input. If less than two\n\
|
||||
FILEs are given, -h is assumed. Exit status is 0 if a match is found, 1 for\n\
|
||||
no match, and 2 if there were errors. If -E or -# is not specified, only\n\
|
||||
exact matches are selected.\n"));
|
||||
printf("\n");
|
||||
printf(_("\
|
||||
PATTERN is a POSIX extended regular expression (ERE) with the TRE extensions.\n\
|
||||
See tre(7) for a complete description.\n"));
|
||||
printf("\n");
|
||||
printf(_("Report bugs to Ville Laurikari <vl@iki.fi>.\n"));
|
||||
}
|
||||
exit(status);
|
||||
}
|
||||
|
||||
static regex_t preg; /* Compiled pattern to search for. */
|
||||
static regex_t delim; /* Compiled record delimiter pattern. */
|
||||
|
||||
#define INITIAL_BUF_SIZE 10240 /* Initial size of the buffer. */
|
||||
static char *buf; /* Buffer for scanning text. */
|
||||
static int buf_size; /* Current size of the buffer. */
|
||||
static int data_len; /* Amount of data in the buffer. */
|
||||
static char *record; /* Start of current record. */
|
||||
static char *next_record; /* Start of next record. */
|
||||
static int record_len; /* Length of current record. */
|
||||
static int at_eof;
|
||||
|
||||
static int invert_match; /* Show only non-matching records. */
|
||||
static int print_filename; /* Output filename. */
|
||||
static int print_recnum; /* Output record number. */
|
||||
static int print_cost; /* Output match cost. */
|
||||
static int count_matches; /* Count matching records. */
|
||||
static int list_files; /* List matching files. */
|
||||
|
||||
static int best_match; /* Output only best matches. */
|
||||
static int best_cost; /* Best match cost found so far. */
|
||||
static int best_match_limit; /* Cost limit for best match. */
|
||||
|
||||
static regaparams_t match_params;
|
||||
|
||||
|
||||
/* Sets `record' to the next complete record from file `fd', and `record_len'
|
||||
to the length of the record. Returns 1 when there are no more records,
|
||||
0 otherwise. */
|
||||
static inline int
|
||||
tre_agrep_get_next_record(int fd)
|
||||
{
|
||||
int errcode;
|
||||
regmatch_t pmatch[1];
|
||||
|
||||
if (at_eof)
|
||||
return 1;
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (next_record == NULL)
|
||||
{
|
||||
int r;
|
||||
/* Fill the buffer with data from the file. */
|
||||
r = read(fd, buf + data_len, buf_size - data_len);
|
||||
/* XXX - check for failure or interruption. */
|
||||
if (r == 0)
|
||||
{
|
||||
/* End of file. Return the last record. */
|
||||
record = buf;
|
||||
record_len = data_len;
|
||||
at_eof = 1;
|
||||
/* The empty string after a trailing delimiter is not considered
|
||||
to be a record. */
|
||||
if (record_len == 0)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
data_len += r;
|
||||
next_record = buf;
|
||||
}
|
||||
|
||||
/* Find the next record delimiter. */
|
||||
errcode = regnexec(&delim, next_record, data_len - (next_record - buf),
|
||||
1, pmatch, 0);
|
||||
if (errcode == REG_ESPACE)
|
||||
{
|
||||
fprintf(stderr, "%s: %s\n", program_name, _("Out of memory"));
|
||||
exit(2);
|
||||
}
|
||||
else if (errcode == REG_NOMATCH)
|
||||
{
|
||||
/* No record delimiter found. */
|
||||
if (next_record == buf)
|
||||
{
|
||||
/* The buffer is full but we don't yet have a full record.
|
||||
Grow the buffer. */
|
||||
buf = realloc(buf, buf_size * 2);
|
||||
if (!buf)
|
||||
{
|
||||
fprintf(stderr, "%s: %s\n", program_name,
|
||||
_("Out of memory"));
|
||||
exit(2);
|
||||
}
|
||||
buf_size *= 2;
|
||||
next_record = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Move the data to start of the buffer and read more data. */
|
||||
memmove(buf, next_record, buf + data_len - next_record);
|
||||
data_len = buf + data_len - next_record;
|
||||
next_record = NULL;
|
||||
}
|
||||
}
|
||||
else if (errcode == REG_OK)
|
||||
{
|
||||
/* Record delimiter found, now we know how long the current
|
||||
record is. */
|
||||
record = next_record;
|
||||
record_len = pmatch[0].rm_so;
|
||||
next_record = next_record + pmatch[0].rm_eo;
|
||||
return 0;
|
||||
}
|
||||
else assert(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
tre_agrep_handle_file(const char *filename)
|
||||
{
|
||||
int fd;
|
||||
int count = 0;
|
||||
int recnum = 0;
|
||||
|
||||
/* Allocate the initial buffer. */
|
||||
if (buf == NULL)
|
||||
{
|
||||
buf = malloc(INITIAL_BUF_SIZE);
|
||||
if (buf == NULL)
|
||||
{
|
||||
fprintf(stderr, "%s: %s\n", program_name, _("Out of memory"));
|
||||
exit(2);
|
||||
}
|
||||
buf_size = INITIAL_BUF_SIZE;
|
||||
}
|
||||
|
||||
if (!filename || strcmp(filename, "-") == 0)
|
||||
{
|
||||
if (best_match)
|
||||
{
|
||||
fprintf(stderr, "%s: %s\n", program_name,
|
||||
_("Cannot use -B when reading from standard input."));
|
||||
return 2;
|
||||
}
|
||||
fd = 0;
|
||||
filename = _("(standard input)");
|
||||
}
|
||||
else
|
||||
{
|
||||
fd = open(filename, O_RDONLY);
|
||||
}
|
||||
|
||||
if (fd < 0)
|
||||
{
|
||||
fprintf(stderr, "%s: %s: %s\n", program_name, filename, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/* Go through all records and output the matching ones, or the non-matching
|
||||
ones if `invert_match' is true. */
|
||||
at_eof = 0;
|
||||
while (!tre_agrep_get_next_record(fd))
|
||||
{
|
||||
int errcode;
|
||||
regamatch_t match;
|
||||
recnum++;
|
||||
memset(&match, 0, sizeof(match));
|
||||
/* See if the record matches. */
|
||||
errcode = reganexec(&preg, record, record_len, &match, match_params, 0);
|
||||
if ((!invert_match && errcode == REG_OK)
|
||||
|| (invert_match && errcode != REG_OK))
|
||||
{
|
||||
count++;
|
||||
if (best_match)
|
||||
{
|
||||
if (match.cost < best_cost)
|
||||
best_cost = match.cost;
|
||||
continue;
|
||||
}
|
||||
if (list_files)
|
||||
{
|
||||
printf("%s\n", filename);
|
||||
break;
|
||||
}
|
||||
else if (!count_matches)
|
||||
{
|
||||
if (print_filename)
|
||||
printf("%s:", filename);
|
||||
if (print_recnum)
|
||||
printf("%d:", recnum);
|
||||
if (print_cost)
|
||||
printf("%d:", match.cost);
|
||||
printf("%.*s\n", record_len, record);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (count_matches && !best_match)
|
||||
{
|
||||
if (print_filename)
|
||||
printf("%s:", filename);
|
||||
printf("%d\n", count);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
int c, errcode;
|
||||
int comp_flags = REG_NOSUB | REG_EXTENDED;
|
||||
char *tmp_str;
|
||||
char *regexp = NULL;
|
||||
char *delim_regexp = "\n";
|
||||
int word_regexp = 0;
|
||||
|
||||
setlocale (LC_ALL, "");
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
/* Get the program name without the path (for error messages etc). */
|
||||
program_name = argv[0];
|
||||
if (program_name)
|
||||
{
|
||||
tmp_str = strrchr(program_name, '/');
|
||||
if (tmp_str)
|
||||
program_name = tmp_str + 1;
|
||||
}
|
||||
|
||||
/* Defaults. */
|
||||
print_filename = 1;
|
||||
print_cost = 0;
|
||||
regaparams_default(&match_params);
|
||||
match_params.max_cost = 0;
|
||||
|
||||
best_match_limit = INT_MAX;
|
||||
/* Parse command line options. */
|
||||
while (1)
|
||||
{
|
||||
#ifdef HAVE_GETOPT_LONG
|
||||
c = getopt_long(argc, argv, short_options, long_options, NULL);
|
||||
#else /* !HAVE_GETOPT_LONG */
|
||||
c = getopt(argc, argv, short_options);
|
||||
#endif /* !HAVE_GETOPT_LONG */
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case 'c':
|
||||
/* Count number of matching records. */
|
||||
count_matches = 1;
|
||||
break;
|
||||
case 'd':
|
||||
/* Set record delimiter regexp. */
|
||||
delim_regexp = optarg;
|
||||
break;
|
||||
case 'e':
|
||||
/* Regexp to use. */
|
||||
regexp = optarg;
|
||||
break;
|
||||
case 'h':
|
||||
/* Don't prefix filename on output if there are multiple files. */
|
||||
print_filename = 0;
|
||||
break;
|
||||
case 'i':
|
||||
/* Ignore case. */
|
||||
comp_flags |= REG_ICASE;
|
||||
break;
|
||||
case 'l':
|
||||
/* Only print files that contain matches. */
|
||||
list_files = 1;
|
||||
break;
|
||||
case 'n':
|
||||
/* Print record number of matching record. */
|
||||
print_recnum = 1;
|
||||
break;
|
||||
case 's':
|
||||
/* Print match cost of matching record. */
|
||||
print_cost = 1;
|
||||
break;
|
||||
case 'v':
|
||||
/* Select non-matching records. */
|
||||
invert_match = 1;
|
||||
break;
|
||||
case 'w':
|
||||
/* Match only whole words. */
|
||||
word_regexp = 1;
|
||||
break;
|
||||
case 'B':
|
||||
/* Select only the records which have the best match. */
|
||||
best_match = 1;
|
||||
best_cost = INT_MAX;
|
||||
match_params.max_cost = INT_MAX;
|
||||
break;
|
||||
case 'D':
|
||||
/* Set the cost of a deletion. */
|
||||
match_params.cost_del = atoi(optarg);
|
||||
break;
|
||||
case 'E':
|
||||
/* Set the maximum number of errors allowed for a record to match. */
|
||||
match_params.max_cost = atoi(optarg);
|
||||
best_match_limit = match_params.max_cost;
|
||||
break;
|
||||
case 'I':
|
||||
/* Set the cost of an insertion. */
|
||||
match_params.cost_ins = atoi(optarg);
|
||||
break;
|
||||
case 'S':
|
||||
/* Set the cost of a substitution. */
|
||||
match_params.cost_subst = atoi(optarg);
|
||||
break;
|
||||
case 'V':
|
||||
/* Print version string and exit. */
|
||||
printf("%s (" PACKAGE_NAME " agrep) " PACKAGE_VERSION "\n\n",
|
||||
program_name);
|
||||
printf(_("Copyright (C) 2002-2003 Ville Laurikari.\n"));
|
||||
printf(_("\
|
||||
This is free software; see the source for copying conditions. There is NO\n\
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A \
|
||||
PARTICULAR PURPOSE.\n"));
|
||||
printf("\n");
|
||||
exit(0);
|
||||
break;
|
||||
|
||||
case '?':
|
||||
/* Ambiguous match or extraneous parameter. */
|
||||
break;
|
||||
case 'H':
|
||||
show_help = 1;
|
||||
break;
|
||||
case 0:
|
||||
/* Long options without corresponding short options. */
|
||||
break;
|
||||
|
||||
default:
|
||||
if (c >= '0' && c <= '9')
|
||||
match_params.max_cost = c - '0';
|
||||
else
|
||||
usage(2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (show_help)
|
||||
usage(0);
|
||||
|
||||
/* Get the pattern. */
|
||||
if (regexp == NULL)
|
||||
{
|
||||
if (optind >= argc)
|
||||
usage(2);
|
||||
regexp = argv[optind++];
|
||||
}
|
||||
|
||||
/* If -w is specified, prepend beginning-of-word and end-of-word
|
||||
assertions to the regexp before compiling. */
|
||||
if (word_regexp)
|
||||
{
|
||||
char *tmp = regexp;
|
||||
int len = strlen(tmp);
|
||||
regexp = malloc(len + 7);
|
||||
if (regexp == NULL)
|
||||
{
|
||||
fprintf(stderr, "%s: %s\n", program_name, _("Out of memory"));
|
||||
return 2;
|
||||
}
|
||||
strcpy(regexp, "\\<(");
|
||||
strcpy(regexp + 3, tmp);
|
||||
strcpy(regexp + len + 3, ")\\>");
|
||||
}
|
||||
|
||||
/* Compile the pattern. */
|
||||
errcode = regcomp(&preg, regexp, comp_flags);
|
||||
if (errcode)
|
||||
{
|
||||
char errbuf[256];
|
||||
regerror(errcode, &preg, errbuf, sizeof(errbuf));
|
||||
fprintf(stderr, "%s: %s: %s\n",
|
||||
program_name, _("Error in search pattern"), errbuf);
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* Compile the record delimiter pattern. */
|
||||
errcode = regcomp(&delim, delim_regexp, REG_EXTENDED | REG_NEWLINE);
|
||||
if (errcode)
|
||||
{
|
||||
char errbuf[256];
|
||||
regerror(errcode, &preg, errbuf, sizeof(errbuf));
|
||||
fprintf(stderr, "%s: %s: %s\n",
|
||||
program_name, _("Error in record delimiter pattern"), errbuf);
|
||||
return 2;
|
||||
}
|
||||
|
||||
/* The rest of the arguments are file(s) to match. If there are no files
|
||||
specified, read from stdin. */
|
||||
if (argc - optind <= 1)
|
||||
print_filename = 0;
|
||||
if (optind >= argc)
|
||||
{
|
||||
/* Read from standard input. */
|
||||
tre_agrep_handle_file(NULL);
|
||||
}
|
||||
else if (best_match)
|
||||
{
|
||||
/* Best match mode: scan all files twice and print only the
|
||||
records that had a best match. */
|
||||
int first_ind = optind;
|
||||
while (optind < argc)
|
||||
tre_agrep_handle_file(argv[optind++]);
|
||||
best_match = 0;
|
||||
/* If there were no matches, bail out now. */
|
||||
if (best_cost == INT_MAX)
|
||||
return 1;
|
||||
/* Otherwise, rescan the files with max_cost set to the cost
|
||||
of the best match found previously. */
|
||||
match_params.max_cost = best_cost;
|
||||
optind = first_ind;
|
||||
while (optind < argc)
|
||||
tre_agrep_handle_file(argv[optind++]);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Normal mode. */
|
||||
while (optind < argc)
|
||||
tre_agrep_handle_file(argv[optind++]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -25,6 +25,7 @@ else !TRE_DEBUG
|
|||
noinst_LTLIBRARIES = libxtre.la
|
||||
libxtre_la_SOURCES = \
|
||||
../lib/tre-mem.c \
|
||||
../lib/tre-compile.c \
|
||||
../lib/tre-match-parallel.c \
|
||||
../lib/tre-match-backtrack.c \
|
||||
../lib/tre-match-approx.c \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.7.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.7.8 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
|
@ -41,6 +41,7 @@ ALLOCA = @ALLOCA@
|
|||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
@ -50,6 +51,10 @@ CCDEPMODE = @CCDEPMODE@
|
|||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
|
@ -59,6 +64,8 @@ ECHO_N = @ECHO_N@
|
|||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
@ -100,14 +107,20 @@ TRE_DEBUG_FALSE = @TRE_DEBUG_FALSE@
|
|||
TRE_DEBUG_TRUE = @TRE_DEBUG_TRUE@
|
||||
TRE_PROFILE_FALSE = @TRE_PROFILE_FALSE@
|
||||
TRE_PROFILE_TRUE = @TRE_PROFILE_TRUE@
|
||||
TRE_VERSION = @TRE_VERSION@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
|
@ -165,6 +178,7 @@ bench_LDFLAGS = -static
|
|||
@TRE_DEBUG_FALSE@noinst_LTLIBRARIES = libxtre.la
|
||||
@TRE_DEBUG_FALSE@libxtre_la_SOURCES = \
|
||||
@TRE_DEBUG_FALSE@ ../lib/tre-mem.c \
|
||||
@TRE_DEBUG_FALSE@ ../lib/tre-compile.c \
|
||||
@TRE_DEBUG_FALSE@ ../lib/tre-match-parallel.c \
|
||||
@TRE_DEBUG_FALSE@ ../lib/tre-match-backtrack.c \
|
||||
@TRE_DEBUG_FALSE@ ../lib/tre-match-approx.c \
|
||||
|
@ -182,6 +196,7 @@ INCLUDES = -I$(top_srcdir)/lib
|
|||
|
||||
TESTS = retest test-approx
|
||||
subdir = tests
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/utils/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h \
|
||||
$(top_builddir)/lib/tre-config.h
|
||||
|
@ -190,11 +205,12 @@ LTLIBRARIES = $(noinst_LTLIBRARIES)
|
|||
|
||||
libxtre_la_LDFLAGS =
|
||||
libxtre_la_LIBADD =
|
||||
am__libxtre_la_SOURCES_DIST = ../lib/tre-mem.c \
|
||||
am__libxtre_la_SOURCES_DIST = ../lib/tre-mem.c ../lib/tre-compile.c \
|
||||
../lib/tre-match-parallel.c ../lib/tre-match-backtrack.c \
|
||||
../lib/tre-match-approx.c ../lib/regcomp.c ../lib/regexec.c \
|
||||
../lib/regerror.c ../lib/xmalloc.c
|
||||
@TRE_DEBUG_FALSE@am_libxtre_la_OBJECTS = libxtre_la-tre-mem.lo \
|
||||
@TRE_DEBUG_FALSE@ libxtre_la-tre-compile.lo \
|
||||
@TRE_DEBUG_FALSE@ libxtre_la-tre-match-parallel.lo \
|
||||
@TRE_DEBUG_FALSE@ libxtre_la-tre-match-backtrack.lo \
|
||||
@TRE_DEBUG_FALSE@ libxtre_la-tre-match-approx.lo \
|
||||
|
@ -228,6 +244,7 @@ am__depfiles_maybe = depfiles
|
|||
@AMDEP_TRUE@ ./$(DEPDIR)/libxtre_la-regcomp.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/libxtre_la-regerror.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/libxtre_la-regexec.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/libxtre_la-tre-compile.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/libxtre_la-tre-match-approx.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/libxtre_la-tre-match-backtrack.Plo \
|
||||
@AMDEP_TRUE@ ./$(DEPDIR)/libxtre_la-tre-match-parallel.Plo \
|
||||
|
@ -245,7 +262,7 @@ LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
|
|||
$(AM_LDFLAGS) $(LDFLAGS) -o $@
|
||||
DIST_SOURCES = $(am__libxtre_la_SOURCES_DIST) $(bench_SOURCES) \
|
||||
$(randtest_SOURCES) $(retest_SOURCES) $(test_approx_SOURCES)
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
|
||||
SOURCES = $(libxtre_la_SOURCES) $(bench_SOURCES) $(randtest_SOURCES) $(retest_SOURCES) $(test_approx_SOURCES)
|
||||
|
||||
all: all-am
|
||||
|
@ -298,6 +315,7 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxtre_la-regcomp.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxtre_la-regerror.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxtre_la-regexec.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxtre_la-tre-compile.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxtre_la-tre-match-approx.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxtre_la-tre-match-backtrack.Plo@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libxtre_la-tre-match-parallel.Plo@am__quote@
|
||||
|
@ -307,13 +325,10 @@ distclean-compile:
|
|||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/retest-retest.Po@am__quote@
|
||||
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-approx.Po@am__quote@
|
||||
|
||||
distclean-depend:
|
||||
-rm -rf ./$(DEPDIR)
|
||||
|
||||
.c.o:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -324,7 +339,7 @@ distclean-depend:
|
|||
.c.obj:
|
||||
@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -335,7 +350,7 @@ distclean-depend:
|
|||
.c.lo:
|
||||
@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
|
||||
|
@ -346,7 +361,7 @@ distclean-depend:
|
|||
libxtre_la-tre-mem.o: ../lib/tre-mem.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-tre-mem.o -MD -MP -MF "$(DEPDIR)/libxtre_la-tre-mem.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-tre-mem.o `test -f '../lib/tre-mem.c' || echo '$(srcdir)/'`../lib/tre-mem.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-tre-mem.Tpo" "$(DEPDIR)/libxtre_la-tre-mem.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-tre-mem.Tpo" "$(DEPDIR)/libxtre_la-tre-mem.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-tre-mem.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/tre-mem.c' object='libxtre_la-tre-mem.o' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -357,7 +372,7 @@ libxtre_la-tre-mem.o: ../lib/tre-mem.c
|
|||
libxtre_la-tre-mem.obj: ../lib/tre-mem.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-tre-mem.obj -MD -MP -MF "$(DEPDIR)/libxtre_la-tre-mem.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-tre-mem.obj `if test -f '../lib/tre-mem.c'; then $(CYGPATH_W) '../lib/tre-mem.c'; else $(CYGPATH_W) '$(srcdir)/../lib/tre-mem.c'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-tre-mem.Tpo" "$(DEPDIR)/libxtre_la-tre-mem.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-tre-mem.Tpo" "$(DEPDIR)/libxtre_la-tre-mem.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-tre-mem.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/tre-mem.c' object='libxtre_la-tre-mem.obj' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -368,7 +383,7 @@ libxtre_la-tre-mem.obj: ../lib/tre-mem.c
|
|||
libxtre_la-tre-mem.lo: ../lib/tre-mem.c
|
||||
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-tre-mem.lo -MD -MP -MF "$(DEPDIR)/libxtre_la-tre-mem.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-tre-mem.lo `test -f '../lib/tre-mem.c' || echo '$(srcdir)/'`../lib/tre-mem.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-tre-mem.Tpo" "$(DEPDIR)/libxtre_la-tre-mem.Plo"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-tre-mem.Tpo" "$(DEPDIR)/libxtre_la-tre-mem.Plo"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-tre-mem.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/tre-mem.c' object='libxtre_la-tre-mem.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
|
@ -376,10 +391,43 @@ libxtre_la-tre-mem.lo: ../lib/tre-mem.c
|
|||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -c -o libxtre_la-tre-mem.lo `test -f '../lib/tre-mem.c' || echo '$(srcdir)/'`../lib/tre-mem.c
|
||||
|
||||
libxtre_la-tre-compile.o: ../lib/tre-compile.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-tre-compile.o -MD -MP -MF "$(DEPDIR)/libxtre_la-tre-compile.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-tre-compile.o `test -f '../lib/tre-compile.c' || echo '$(srcdir)/'`../lib/tre-compile.c; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-tre-compile.Tpo" "$(DEPDIR)/libxtre_la-tre-compile.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-tre-compile.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/tre-compile.c' object='libxtre_la-tre-compile.o' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libxtre_la-tre-compile.Po' tmpdepfile='$(DEPDIR)/libxtre_la-tre-compile.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -c -o libxtre_la-tre-compile.o `test -f '../lib/tre-compile.c' || echo '$(srcdir)/'`../lib/tre-compile.c
|
||||
|
||||
libxtre_la-tre-compile.obj: ../lib/tre-compile.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-tre-compile.obj -MD -MP -MF "$(DEPDIR)/libxtre_la-tre-compile.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-tre-compile.obj `if test -f '../lib/tre-compile.c'; then $(CYGPATH_W) '../lib/tre-compile.c'; else $(CYGPATH_W) '$(srcdir)/../lib/tre-compile.c'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-tre-compile.Tpo" "$(DEPDIR)/libxtre_la-tre-compile.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-tre-compile.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/tre-compile.c' object='libxtre_la-tre-compile.obj' libtool=no @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libxtre_la-tre-compile.Po' tmpdepfile='$(DEPDIR)/libxtre_la-tre-compile.TPo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -c -o libxtre_la-tre-compile.obj `if test -f '../lib/tre-compile.c'; then $(CYGPATH_W) '../lib/tre-compile.c'; else $(CYGPATH_W) '$(srcdir)/../lib/tre-compile.c'; fi`
|
||||
|
||||
libxtre_la-tre-compile.lo: ../lib/tre-compile.c
|
||||
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-tre-compile.lo -MD -MP -MF "$(DEPDIR)/libxtre_la-tre-compile.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-tre-compile.lo `test -f '../lib/tre-compile.c' || echo '$(srcdir)/'`../lib/tre-compile.c; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-tre-compile.Tpo" "$(DEPDIR)/libxtre_la-tre-compile.Plo"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-tre-compile.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/tre-compile.c' object='libxtre_la-tre-compile.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/libxtre_la-tre-compile.Plo' tmpdepfile='$(DEPDIR)/libxtre_la-tre-compile.TPlo' @AMDEPBACKSLASH@
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
|
||||
@am__fastdepCC_FALSE@ $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -c -o libxtre_la-tre-compile.lo `test -f '../lib/tre-compile.c' || echo '$(srcdir)/'`../lib/tre-compile.c
|
||||
|
||||
libxtre_la-tre-match-parallel.o: ../lib/tre-match-parallel.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-tre-match-parallel.o -MD -MP -MF "$(DEPDIR)/libxtre_la-tre-match-parallel.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-tre-match-parallel.o `test -f '../lib/tre-match-parallel.c' || echo '$(srcdir)/'`../lib/tre-match-parallel.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-tre-match-parallel.Tpo" "$(DEPDIR)/libxtre_la-tre-match-parallel.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-tre-match-parallel.Tpo" "$(DEPDIR)/libxtre_la-tre-match-parallel.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-tre-match-parallel.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/tre-match-parallel.c' object='libxtre_la-tre-match-parallel.o' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -390,7 +438,7 @@ libxtre_la-tre-match-parallel.o: ../lib/tre-match-parallel.c
|
|||
libxtre_la-tre-match-parallel.obj: ../lib/tre-match-parallel.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-tre-match-parallel.obj -MD -MP -MF "$(DEPDIR)/libxtre_la-tre-match-parallel.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-tre-match-parallel.obj `if test -f '../lib/tre-match-parallel.c'; then $(CYGPATH_W) '../lib/tre-match-parallel.c'; else $(CYGPATH_W) '$(srcdir)/../lib/tre-match-parallel.c'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-tre-match-parallel.Tpo" "$(DEPDIR)/libxtre_la-tre-match-parallel.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-tre-match-parallel.Tpo" "$(DEPDIR)/libxtre_la-tre-match-parallel.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-tre-match-parallel.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/tre-match-parallel.c' object='libxtre_la-tre-match-parallel.obj' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -401,7 +449,7 @@ libxtre_la-tre-match-parallel.obj: ../lib/tre-match-parallel.c
|
|||
libxtre_la-tre-match-parallel.lo: ../lib/tre-match-parallel.c
|
||||
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-tre-match-parallel.lo -MD -MP -MF "$(DEPDIR)/libxtre_la-tre-match-parallel.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-tre-match-parallel.lo `test -f '../lib/tre-match-parallel.c' || echo '$(srcdir)/'`../lib/tre-match-parallel.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-tre-match-parallel.Tpo" "$(DEPDIR)/libxtre_la-tre-match-parallel.Plo"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-tre-match-parallel.Tpo" "$(DEPDIR)/libxtre_la-tre-match-parallel.Plo"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-tre-match-parallel.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/tre-match-parallel.c' object='libxtre_la-tre-match-parallel.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
|
@ -412,7 +460,7 @@ libxtre_la-tre-match-parallel.lo: ../lib/tre-match-parallel.c
|
|||
libxtre_la-tre-match-backtrack.o: ../lib/tre-match-backtrack.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-tre-match-backtrack.o -MD -MP -MF "$(DEPDIR)/libxtre_la-tre-match-backtrack.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-tre-match-backtrack.o `test -f '../lib/tre-match-backtrack.c' || echo '$(srcdir)/'`../lib/tre-match-backtrack.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-tre-match-backtrack.Tpo" "$(DEPDIR)/libxtre_la-tre-match-backtrack.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-tre-match-backtrack.Tpo" "$(DEPDIR)/libxtre_la-tre-match-backtrack.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-tre-match-backtrack.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/tre-match-backtrack.c' object='libxtre_la-tre-match-backtrack.o' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -423,7 +471,7 @@ libxtre_la-tre-match-backtrack.o: ../lib/tre-match-backtrack.c
|
|||
libxtre_la-tre-match-backtrack.obj: ../lib/tre-match-backtrack.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-tre-match-backtrack.obj -MD -MP -MF "$(DEPDIR)/libxtre_la-tre-match-backtrack.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-tre-match-backtrack.obj `if test -f '../lib/tre-match-backtrack.c'; then $(CYGPATH_W) '../lib/tre-match-backtrack.c'; else $(CYGPATH_W) '$(srcdir)/../lib/tre-match-backtrack.c'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-tre-match-backtrack.Tpo" "$(DEPDIR)/libxtre_la-tre-match-backtrack.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-tre-match-backtrack.Tpo" "$(DEPDIR)/libxtre_la-tre-match-backtrack.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-tre-match-backtrack.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/tre-match-backtrack.c' object='libxtre_la-tre-match-backtrack.obj' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -434,7 +482,7 @@ libxtre_la-tre-match-backtrack.obj: ../lib/tre-match-backtrack.c
|
|||
libxtre_la-tre-match-backtrack.lo: ../lib/tre-match-backtrack.c
|
||||
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-tre-match-backtrack.lo -MD -MP -MF "$(DEPDIR)/libxtre_la-tre-match-backtrack.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-tre-match-backtrack.lo `test -f '../lib/tre-match-backtrack.c' || echo '$(srcdir)/'`../lib/tre-match-backtrack.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-tre-match-backtrack.Tpo" "$(DEPDIR)/libxtre_la-tre-match-backtrack.Plo"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-tre-match-backtrack.Tpo" "$(DEPDIR)/libxtre_la-tre-match-backtrack.Plo"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-tre-match-backtrack.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/tre-match-backtrack.c' object='libxtre_la-tre-match-backtrack.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
|
@ -445,7 +493,7 @@ libxtre_la-tre-match-backtrack.lo: ../lib/tre-match-backtrack.c
|
|||
libxtre_la-tre-match-approx.o: ../lib/tre-match-approx.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-tre-match-approx.o -MD -MP -MF "$(DEPDIR)/libxtre_la-tre-match-approx.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-tre-match-approx.o `test -f '../lib/tre-match-approx.c' || echo '$(srcdir)/'`../lib/tre-match-approx.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-tre-match-approx.Tpo" "$(DEPDIR)/libxtre_la-tre-match-approx.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-tre-match-approx.Tpo" "$(DEPDIR)/libxtre_la-tre-match-approx.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-tre-match-approx.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/tre-match-approx.c' object='libxtre_la-tre-match-approx.o' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -456,7 +504,7 @@ libxtre_la-tre-match-approx.o: ../lib/tre-match-approx.c
|
|||
libxtre_la-tre-match-approx.obj: ../lib/tre-match-approx.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-tre-match-approx.obj -MD -MP -MF "$(DEPDIR)/libxtre_la-tre-match-approx.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-tre-match-approx.obj `if test -f '../lib/tre-match-approx.c'; then $(CYGPATH_W) '../lib/tre-match-approx.c'; else $(CYGPATH_W) '$(srcdir)/../lib/tre-match-approx.c'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-tre-match-approx.Tpo" "$(DEPDIR)/libxtre_la-tre-match-approx.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-tre-match-approx.Tpo" "$(DEPDIR)/libxtre_la-tre-match-approx.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-tre-match-approx.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/tre-match-approx.c' object='libxtre_la-tre-match-approx.obj' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -467,7 +515,7 @@ libxtre_la-tre-match-approx.obj: ../lib/tre-match-approx.c
|
|||
libxtre_la-tre-match-approx.lo: ../lib/tre-match-approx.c
|
||||
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-tre-match-approx.lo -MD -MP -MF "$(DEPDIR)/libxtre_la-tre-match-approx.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-tre-match-approx.lo `test -f '../lib/tre-match-approx.c' || echo '$(srcdir)/'`../lib/tre-match-approx.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-tre-match-approx.Tpo" "$(DEPDIR)/libxtre_la-tre-match-approx.Plo"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-tre-match-approx.Tpo" "$(DEPDIR)/libxtre_la-tre-match-approx.Plo"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-tre-match-approx.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/tre-match-approx.c' object='libxtre_la-tre-match-approx.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
|
@ -478,7 +526,7 @@ libxtre_la-tre-match-approx.lo: ../lib/tre-match-approx.c
|
|||
libxtre_la-regcomp.o: ../lib/regcomp.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-regcomp.o -MD -MP -MF "$(DEPDIR)/libxtre_la-regcomp.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-regcomp.o `test -f '../lib/regcomp.c' || echo '$(srcdir)/'`../lib/regcomp.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-regcomp.Tpo" "$(DEPDIR)/libxtre_la-regcomp.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-regcomp.Tpo" "$(DEPDIR)/libxtre_la-regcomp.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-regcomp.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/regcomp.c' object='libxtre_la-regcomp.o' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -489,7 +537,7 @@ libxtre_la-regcomp.o: ../lib/regcomp.c
|
|||
libxtre_la-regcomp.obj: ../lib/regcomp.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-regcomp.obj -MD -MP -MF "$(DEPDIR)/libxtre_la-regcomp.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-regcomp.obj `if test -f '../lib/regcomp.c'; then $(CYGPATH_W) '../lib/regcomp.c'; else $(CYGPATH_W) '$(srcdir)/../lib/regcomp.c'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-regcomp.Tpo" "$(DEPDIR)/libxtre_la-regcomp.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-regcomp.Tpo" "$(DEPDIR)/libxtre_la-regcomp.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-regcomp.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/regcomp.c' object='libxtre_la-regcomp.obj' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -500,7 +548,7 @@ libxtre_la-regcomp.obj: ../lib/regcomp.c
|
|||
libxtre_la-regcomp.lo: ../lib/regcomp.c
|
||||
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-regcomp.lo -MD -MP -MF "$(DEPDIR)/libxtre_la-regcomp.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-regcomp.lo `test -f '../lib/regcomp.c' || echo '$(srcdir)/'`../lib/regcomp.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-regcomp.Tpo" "$(DEPDIR)/libxtre_la-regcomp.Plo"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-regcomp.Tpo" "$(DEPDIR)/libxtre_la-regcomp.Plo"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-regcomp.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/regcomp.c' object='libxtre_la-regcomp.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
|
@ -511,7 +559,7 @@ libxtre_la-regcomp.lo: ../lib/regcomp.c
|
|||
libxtre_la-regexec.o: ../lib/regexec.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-regexec.o -MD -MP -MF "$(DEPDIR)/libxtre_la-regexec.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-regexec.o `test -f '../lib/regexec.c' || echo '$(srcdir)/'`../lib/regexec.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-regexec.Tpo" "$(DEPDIR)/libxtre_la-regexec.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-regexec.Tpo" "$(DEPDIR)/libxtre_la-regexec.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-regexec.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/regexec.c' object='libxtre_la-regexec.o' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -522,7 +570,7 @@ libxtre_la-regexec.o: ../lib/regexec.c
|
|||
libxtre_la-regexec.obj: ../lib/regexec.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-regexec.obj -MD -MP -MF "$(DEPDIR)/libxtre_la-regexec.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-regexec.obj `if test -f '../lib/regexec.c'; then $(CYGPATH_W) '../lib/regexec.c'; else $(CYGPATH_W) '$(srcdir)/../lib/regexec.c'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-regexec.Tpo" "$(DEPDIR)/libxtre_la-regexec.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-regexec.Tpo" "$(DEPDIR)/libxtre_la-regexec.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-regexec.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/regexec.c' object='libxtre_la-regexec.obj' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -533,7 +581,7 @@ libxtre_la-regexec.obj: ../lib/regexec.c
|
|||
libxtre_la-regexec.lo: ../lib/regexec.c
|
||||
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-regexec.lo -MD -MP -MF "$(DEPDIR)/libxtre_la-regexec.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-regexec.lo `test -f '../lib/regexec.c' || echo '$(srcdir)/'`../lib/regexec.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-regexec.Tpo" "$(DEPDIR)/libxtre_la-regexec.Plo"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-regexec.Tpo" "$(DEPDIR)/libxtre_la-regexec.Plo"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-regexec.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/regexec.c' object='libxtre_la-regexec.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
|
@ -544,7 +592,7 @@ libxtre_la-regexec.lo: ../lib/regexec.c
|
|||
libxtre_la-regerror.o: ../lib/regerror.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-regerror.o -MD -MP -MF "$(DEPDIR)/libxtre_la-regerror.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-regerror.o `test -f '../lib/regerror.c' || echo '$(srcdir)/'`../lib/regerror.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-regerror.Tpo" "$(DEPDIR)/libxtre_la-regerror.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-regerror.Tpo" "$(DEPDIR)/libxtre_la-regerror.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-regerror.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/regerror.c' object='libxtre_la-regerror.o' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -555,7 +603,7 @@ libxtre_la-regerror.o: ../lib/regerror.c
|
|||
libxtre_la-regerror.obj: ../lib/regerror.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-regerror.obj -MD -MP -MF "$(DEPDIR)/libxtre_la-regerror.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-regerror.obj `if test -f '../lib/regerror.c'; then $(CYGPATH_W) '../lib/regerror.c'; else $(CYGPATH_W) '$(srcdir)/../lib/regerror.c'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-regerror.Tpo" "$(DEPDIR)/libxtre_la-regerror.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-regerror.Tpo" "$(DEPDIR)/libxtre_la-regerror.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-regerror.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/regerror.c' object='libxtre_la-regerror.obj' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -566,7 +614,7 @@ libxtre_la-regerror.obj: ../lib/regerror.c
|
|||
libxtre_la-regerror.lo: ../lib/regerror.c
|
||||
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-regerror.lo -MD -MP -MF "$(DEPDIR)/libxtre_la-regerror.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-regerror.lo `test -f '../lib/regerror.c' || echo '$(srcdir)/'`../lib/regerror.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-regerror.Tpo" "$(DEPDIR)/libxtre_la-regerror.Plo"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-regerror.Tpo" "$(DEPDIR)/libxtre_la-regerror.Plo"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-regerror.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/regerror.c' object='libxtre_la-regerror.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
|
@ -577,7 +625,7 @@ libxtre_la-regerror.lo: ../lib/regerror.c
|
|||
libxtre_la-xmalloc.o: ../lib/xmalloc.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-xmalloc.o -MD -MP -MF "$(DEPDIR)/libxtre_la-xmalloc.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-xmalloc.o `test -f '../lib/xmalloc.c' || echo '$(srcdir)/'`../lib/xmalloc.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-xmalloc.Tpo" "$(DEPDIR)/libxtre_la-xmalloc.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-xmalloc.Tpo" "$(DEPDIR)/libxtre_la-xmalloc.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-xmalloc.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/xmalloc.c' object='libxtre_la-xmalloc.o' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -588,7 +636,7 @@ libxtre_la-xmalloc.o: ../lib/xmalloc.c
|
|||
libxtre_la-xmalloc.obj: ../lib/xmalloc.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-xmalloc.obj -MD -MP -MF "$(DEPDIR)/libxtre_la-xmalloc.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-xmalloc.obj `if test -f '../lib/xmalloc.c'; then $(CYGPATH_W) '../lib/xmalloc.c'; else $(CYGPATH_W) '$(srcdir)/../lib/xmalloc.c'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-xmalloc.Tpo" "$(DEPDIR)/libxtre_la-xmalloc.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-xmalloc.Tpo" "$(DEPDIR)/libxtre_la-xmalloc.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-xmalloc.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/xmalloc.c' object='libxtre_la-xmalloc.obj' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -599,7 +647,7 @@ libxtre_la-xmalloc.obj: ../lib/xmalloc.c
|
|||
libxtre_la-xmalloc.lo: ../lib/xmalloc.c
|
||||
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libxtre_la_CFLAGS) $(CFLAGS) -MT libxtre_la-xmalloc.lo -MD -MP -MF "$(DEPDIR)/libxtre_la-xmalloc.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o libxtre_la-xmalloc.lo `test -f '../lib/xmalloc.c' || echo '$(srcdir)/'`../lib/xmalloc.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/libxtre_la-xmalloc.Tpo" "$(DEPDIR)/libxtre_la-xmalloc.Plo"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libxtre_la-xmalloc.Tpo" "$(DEPDIR)/libxtre_la-xmalloc.Plo"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/libxtre_la-xmalloc.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../lib/xmalloc.c' object='libxtre_la-xmalloc.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
|
@ -610,7 +658,7 @@ libxtre_la-xmalloc.lo: ../lib/xmalloc.c
|
|||
randtest-randtest.o: randtest.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(randtest_CFLAGS) $(CFLAGS) -MT randtest-randtest.o -MD -MP -MF "$(DEPDIR)/randtest-randtest.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o randtest-randtest.o `test -f 'randtest.c' || echo '$(srcdir)/'`randtest.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/randtest-randtest.Tpo" "$(DEPDIR)/randtest-randtest.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/randtest-randtest.Tpo" "$(DEPDIR)/randtest-randtest.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/randtest-randtest.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='randtest.c' object='randtest-randtest.o' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -621,7 +669,7 @@ randtest-randtest.o: randtest.c
|
|||
randtest-randtest.obj: randtest.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(randtest_CFLAGS) $(CFLAGS) -MT randtest-randtest.obj -MD -MP -MF "$(DEPDIR)/randtest-randtest.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o randtest-randtest.obj `if test -f 'randtest.c'; then $(CYGPATH_W) 'randtest.c'; else $(CYGPATH_W) '$(srcdir)/randtest.c'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/randtest-randtest.Tpo" "$(DEPDIR)/randtest-randtest.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/randtest-randtest.Tpo" "$(DEPDIR)/randtest-randtest.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/randtest-randtest.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='randtest.c' object='randtest-randtest.obj' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -632,7 +680,7 @@ randtest-randtest.obj: randtest.c
|
|||
randtest-randtest.lo: randtest.c
|
||||
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(randtest_CFLAGS) $(CFLAGS) -MT randtest-randtest.lo -MD -MP -MF "$(DEPDIR)/randtest-randtest.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o randtest-randtest.lo `test -f 'randtest.c' || echo '$(srcdir)/'`randtest.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/randtest-randtest.Tpo" "$(DEPDIR)/randtest-randtest.Plo"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/randtest-randtest.Tpo" "$(DEPDIR)/randtest-randtest.Plo"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/randtest-randtest.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='randtest.c' object='randtest-randtest.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
|
@ -643,7 +691,7 @@ randtest-randtest.lo: randtest.c
|
|||
retest-retest.o: retest.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(retest_CFLAGS) $(CFLAGS) -MT retest-retest.o -MD -MP -MF "$(DEPDIR)/retest-retest.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o retest-retest.o `test -f 'retest.c' || echo '$(srcdir)/'`retest.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/retest-retest.Tpo" "$(DEPDIR)/retest-retest.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/retest-retest.Tpo" "$(DEPDIR)/retest-retest.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/retest-retest.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='retest.c' object='retest-retest.o' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -654,7 +702,7 @@ retest-retest.o: retest.c
|
|||
retest-retest.obj: retest.c
|
||||
@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(retest_CFLAGS) $(CFLAGS) -MT retest-retest.obj -MD -MP -MF "$(DEPDIR)/retest-retest.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o retest-retest.obj `if test -f 'retest.c'; then $(CYGPATH_W) 'retest.c'; else $(CYGPATH_W) '$(srcdir)/retest.c'; fi`; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/retest-retest.Tpo" "$(DEPDIR)/retest-retest.Po"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/retest-retest.Tpo" "$(DEPDIR)/retest-retest.Po"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/retest-retest.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='retest.c' object='retest-retest.obj' libtool=no @AMDEPBACKSLASH@
|
||||
|
@ -665,7 +713,7 @@ retest-retest.obj: retest.c
|
|||
retest-retest.lo: retest.c
|
||||
@am__fastdepCC_TRUE@ if $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(retest_CFLAGS) $(CFLAGS) -MT retest-retest.lo -MD -MP -MF "$(DEPDIR)/retest-retest.Tpo" \
|
||||
@am__fastdepCC_TRUE@ -c -o retest-retest.lo `test -f 'retest.c' || echo '$(srcdir)/'`retest.c; \
|
||||
@am__fastdepCC_TRUE@ then mv "$(DEPDIR)/retest-retest.Tpo" "$(DEPDIR)/retest-retest.Plo"; \
|
||||
@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/retest-retest.Tpo" "$(DEPDIR)/retest-retest.Plo"; \
|
||||
@am__fastdepCC_TRUE@ else rm -f "$(DEPDIR)/retest-retest.Tpo"; exit 1; \
|
||||
@am__fastdepCC_TRUE@ fi
|
||||
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='retest.c' object='retest-retest.lo' libtool=yes @AMDEPBACKSLASH@
|
||||
|
@ -847,7 +895,6 @@ check: check-am
|
|||
all-am: Makefile $(LTLIBRARIES) $(PROGRAMS)
|
||||
|
||||
installdirs:
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
@ -867,7 +914,7 @@ mostlyclean-generic:
|
|||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
|
@ -878,9 +925,10 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
|
|||
clean-noinstPROGRAMS mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
distclean-am: clean-am distclean-compile distclean-depend \
|
||||
distclean-generic distclean-libtool distclean-tags
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
|
@ -901,7 +949,8 @@ install-man:
|
|||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
-rm -rf ./$(DEPDIR)
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
@ -922,14 +971,14 @@ uninstall-am: uninstall-info-am
|
|||
.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
|
||||
clean-generic clean-libtool clean-noinstLTLIBRARIES \
|
||||
clean-noinstPROGRAMS ctags distclean distclean-compile \
|
||||
distclean-depend distclean-generic distclean-libtool \
|
||||
distclean-tags distdir dvi dvi-am info info-am install \
|
||||
install-am install-data install-data-am install-exec \
|
||||
install-exec-am install-info install-info-am install-man \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
maintainer-clean maintainer-clean-generic mostlyclean \
|
||||
mostlyclean-compile mostlyclean-generic mostlyclean-libtool pdf \
|
||||
pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am
|
||||
distclean-generic distclean-libtool distclean-tags distdir dvi \
|
||||
dvi-am info info-am install install-am install-data \
|
||||
install-data-am install-exec install-exec-am install-info \
|
||||
install-info-am install-man install-strip installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-info-am
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*
|
||||
bench.c - regex benchmark program
|
||||
bench.c - simple regex benchmark program
|
||||
|
||||
Copyright (C) 2001, 2002 Ville Laurikari <vl@iki.fi>.
|
||||
Copyright (C) 2001-2003 Ville Laurikari <vl@iki.fi>.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License version 2 (June
|
||||
|
@ -18,13 +18,20 @@
|
|||
|
||||
*/
|
||||
|
||||
#define _XOPEN_SOURCE
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#endif /* HAVE_GETOPT_H */
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <math.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if 0
|
||||
#include <hackerlab/rx-posix/regex.h>
|
||||
#else
|
||||
|
|
|
@ -19,9 +19,10 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
This is just a simple test application containing various hand-written
|
||||
tests for regression testing TRE. Some of these tests are TRE
|
||||
specific, but most are applicable to any POSIX regexp implementation.
|
||||
This is just a simple test application containing various hands-written
|
||||
tests for regression testing TRE. I've tried to surround TRE specific
|
||||
tests inside ifdefs, so this can be used to test any POSIX compatible
|
||||
regexp implementation.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
@ -103,14 +104,46 @@ test_exec(char *str, int eflags, ...)
|
|||
#endif /* !MALLOC_DEBUGGING */
|
||||
/* XXX - test the approximate matcher (with cost 0) and the
|
||||
backtracking matcher as well using special eflags. */
|
||||
|
||||
#if defined(MALLOC_DEBUGGING) && !defined(TRE_USE_ALLOCA)
|
||||
{
|
||||
static int j = 0, k = 0;
|
||||
int i = 0;
|
||||
while (1)
|
||||
{
|
||||
if (j++ % 20 == 0)
|
||||
{
|
||||
printf(",");
|
||||
if (++k % 79 == 0)
|
||||
printf("\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
xmalloc_configure(i);
|
||||
comp_tests++;
|
||||
m = regnexec(&reobj, data, len, elementsof(pmatch), pmatch, eflags);
|
||||
if (m != REG_ESPACE)
|
||||
{
|
||||
printf("#");
|
||||
if (++k % 79 == 0)
|
||||
printf("\n");
|
||||
break;
|
||||
}
|
||||
#ifdef REGEX_DEBUG
|
||||
xmalloc_dump_leaks();
|
||||
#endif /* REGEX_DEBUG */
|
||||
i++;
|
||||
}
|
||||
}
|
||||
#else
|
||||
m = regnexec(&reobj, data, len, elementsof(pmatch), pmatch, eflags);
|
||||
#endif
|
||||
xfree(data);
|
||||
if (m != va_arg(ap, int))
|
||||
{
|
||||
printf("Exec error, regex: \"%s\", cflags %d, "
|
||||
"string: \"%s\", eflags %d\n", regex_pattern, cflags,
|
||||
str, eflags);
|
||||
printf(" got %smatch\n", m ? "no " : "");
|
||||
printf(" got %smatch (regnexec returned %d)\n", m ? "no " : "", m);
|
||||
fail = 1;
|
||||
}
|
||||
|
||||
|
@ -127,8 +160,12 @@ test_exec(char *str, int eflags, ...)
|
|||
{
|
||||
printf("Exec error, regex: \"%s\", string: \"%s\"\n",
|
||||
regex_pattern, str);
|
||||
printf(" group %d: expected (%d, %d), got (%d, %d)\n",
|
||||
i, rm_so, rm_eo, pmatch[i].rm_so, pmatch[i].rm_eo);
|
||||
printf(" group %d: expected (%d, %d) \"%.*s\", "
|
||||
"got (%d, %d) \"%.*s\"\n",
|
||||
i, rm_so, rm_eo, rm_eo - rm_so, str + rm_so,
|
||||
pmatch[i].rm_so, pmatch[i].rm_eo,
|
||||
pmatch[i].rm_eo - pmatch[i].rm_so,
|
||||
str + pmatch[i].rm_so);
|
||||
fail = 1;
|
||||
}
|
||||
}
|
||||
|
@ -138,7 +175,7 @@ test_exec(char *str, int eflags, ...)
|
|||
&& reobj.re_nsub <= elementsof(pmatch))
|
||||
{
|
||||
printf("Comp error, regex: \"%s\"\n", regex_pattern);
|
||||
printf(" re_nsub is %d, should be %d\n", reobj.re_nsub, i - 1);
|
||||
printf(" re_nsub is %d, should be %d\n", (int)reobj.re_nsub, i - 1);
|
||||
fail = 1;
|
||||
}
|
||||
|
||||
|
@ -248,6 +285,114 @@ int
|
|||
main(int argc, char **argv)
|
||||
{
|
||||
|
||||
#if 0
|
||||
/* Should these match or not? */
|
||||
test_comp("(a)*-\\1b", REG_EXTENDED, 0);
|
||||
test_exec("aaa-b", 0, REG_NOMATCH, END);
|
||||
test_comp("((.*)\\1)+", REG_EXTENDED, 0);
|
||||
test_exec("xxxxxx", 0, REG_NOMATCH, END);
|
||||
#endif
|
||||
|
||||
#ifdef TRE_APPROX
|
||||
/*
|
||||
* Approximate matching tests.
|
||||
*
|
||||
* The approximate matcher always searches for the best match, and returns
|
||||
* the leftmost and longest one if there are several best matches.
|
||||
*/
|
||||
|
||||
test_comp("(fou){# ~1}", REG_EXTENDED, 0);
|
||||
test_comp("(fuu){#}", REG_EXTENDED, 0);
|
||||
test_comp("(fuu){# ~}", REG_EXTENDED, 0);
|
||||
test_comp("(anaconda){ 1i + 1d < 1, #1}", REG_EXTENDED, 0);
|
||||
test_comp("(anaconda){ 1i + 1d < 1 #1 ~10 }", REG_EXTENDED, 0);
|
||||
test_comp("(anaconda){ #1, ~1, 1i + 1d < 1 }", REG_EXTENDED, 0);
|
||||
|
||||
test_comp("(znacnda){ #1 ~3 1i + 1d < 1 }", REG_EXTENDED, 0);
|
||||
test_exec("molasses anaconda foo bar baz smith anderson ",
|
||||
0, REG_NOMATCH);
|
||||
test_comp("(znacnda){ #1 ~3 1i + 1d < 2 }", REG_EXTENDED, 0);
|
||||
test_exec("molasses anaconda foo bar baz smith anderson ",
|
||||
0, REG_OK, 9, 17, 9, 17, END);
|
||||
test_comp("(ananda){ 1i + 1d < 2 }", REG_EXTENDED, 0);
|
||||
test_exec("molasses anaconda foo bar baz smith anderson ",
|
||||
0, REG_NOMATCH);
|
||||
|
||||
test_comp("(fuu){ +3 -3 ~5}", REG_EXTENDED, 0);
|
||||
test_exec("anaconda foo bar baz smith anderson",
|
||||
0, REG_OK, 9, 10, 9, 10, END);
|
||||
test_comp("(fuu){ +2 -2 ~5}", REG_EXTENDED, 0);
|
||||
test_exec("anaconda foo bar baz smith anderson",
|
||||
0, REG_OK, 9, 10, 9, 10, END);
|
||||
test_comp("(fuu){ +3 -3 ~}", REG_EXTENDED, 0);
|
||||
test_exec("anaconda foo bar baz smith anderson",
|
||||
0, REG_OK, 9, 10, 9, 10, END);
|
||||
|
||||
test_comp("(laurikari){ #3, 1i + 1d < 3 }", REG_EXTENDED, 0);
|
||||
|
||||
/* No cost limit. */
|
||||
test_comp("(foobar){~}", REG_EXTENDED, 0);
|
||||
test_exec("xirefoabralfobarxie", 0, REG_OK, 11, 16, 11, 16, END);
|
||||
|
||||
/* At most two errors. */
|
||||
test_comp("(foobar){~2}", REG_EXTENDED, 0);
|
||||
test_exec("xirefoabrzlfd", 0, REG_OK, 4, 9, 4, 9, END);
|
||||
test_exec("xirefoabzlfd", 0, REG_NOMATCH, END);
|
||||
|
||||
/* At most two inserts or substitutions and max two errors total. */
|
||||
test_comp("(foobar){+2#2~2}", REG_EXTENDED, 0);
|
||||
test_exec("oobargoobaploowap", 0, REG_OK, 5, 11, 5, 11, END);
|
||||
|
||||
/* Find best whole word match for "foobar". */
|
||||
test_comp("\\<(foobar){~}\\>", REG_EXTENDED, 0);
|
||||
test_exec("zfoobarz", 0, REG_OK, 0, 8, 0, 8, END);
|
||||
test_exec("boing zfoobarz goobar woop", 0, REG_OK, 15, 21, 15, 21, END);
|
||||
|
||||
/* Match whole string, allow only 1 error. */
|
||||
test_comp("^(foobar){~1}$", REG_EXTENDED, 0);
|
||||
test_exec("foobar", 0, REG_OK, 0, 6, 0, 6, END);
|
||||
test_exec("xfoobar", 0, REG_OK, 0, 7, 0, 7, END);
|
||||
/*
|
||||
This currently fails.
|
||||
test_exec("foobarx", 0, REG_OK, 0, 7, 0, 7, END);
|
||||
*/
|
||||
test_exec("fooxbar", 0, REG_OK, 0, 7, 0, 7, END);
|
||||
test_exec("foxbar", 0, REG_OK, 0, 6, 0, 6, END);
|
||||
test_exec("xoobar", 0, REG_OK, 0, 6, 0, 6, END);
|
||||
test_exec("foobax", 0, REG_OK, 0, 6, 0, 6, END);
|
||||
test_exec("oobar", 0, REG_OK, 0, 5, 0, 5, END);
|
||||
test_exec("fobar", 0, REG_OK, 0, 5, 0, 5, END);
|
||||
test_exec("fooba", 0, REG_OK, 0, 5, 0, 5, END);
|
||||
test_exec("xfoobarx", 0, REG_NOMATCH, END);
|
||||
test_exec("foobarxx", 0, REG_NOMATCH, END);
|
||||
test_exec("xxfoobar", 0, REG_NOMATCH, END);
|
||||
test_exec("xfoxbar", 0, REG_NOMATCH, END);
|
||||
test_exec("foxbarx", 0, REG_NOMATCH, END);
|
||||
|
||||
/* At most one insert, two deletes, and three substitutions.
|
||||
Additionally, deletes cost two and substitutes one, and total
|
||||
cost must be less than 4. */
|
||||
test_comp("(foobar){+1 -2 #3, 2d + 1s < 4}", REG_EXTENDED, 0);
|
||||
test_exec("3oifaowefbaoraofuiebofasebfaobfaorfeoaro",
|
||||
0, REG_OK, 26, 33, 26, 33, END);
|
||||
|
||||
/* Partially approximate matches. */
|
||||
test_comp("foo(bar){~1}zap", REG_EXTENDED, 0);
|
||||
test_exec("foobarzap", 0, REG_OK, 0, 9, 3, 6, END);
|
||||
test_exec("fobarzap", 0, REG_NOMATCH);
|
||||
test_exec("foobrzap", 0, REG_OK, 0, 8, 3, 5, END);
|
||||
test_comp("^.*(dot.org){~}.*$", REG_EXTENDED, 0);
|
||||
test_exec("www.cnn.com 64.236.16.20\n"
|
||||
"www.slashdot.org 66.35.250.150\n"
|
||||
"For useful information, use www.slashdot.org\n"
|
||||
"this is demo data!\n",
|
||||
0, REG_OK, 0, 120, 93, 100, END);
|
||||
|
||||
/* Approximate matching and back referencing cannot be used together. */
|
||||
test_comp("(foo{~})\\1", REG_EXTENDED, REG_BADPAT);
|
||||
|
||||
#endif /* TRE_APPROX */
|
||||
|
||||
/*
|
||||
* Basic tests with pure regular expressions
|
||||
*/
|
||||
|
@ -261,7 +406,7 @@ main(int argc, char **argv)
|
|||
test_comp("aaaa", REG_EXTENDED, 0);
|
||||
test_exec("xxaaaaaaaaaaaaaaaaa", 0, REG_OK, 2, 6, END);
|
||||
|
||||
/* Test zero length match. */
|
||||
/* Test zero length matches. */
|
||||
test_comp("(a*)", REG_EXTENDED, 0);
|
||||
test_exec("", 0, REG_OK, 0, 0, 0, 0, END);
|
||||
|
||||
|
@ -663,6 +808,7 @@ main(int argc, char **argv)
|
|||
test_comp("[[=", 0, REG_ECOLLATE);
|
||||
|
||||
|
||||
|
||||
/* Miscellaneous tests. */
|
||||
test_comp("abc\\(\\(de\\)\\(fg\\)\\)hi", 0, 0);
|
||||
test_exec("xabcdefghiy", 0, REG_OK, 1, 10, 4, 8, 4, 6, 6, 8, END);
|
||||
|
@ -940,6 +1086,21 @@ main(int argc, char **argv)
|
|||
test_comp("((..)|(.)){2}", REG_EXTENDED, 0);
|
||||
test_exec("aa", 0, REG_OK, 0, 2, 1, 2, -1, -1, 1, 2, END);
|
||||
|
||||
/* Nested repeats. */
|
||||
test_comp("(.){2}{3}", REG_EXTENDED, 0);
|
||||
test_exec("xxxxx", 0, REG_NOMATCH, END);
|
||||
test_exec("xxxxxx", 0, REG_OK, 0, 6, 5, 6, END);
|
||||
test_comp("(..){2}{3}", REG_EXTENDED, 0);
|
||||
test_exec("xxxxxxxxxxx", 0, REG_NOMATCH, END);
|
||||
test_exec("xxxxxxxxxxxx", 0, REG_OK, 0, 12, 10, 12, END);
|
||||
test_comp("((..){2}.){3}", REG_EXTENDED, 0);
|
||||
test_exec("xxxxxxxxxxxxxx", 0, REG_NOMATCH, END);
|
||||
test_exec("xxxxxxxxxxxxxxx", 0, REG_OK, 0, 15, 10, 15, 12, 14, END);
|
||||
test_comp("((..){1,2}.){3}", REG_EXTENDED, 0);
|
||||
test_exec("xxxxxxxx", 0, REG_NOMATCH, END);
|
||||
test_exec("xxxxxxxxx", 0, REG_OK, 0, 9, 6, 9, 6, 8, END);
|
||||
test_exec("xxxxxxxxxx", 0, REG_OK, 0, 9, 6, 9, 6, 8, END);
|
||||
test_exec("xxxxxxxxxxx", 0, REG_OK, 0, 11, 8, 11, 8, 10, END);
|
||||
|
||||
/*
|
||||
* Back referencing tests.
|
||||
|
@ -970,6 +1131,20 @@ main(int argc, char **argv)
|
|||
test_comp("(a)\\1{1,2}", REG_EXTENDED, 0);
|
||||
test_exec("aabc", 0, REG_OK, 0, 2, 0, 1, END);
|
||||
|
||||
test_comp("((.*)\\1)+", REG_EXTENDED, 0);
|
||||
test_exec("aa", 0, REG_OK, 0, 2, 0, 2, 0, 1, END);
|
||||
|
||||
test_comp("()(\\1\\1)*", REG_EXTENDED, 0);
|
||||
test_exec("", 0, REG_OK, 0, 0, 0, 0, -1, -1, END);
|
||||
|
||||
/* Check that back references work with REG_NOSUB. */
|
||||
test_comp("(o)\\1", REG_EXTENDED | REG_NOSUB, 0);
|
||||
test_exec("foobar", 0, REG_OK, END);
|
||||
test_comp("(o)\\1", REG_EXTENDED, 0);
|
||||
test_exec("foobar", 0, REG_OK, 1, 3, 1, 2, END);
|
||||
test_comp("(o)\\1", REG_EXTENDED, 0);
|
||||
test_exec("fobar", 0, REG_NOMATCH, END);
|
||||
|
||||
|
||||
/*
|
||||
* Test minimal repetitions (non-greedy repetitions)
|
||||
|
@ -998,7 +1173,10 @@ main(int argc, char **argv)
|
|||
*/
|
||||
|
||||
test_comp("\\", REG_EXTENDED, REG_EESCAPE);
|
||||
test_comp("\\\\", REG_EXTENDED, REG_OK);
|
||||
test_exec("\\", 0, REG_OK, 0, 1, END);
|
||||
test_comp("(", REG_EXTENDED, REG_EPAREN);
|
||||
test_comp("(aaa", REG_EXTENDED, REG_EPAREN);
|
||||
test_comp(")", REG_EXTENDED, REG_OK);
|
||||
test_exec(")", 0, REG_OK, 0, 1, END);
|
||||
test_comp("a{1", REG_EXTENDED, REG_EBRACE);
|
||||
|
@ -1008,6 +1186,7 @@ main(int argc, char **argv)
|
|||
test_comp("a{x}", REG_EXTENDED, REG_BADBR);
|
||||
test_comp("a{}", REG_EXTENDED, REG_BADBR);
|
||||
|
||||
|
||||
test_comp("\\", 0, REG_EESCAPE);
|
||||
test_comp("\\(", 0, REG_EPAREN);
|
||||
test_comp("\\)", 0, REG_EPAREN);
|
||||
|
@ -1060,10 +1239,9 @@ main(int argc, char **argv)
|
|||
printf("All %d tests passed.\n", comp_tests + exec_tests);
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef MALLOC_DEBUGGING
|
||||
xmalloc_dump_leaks();
|
||||
if (xmalloc_dump_leaks())
|
||||
return 1;
|
||||
#endif /* MALLOC_DEBUGGING */
|
||||
|
||||
return comp_errors || exec_errors;
|
||||
|
|
|
@ -29,14 +29,15 @@
|
|||
#include <sys/types.h>
|
||||
#include <locale.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif /* HAVE_MALLOC_H */
|
||||
#include <limits.h>
|
||||
#if HAVE_RX
|
||||
#include <hackerlab/rx-posix/regex.h>
|
||||
#else
|
||||
#include <regex.h>
|
||||
#endif
|
||||
#ifdef HAVE_MALLOC_H
|
||||
#include <malloc.h>
|
||||
#endif /* HAVE_MALLOC_H */
|
||||
|
||||
#ifdef MALLOC_DEBUGGING
|
||||
#include "xmalloc.h"
|
||||
|
@ -76,7 +77,7 @@ test_exec(char *str, int cost_ins, int cost_del, int cost_subst,
|
|||
va_start(ap, cost);
|
||||
match.pmatch = pmatch;
|
||||
match.nmatch = elementsof(pmatch);
|
||||
memset(¶ms, 0, sizeof(params));
|
||||
regaparams_default(¶ms);
|
||||
params.cost_ins = cost_ins;
|
||||
params.cost_del = cost_del;
|
||||
params.cost_subst = cost_subst;
|
||||
|
@ -133,7 +134,7 @@ test_exec(char *str, int cost_ins, int cost_del, int cost_subst,
|
|||
&& reobj.re_nsub <= elementsof(pmatch))
|
||||
{
|
||||
printf("Comp error, regex: \"%s\"\n", regex_pattern);
|
||||
printf(" re_nsub is %d, should be %d\n", reobj.re_nsub, i - 1);
|
||||
printf(" re_nsub is %d, should be %d\n", (int)reobj.re_nsub, i - 1);
|
||||
fail = 1;
|
||||
}
|
||||
|
||||
|
@ -187,6 +188,10 @@ test_comp(char *re, int flags, int ret)
|
|||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
test_comp("(Laurikari){~}", REG_EXTENDED, 0);
|
||||
test_exec("suyhEKaurikawipEksnkhpkns", 1, 1, 1, INT_MAX, 0, REG_OK,
|
||||
2, 5, 14, 5, 14, END);
|
||||
|
||||
test_comp("abc", REG_EXTENDED, 0);
|
||||
test_exec("xaxcxxxx", 1, 1, 1, 3, 0, REG_OK, 1, 1, 4, END);
|
||||
|
||||
|
@ -218,5 +223,5 @@ main(int argc, char **argv)
|
|||
test_comp("foobar", REG_EXTENDED, 0);
|
||||
test_exec("faobar\n", 1, 1, 1, 2, 0, REG_OK, 1, 0, 6, END);
|
||||
|
||||
return 0;
|
||||
return comp_errors || exec_errors;
|
||||
}
|
||||
|
|
95
extras/tre/tre.spec.in
Normal file
95
extras/tre/tre.spec.in
Normal file
|
@ -0,0 +1,95 @@
|
|||
Name: tre
|
||||
Version: @PACKAGE_VERSION@
|
||||
Release: 1
|
||||
License: GPL
|
||||
Group: System Environment/Libraries
|
||||
Source0: http://laurikari.net/tre/tre-@PACKAGE_VERSION@.tar.bz2
|
||||
Summary: POSIX compatible regexp library with approximate matching.
|
||||
Packager: Ville Laurikari <vl@iki.fi>
|
||||
URL: http://laurikari.net/tre/
|
||||
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}
|
||||
|
||||
Requires(post): /sbin/ldconfig
|
||||
Requires(postun): /sbin/ldconfig
|
||||
|
||||
%description
|
||||
TRE is a lightweight, robust, and efficient POSIX compatible regexp
|
||||
matching library with some exciting features such as approximate
|
||||
matching.
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
|
||||
%postun
|
||||
/sbin/ldconfig
|
||||
|
||||
%package devel
|
||||
Requires: tre = @PACKAGE_VERSION@
|
||||
Summary: Development files for use with the tre package.
|
||||
Group: Development/Libraries
|
||||
|
||||
%description devel
|
||||
This package contains header files and static libraries for use when
|
||||
building applications which use the TRE library.
|
||||
|
||||
|
||||
%package agrep
|
||||
Requires: tre >= @PACKAGE_VERSION@
|
||||
Summary: Approximate grep utility.
|
||||
Group: Applications/Text
|
||||
|
||||
%description agrep
|
||||
The agrep tool is similar to the commonly used grep utility, but agrep
|
||||
can be used to search for approximate matches.
|
||||
|
||||
The agrep tool searches text input for lines (or records separated by
|
||||
strings matching arbitrary regexps) that contain an approximate, or
|
||||
fuzzy, match to a specified regexp, and prints the matching lines.
|
||||
Limits can be set on how many errors of each kind are allowed, or
|
||||
only the best matching lines can be output.
|
||||
|
||||
Unlike other agrep implementations, TRE agrep allows full POSIX
|
||||
regexps of any length, any number of errors, and non-uniform costs.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
|
||||
%build
|
||||
./configure --prefix=/usr
|
||||
make
|
||||
|
||||
%install
|
||||
|
||||
make install DESTDIR=$RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%clean
|
||||
rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr (-, root, root)
|
||||
%{_datadir}/*
|
||||
%{_libdir}/libtre.so.*.*
|
||||
|
||||
%files devel
|
||||
%defattr (-, root, root)
|
||||
%{_libdir}/libtre.a
|
||||
%{_libdir}/libtre.la
|
||||
%{_libdir}/libtre.so
|
||||
%{_libdir}/pkgconfig/*
|
||||
%{_includedir}/*
|
||||
|
||||
%files agrep
|
||||
%defattr (-, root, root)
|
||||
%{_bindir}/agrep
|
||||
|
||||
%changelog
|
||||
* Mon Dec 22 2003 Ville Laurikari <vl@iki.fi>
|
||||
- added %post/%postun ldconfig scriplets.
|
||||
|
||||
* Fri Oct 03 2003 Ville Laurikari <vl@iki.fi>
|
||||
- included in the TRE source tree as `tre.spec.in'.
|
||||
|
||||
* Tue Sep 30 2003 Matthew Berg <mberg@synacor.com>
|
||||
- tagged release 1
|
||||
- initial build
|
|
@ -1 +1 @@
|
|||
EXTRA_DIST = autogen.sh
|
||||
EXTRA_DIST = autogen.sh build-rpm.sh
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Makefile.in generated by automake 1.7.3 from Makefile.am.
|
||||
# Makefile.in generated by automake 1.7.8 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
|
||||
|
@ -41,6 +41,7 @@ ALLOCA = @ALLOCA@
|
|||
AMDEP_FALSE = @AMDEP_FALSE@
|
||||
AMDEP_TRUE = @AMDEP_TRUE@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
|
@ -50,6 +51,10 @@ CCDEPMODE = @CCDEPMODE@
|
|||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
|
@ -59,6 +64,8 @@ ECHO_N = @ECHO_N@
|
|||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
GMSGFMT = @GMSGFMT@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
|
@ -100,14 +107,20 @@ TRE_DEBUG_FALSE = @TRE_DEBUG_FALSE@
|
|||
TRE_DEBUG_TRUE = @TRE_DEBUG_TRUE@
|
||||
TRE_PROFILE_FALSE = @TRE_PROFILE_FALSE@
|
||||
TRE_PROFILE_TRUE = @TRE_PROFILE_TRUE@
|
||||
TRE_VERSION = @TRE_VERSION@
|
||||
USE_NLS = @USE_NLS@
|
||||
VERSION = @VERSION@
|
||||
XGETTEXT = @XGETTEXT@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_RANLIB = @ac_ct_RANLIB@
|
||||
ac_ct_STRIP = @ac_ct_STRIP@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
|
@ -142,15 +155,17 @@ target_alias = @target_alias@
|
|||
target_cpu = @target_cpu@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
EXTRA_DIST = autogen.sh
|
||||
EXTRA_DIST = autogen.sh build-rpm.sh
|
||||
subdir = utils
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/utils/mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h \
|
||||
$(top_builddir)/lib/tre-config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_SOURCES =
|
||||
DIST_COMMON = Makefile.am Makefile.in compile config.guess config.rpath \
|
||||
config.sub depcomp install-sh ltmain.sh missing mkinstalldirs
|
||||
DIST_COMMON = $(srcdir)/Makefile.in Makefile.am compile config.guess \
|
||||
config.rpath config.sub depcomp install-sh ltmain.sh missing \
|
||||
mkinstalldirs
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
@ -212,7 +227,6 @@ check: check-am
|
|||
all-am: Makefile
|
||||
|
||||
installdirs:
|
||||
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
|
@ -232,7 +246,7 @@ mostlyclean-generic:
|
|||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f $(CONFIG_CLEAN_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
|
@ -242,7 +256,7 @@ clean: clean-am
|
|||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-libtool
|
||||
|
||||
dvi: dvi-am
|
||||
|
@ -264,7 +278,7 @@ install-man:
|
|||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
set -e
|
||||
|
||||
libtoolize --automake
|
||||
autoheader
|
||||
aclocal -I m4
|
||||
automake --add-missing
|
||||
|
|
31
extras/tre/utils/build-rpm.sh
Executable file
31
extras/tre/utils/build-rpm.sh
Executable file
|
@ -0,0 +1,31 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# Helper script to build the RPM packages. Just run this from the root
|
||||
# of an unconfigured source tree:
|
||||
# $ ./utils/build-rpm.sh
|
||||
#
|
||||
|
||||
|
||||
# Create the RPM build environment.
|
||||
rm -rf rpm/dist
|
||||
for dir in rpm rpm/RPMS rpm/SRPMS rpm/BUILD rpm/SOURCES rpm/dist; do
|
||||
if test ! -d $dir; then
|
||||
mkdir $dir
|
||||
fi
|
||||
done
|
||||
|
||||
# Create the source distribution tarball.
|
||||
cd rpm/dist
|
||||
../../configure
|
||||
make dist
|
||||
gunzip tre-*.tar.gz
|
||||
bzip2 tre-*.tar
|
||||
mv tre-*.tar.bz2 ../SOURCES
|
||||
cd ..
|
||||
|
||||
# Build the packages.
|
||||
rm -f RPMS/*/*.rpm SRPMS/*.rpm
|
||||
rpmbuild --define "_topdir `pwd`" dist/tre.spec -ba
|
||||
cp RPMS/*/*.rpm SRPMS/*.rpm ..
|
||||
cd ..
|
||||
ls -l *.rpm
|
5
extras/tre/utils/config.guess
vendored
5
extras/tre/utils/config.guess
vendored
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2003-01-30'
|
||||
timestamp='2003-02-22'
|
||||
|
||||
# This file is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU General Public License as published by
|
||||
|
@ -235,9 +235,6 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
|||
*:OpenBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:MicroBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-microbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
alpha:OSF1:*:*)
|
||||
if test $UNAME_RELEASE = "V4.0"; then
|
||||
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# Output a system dependent set of variables, describing how to set the
|
||||
# run time search path of shared libraries in an executable.
|
||||
#
|
||||
# Copyright 1996-2002 Free Software Foundation, Inc.
|
||||
# Copyright 1996-2003 Free Software Foundation, Inc.
|
||||
# Taken from GNU libtool, 2001
|
||||
# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
|
||||
#
|
||||
|
@ -34,43 +34,57 @@
|
|||
#
|
||||
# The set of defined variables is at the end of this script.
|
||||
|
||||
# Known limitations:
|
||||
# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
|
||||
# than 256 bytes, otherwise the compiler driver will dump core. The only
|
||||
# known workaround is to choose shorter directory names for the build
|
||||
# directory and/or the installation directory.
|
||||
|
||||
# All known linkers require a `.a' archive for static linking (except M$VC,
|
||||
# which needs '.lib').
|
||||
libext=a
|
||||
shlibext=
|
||||
shrext=.so
|
||||
|
||||
host="$1"
|
||||
host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
|
||||
host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
|
||||
host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
|
||||
|
||||
wl=
|
||||
if test "$GCC" = yes; then
|
||||
wl='-Wl,'
|
||||
else
|
||||
case "$host_os" in
|
||||
aix3* | aix4* | aix5*)
|
||||
aix*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
mingw* | pw32* | os2*)
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
irix5* | irix6*)
|
||||
irix5* | irix6* | nonstopux*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
newsos6)
|
||||
;;
|
||||
linux*)
|
||||
echo '__INTEL_COMPILER' > conftest.$ac_ext
|
||||
if $CC -E conftest.$ac_ext >/dev/null | grep __INTEL_COMPILER >/dev/null
|
||||
then
|
||||
:
|
||||
else
|
||||
# Intel icc
|
||||
wl='-Qoption,ld,'
|
||||
fi
|
||||
case $CC in
|
||||
icc|ecc)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
ccc)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sco3.2v5*)
|
||||
;;
|
||||
solaris*)
|
||||
wl='-Wl,'
|
||||
;;
|
||||
|
@ -78,15 +92,17 @@ else
|
|||
wl='-Qoption ld '
|
||||
;;
|
||||
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
|
||||
if test "x$host_vendor" = xsni; then
|
||||
wl='-LD'
|
||||
else
|
||||
wl='-Wl,'
|
||||
fi
|
||||
wl='-Wl,'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
;;
|
||||
uts4*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
|
||||
|
||||
hardcode_libdir_flag_spec=
|
||||
hardcode_libdir_separator=
|
||||
hardcode_direct=no
|
||||
|
@ -110,8 +126,10 @@ ld_shlibs=yes
|
|||
if test "$with_gnu_ld" = yes; then
|
||||
case "$host_os" in
|
||||
aix3* | aix4* | aix5*)
|
||||
# On AIX, the GNU linker is very broken
|
||||
ld_shlibs=no
|
||||
# On AIX/PPC, the GNU linker is very broken
|
||||
if test "$host_cpu" != ia64; then
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
amigaos*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
|
@ -135,6 +153,13 @@ if test "$with_gnu_ld" = yes; then
|
|||
# hardcode_libdir_flag_spec is actually meaningless, as there is
|
||||
# no search path for DLLs.
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
|
||||
:
|
||||
else
|
||||
ld_shlibs=no
|
||||
fi
|
||||
;;
|
||||
netbsd*)
|
||||
;;
|
||||
solaris* | sysv5*)
|
||||
if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
|
||||
|
@ -157,6 +182,8 @@ if test "$with_gnu_ld" = yes; then
|
|||
;;
|
||||
esac
|
||||
if test "$ld_shlibs" = yes; then
|
||||
# Unlike libtool, we use -rpath here, not --rpath, since the documented
|
||||
# option of GNU ld is called -rpath, not --rpath.
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
fi
|
||||
else
|
||||
|
@ -209,13 +236,27 @@ else
|
|||
fi
|
||||
esac
|
||||
fi
|
||||
# Begin _LT_AC_SYS_LIBPATH_AIX.
|
||||
echo 'int main () { return 0; }' > conftest.c
|
||||
${CC} ${LDFLAGS} conftest.c -o conftest
|
||||
aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||
}'`
|
||||
if test -z "$aix_libpath"; then
|
||||
aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
|
||||
}'`
|
||||
fi
|
||||
if test -z "$aix_libpath"; then
|
||||
aix_libpath="/usr/lib:/lib"
|
||||
fi
|
||||
rm -f conftest.c conftest
|
||||
# End _LT_AC_SYS_LIBPATH_AIX.
|
||||
if test "$aix_use_runtimelinking" = yes; then
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||
else
|
||||
if test "$host_cpu" = ia64; then
|
||||
hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
|
||||
else
|
||||
hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib'
|
||||
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
@ -225,6 +266,8 @@ else
|
|||
# see comment about different semantics on the GNU ld section
|
||||
ld_shlibs=no
|
||||
;;
|
||||
bsdi4*)
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
# When not using gcc, we currently assume that we are using
|
||||
# Microsoft Visual C++.
|
||||
|
@ -234,7 +277,12 @@ else
|
|||
libext=lib
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
hardcode_direct=yes
|
||||
if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
|
||||
hardcode_direct=no
|
||||
fi
|
||||
;;
|
||||
dgux*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
freebsd1*)
|
||||
ld_shlibs=no
|
||||
|
@ -251,14 +299,41 @@ else
|
|||
hardcode_libdir_flag_spec='-R$libdir'
|
||||
hardcode_direct=yes
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
hpux9*)
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
hardcode_minus_L=yes # Not in the search PATH, but as the default
|
||||
# location of the library.
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
irix5* | irix6*)
|
||||
hpux10* | hpux11*)
|
||||
if test "$with_gnu_ld" = no; then
|
||||
case "$host_cpu" in
|
||||
hppa*64*)
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=no
|
||||
;;
|
||||
ia64*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
hardcode_direct=no
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
*)
|
||||
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
hardcode_direct=yes
|
||||
# hardcode_minus_L: Not really in the search PATH,
|
||||
# but as the default location of the library.
|
||||
hardcode_minus_L=yes
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
;;
|
||||
irix5* | irix6* | nonstopux*)
|
||||
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
|
||||
hardcode_libdir_separator=:
|
||||
;;
|
||||
|
@ -314,23 +389,20 @@ else
|
|||
hardcode_minus_L=yes
|
||||
;;
|
||||
sysv4)
|
||||
if test "x$host_vendor" = xsno; then
|
||||
hardcode_direct=yes # is this really true???
|
||||
else
|
||||
hardcode_direct=no # Motorola manual says yes, but my tests say they lie
|
||||
fi
|
||||
case $host_vendor in
|
||||
sni)
|
||||
hardcode_direct=yes # is this really true???
|
||||
;;
|
||||
siemens)
|
||||
hardcode_direct=no
|
||||
;;
|
||||
motorola)
|
||||
hardcode_direct=no #Motorola manual says yes, but my tests say they lie
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
sysv4.3*)
|
||||
;;
|
||||
sysv5*)
|
||||
hardcode_libdir_flag_spec=
|
||||
;;
|
||||
uts4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
dgux*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
sysv4*MP*)
|
||||
if test -d /usr/nec; then
|
||||
ld_shlibs=yes
|
||||
|
@ -340,7 +412,13 @@ else
|
|||
hardcode_direct=yes
|
||||
hardcode_minus_L=no
|
||||
;;
|
||||
sysv5uw7* | unixware7*)
|
||||
sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
|
||||
;;
|
||||
sysv5*)
|
||||
hardcode_libdir_flag_spec=
|
||||
;;
|
||||
uts4*)
|
||||
hardcode_libdir_flag_spec='-L$libdir'
|
||||
;;
|
||||
*)
|
||||
ld_shlibs=no
|
||||
|
@ -349,134 +427,97 @@ else
|
|||
fi
|
||||
|
||||
# Check dynamic linker characteristics
|
||||
# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
|
||||
libname_spec='lib$name'
|
||||
sys_lib_dlsearch_path_spec="/lib /usr/lib"
|
||||
sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
|
||||
case "$host_os" in
|
||||
aix3*)
|
||||
shlibext=so
|
||||
;;
|
||||
aix4* | aix5*)
|
||||
shlibext=so
|
||||
;;
|
||||
amigaos*)
|
||||
shlibext=ixlibrary
|
||||
;;
|
||||
beos*)
|
||||
shlibext=so
|
||||
;;
|
||||
bsdi4*)
|
||||
shlibext=so
|
||||
sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
|
||||
sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
|
||||
;;
|
||||
cygwin* | mingw* | pw32*)
|
||||
case $GCC,$host_os in
|
||||
yes,cygwin*)
|
||||
shlibext=dll.a
|
||||
;;
|
||||
yes,mingw*)
|
||||
shlibext=dll
|
||||
sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"`
|
||||
;;
|
||||
yes,pw32*)
|
||||
shlibext=dll
|
||||
;;
|
||||
*)
|
||||
shlibext=dll
|
||||
;;
|
||||
esac
|
||||
shrext=.dll
|
||||
;;
|
||||
darwin* | rhapsody*)
|
||||
shlibext=dylib
|
||||
shrext=.dylib
|
||||
;;
|
||||
dgux*)
|
||||
;;
|
||||
freebsd1*)
|
||||
;;
|
||||
freebsd*)
|
||||
shlibext=so
|
||||
;;
|
||||
gnu*)
|
||||
shlibext=so
|
||||
;;
|
||||
hpux9* | hpux10* | hpux11*)
|
||||
shlibext=sl
|
||||
case "$host_cpu" in
|
||||
ia64*)
|
||||
shrext=.so
|
||||
;;
|
||||
hppa*64*)
|
||||
shrext=.sl
|
||||
;;
|
||||
*)
|
||||
shrext=.sl
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
irix5* | irix6*)
|
||||
shlibext=so
|
||||
irix5* | irix6* | nonstopux*)
|
||||
case "$host_os" in
|
||||
irix5*)
|
||||
irix5* | nonstopux*)
|
||||
libsuff= shlibsuff=
|
||||
;;
|
||||
*)
|
||||
case $LD in
|
||||
*-32|*"-32 ") libsuff= shlibsuff= ;;
|
||||
*-n32|*"-n32 ") libsuff=32 shlibsuff=N32 ;;
|
||||
*-64|*"-64 ") libsuff=64 shlibsuff=64 ;;
|
||||
*-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
|
||||
*-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
|
||||
*-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
|
||||
*) libsuff= shlibsuff= ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
|
||||
sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
|
||||
;;
|
||||
linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
|
||||
linux*oldld* | linux*aout* | linux*coff*)
|
||||
;;
|
||||
linux-gnu*)
|
||||
shlibext=so
|
||||
linux*)
|
||||
;;
|
||||
netbsd*)
|
||||
shlibext=so
|
||||
;;
|
||||
newsos6)
|
||||
shlibext=so
|
||||
;;
|
||||
nto-qnx)
|
||||
;;
|
||||
openbsd*)
|
||||
shlibext=so
|
||||
;;
|
||||
os2*)
|
||||
libname_spec='$name'
|
||||
shlibext=dll
|
||||
shrext=.dll
|
||||
;;
|
||||
osf3* | osf4* | osf5*)
|
||||
shlibext=so
|
||||
sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
|
||||
sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
|
||||
;;
|
||||
sco3.2v5*)
|
||||
shlibext=so
|
||||
;;
|
||||
solaris*)
|
||||
shlibext=so
|
||||
;;
|
||||
sunos4*)
|
||||
shlibext=so
|
||||
;;
|
||||
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
|
||||
shlibext=so
|
||||
case "$host_vendor" in
|
||||
motorola)
|
||||
sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
uts4*)
|
||||
shlibext=so
|
||||
;;
|
||||
dgux*)
|
||||
shlibext=so
|
||||
;;
|
||||
sysv4*MP*)
|
||||
if test -d /usr/nec; then
|
||||
shlibext=so
|
||||
fi
|
||||
;;
|
||||
uts4*)
|
||||
;;
|
||||
esac
|
||||
|
||||
sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
|
||||
escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
|
||||
escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_sys_lib_search_path_spec=`echo "X$sys_lib_search_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
escaped_sys_lib_dlsearch_path_spec=`echo "X$sys_lib_dlsearch_path_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
|
||||
|
||||
sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
|
||||
|
||||
|
@ -504,10 +545,4 @@ hardcode_direct="$hardcode_direct"
|
|||
# resulting binary.
|
||||
hardcode_minus_L="$hardcode_minus_L"
|
||||
|
||||
# Compile-time system search path for libraries
|
||||
sys_lib_search_path_spec="$escaped_sys_lib_search_path_spec"
|
||||
|
||||
# Run-time system search path for libraries
|
||||
sys_lib_dlsearch_path_spec="$escaped_sys_lib_dlsearch_path_spec"
|
||||
|
||||
EOF
|
||||
|
|
4
extras/tre/utils/config.sub
vendored
4
extras/tre/utils/config.sub
vendored
|
@ -3,7 +3,7 @@
|
|||
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
|
||||
timestamp='2003-02-03'
|
||||
timestamp='2003-02-22'
|
||||
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
|
@ -1128,7 +1128,7 @@ case $os in
|
|||
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
|
||||
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
|
||||
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
|
||||
| -powermax* | -dnix* | -microbsd*)
|
||||
| -powermax* | -dnix*)
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-qnx*)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#! /bin/sh
|
||||
|
||||
# depcomp - compile a program generating dependencies as side-effects
|
||||
# Copyright 1999, 2000 Free Software Foundation, Inc.
|
||||
# Copyright 1999, 2000, 2003 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -172,19 +172,25 @@ sgi)
|
|||
|
||||
aix)
|
||||
# The C for AIX Compiler uses -M and outputs the dependencies
|
||||
# in a .u file. This file always lives in the current directory.
|
||||
# Also, the AIX compiler puts `$object:' at the start of each line;
|
||||
# $object doesn't have directory information.
|
||||
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
|
||||
# in a .u file. In older versions, this file always lives in the
|
||||
# current directory. Also, the AIX compiler puts `$object:' at the
|
||||
# start of each line; $object doesn't have directory information.
|
||||
# Version 6 uses the directory in both cases.
|
||||
stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'`
|
||||
tmpdepfile="$stripped.u"
|
||||
outname="$stripped.o"
|
||||
if test "$libtool" = yes; then
|
||||
"$@" -Wc,-M
|
||||
else
|
||||
"$@" -M
|
||||
fi
|
||||
|
||||
stat=$?
|
||||
|
||||
if test -f "$tmpdepfile"; then :
|
||||
else
|
||||
stripped=`echo "$stripped" | sed 's,^.*/,,'`
|
||||
tmpdepfile="$stripped.u"
|
||||
fi
|
||||
|
||||
if test $stat -eq 0; then :
|
||||
else
|
||||
rm -f "$tmpdepfile"
|
||||
|
@ -192,6 +198,7 @@ aix)
|
|||
fi
|
||||
|
||||
if test -f "$tmpdepfile"; then
|
||||
outname="$stripped.o"
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
|
@ -207,11 +214,9 @@ aix)
|
|||
;;
|
||||
|
||||
icc)
|
||||
# Must come before tru64.
|
||||
|
||||
# Intel's C compiler understands `-MD -MF file'. However
|
||||
# Intel's C compiler understands `-MD -MF file'. However on
|
||||
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
|
||||
# will fill foo.d with something like
|
||||
# ICC 7.0 will fill foo.d with something like
|
||||
# foo.o: sub/foo.c
|
||||
# foo.o: sub/foo.h
|
||||
# which is wrong. We want:
|
||||
|
@ -219,6 +224,12 @@ icc)
|
|||
# sub/foo.o: sub/foo.h
|
||||
# sub/foo.c:
|
||||
# sub/foo.h:
|
||||
# ICC 7.1 will output
|
||||
# foo.o: sub/foo.c sub/foo.h
|
||||
# and will wrap long lines using \ :
|
||||
# foo.o: sub/foo.c ... \
|
||||
# sub/foo.h ... \
|
||||
# ...
|
||||
|
||||
"$@" -MD -MF "$tmpdepfile"
|
||||
stat=$?
|
||||
|
@ -228,11 +239,15 @@ icc)
|
|||
exit $stat
|
||||
fi
|
||||
rm -f "$depfile"
|
||||
# Each line is of the form `foo.o: dependent.h'.
|
||||
# Each line is of the form `foo.o: dependent.h',
|
||||
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
|
||||
# Do two passes, one to just change these to
|
||||
# `$object: dependent.h' and one to simply `dependent.h:'.
|
||||
sed -e "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
sed -e "s,^[^:]*: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
|
||||
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
|
||||
# Some versions of the HPUX 10.20 sed can't process this invocation
|
||||
# correctly. Breaking it into two sed invocations is a workaround.
|
||||
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
|
||||
sed -e 's/$/ :/' >> "$depfile"
|
||||
rm -f "$tmpdepfile"
|
||||
;;
|
||||
|
||||
|
@ -270,8 +285,8 @@ tru64)
|
|||
fi
|
||||
if test -f "$tmpdepfile"; then
|
||||
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
|
||||
# That's a space and a tab in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
# That's a tab and a space in the [].
|
||||
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
|
||||
else
|
||||
echo "#dummy" > "$depfile"
|
||||
fi
|
||||
|
@ -284,7 +299,7 @@ tru64)
|
|||
|
||||
dashmstdout)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the proprocessed file to stdout, regardless of -o.
|
||||
# always write the preprocessed file to stdout, regardless of -o.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
|
@ -380,7 +395,7 @@ makedepend)
|
|||
|
||||
cpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the proprocessed file to stdout.
|
||||
# always write the preprocessed file to stdout.
|
||||
"$@" || exit $?
|
||||
|
||||
# Remove the call to Libtool.
|
||||
|
@ -422,7 +437,7 @@ cpp)
|
|||
|
||||
msvisualcpp)
|
||||
# Important note: in order to support this mode, a compiler *must*
|
||||
# always write the proprocessed file to stdout, regardless of -o,
|
||||
# always write the preprocessed file to stdout, regardless of -o,
|
||||
# because we must use -o when running libtool.
|
||||
"$@" || exit $?
|
||||
IFS=" "
|
||||
|
|
|
@ -1,19 +1,37 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# install - install a program, script, or datafile
|
||||
# This comes from X11R5 (mit/util/scripts/install.sh).
|
||||
#
|
||||
# Copyright 1991 by the Massachusetts Institute of Technology
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and its
|
||||
# documentation for any purpose is hereby granted without fee, provided that
|
||||
# the above copyright notice appear in all copies and that both that
|
||||
# copyright notice and this permission notice appear in supporting
|
||||
# documentation, and that the name of M.I.T. not be used in advertising or
|
||||
# publicity pertaining to distribution of the software without specific,
|
||||
# written prior permission. M.I.T. makes no representations about the
|
||||
# suitability of this software for any purpose. It is provided "as is"
|
||||
# without express or implied warranty.
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
|
@ -221,8 +239,8 @@ else
|
|||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
|
||||
dsttmp=$dstdir/#inst.$$#
|
||||
rmtmp=$dstdir/#rm.$$#
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up temp files at exit.
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,6 +1,6 @@
|
|||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
|
||||
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
|
@ -165,7 +165,7 @@ WARNING: \`$1' is missing on your system. You should only need it if
|
|||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||
system. You might have modified some files without having the
|
||||
proper tools for further handling them.
|
||||
You can get \`$1Help2man' as part of \`Autoconf' from any GNU
|
||||
You can get \`$1' as part of \`Autoconf' from any GNU
|
||||
archive site."
|
||||
|
||||
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
|
||||
|
@ -326,7 +326,7 @@ WARNING: I can't seem to be able to run \`tar' with the given arguments.
|
|||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||
system. You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequirements for installing
|
||||
it often tells you about the needed prerequisites for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue