From 888eaffd36ff841a0b7c562de67e498336270ce7 Mon Sep 17 00:00:00 2001 From: Gary Houston Date: Fri, 26 Dec 2014 16:19:46 +1100 Subject: import --- README | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 README (limited to 'README') diff --git a/README b/README new file mode 100644 index 0000000..7a823b9 --- /dev/null +++ b/README @@ -0,0 +1,55 @@ + +This is a port to make standalone available the Henry Spencer's Regex Library +from Tcl 8.6a2. + +In the hope that the Tcl developers take this port as the base for their RE +module, great effort was paid to not update the *.c files, sadly it was not +possible. Some *.h files suffered dirty updates for the same reasons. + +To build and test + make + ./regtest_hsrex.sh + +To rebuild + make clean + make + +To build against the other library uncomment the proper line in the file +regtest_hsrex.sh and execute again. + # Either this one + $CC -I. -I$H/inc -L. -lhsrex -o $rgbin $rgsrc + # or this one + #$CC -I. -I$H/inc -L. -lhswrex -DREGEX_WCHAR -o $rgbin $rgsrc + +You would like to test with debuging information. Uncomment the proper line in +the Makefile and rebuild. + # Either this one + #CFLAGS = -DREGEX_STANDALONE -fPIC -DREG_DEBUG -g + # Or this one + CFLAGS = -DREGEX_STANDALONE -fPIC -D_NDEBUG -O3 + +Two libraries are provided, libhsrex.so and libhswrex.so. The first one is for +ascii character code and the second one for wide characters. Both libraries +were tested in Linux and Solaris. Compiling and runing in Window$ should be +easy. + +The following entry point where defined in each library: +re_comp() (re_wcomp() for wide char) to compile a RE +re_exec() (re_wexec() for wide char) to parse data against a compiled RE. +regfree() To dispose the memory of a compiled RE. +regerror() Translates error codes to ascii strings. + +It is pretty easy to add support for a regcomp() regexec() front end. That +front end functions should take care of UTF-8 to wide charater conversion, for +instance. + +The regression test script regtest_hsrex.sh contains an example of how to use +the libraries. It just test cases I was interested on. Adding more use cases to +that script should be easy. + +Send any comments to Walter Waldo + +Enjoy it, + +Walter Waldo. + -- cgit v1.2.3