Download here. New in this release:
- Added tre_ prefix to all functions exported from libtre. This changes the binary interface (ABI). The old source interface (API) is still available in
<tre/regex.h>. New code should use<tre/tre.h>which exports functions that have the prefix. - Visual C++ 6 project files replaced with Visual Studio 2008 files.
- Bug fixes.
{ 8 comments… read them below or add one }
Thanks for the work but what are actually included in the tarballs are Visual C++ 6 files.
Oh, drats. I forgot to update something and the old files still got into the packages. Thanks for letting me know!
I’ve now fixed this for the next release. Until then, you can download the project (.vcproj) and solution (.sln) files for Visual Studio 2008 from the darcs repository here.
TRE is mentioned on Wikipedia, but the reference to LGPL is outdated now.
http://en.wikipedia.org/wiki/Agrep
Indeed. I went and updated the agrep page regarding TRE license.
Checked out the sources with command ‘darcs get –set-scripts-executable http://laurikari.net/tre/darcs/stable/‘ as described on the download page, but I still can’t find Visual Studio 2008 files there.
Downloading the files from the darcs web interface by clicking on the ‘plain’ link doesn’t work either. What I actually got were HTML-decorated text (< garbled with <\;) rather than plain text.
Downloading from the browser's view-source page doesn't work either. This time the server refuses to send data to the browser.
Sorry about that, and sorry for the delay (your comment got caught in the spam filter). Now the darcs repo is properly updated.
I have no problems downloading files from the web interface.
I am trying to translate the non-fuzzy part of TRE into D. I noticed this:
tre_ctype_t tre_ctype(const char *name)
{
int i;
for (i = 0; tre_ctype_map[i].name != NULL; i++)
{
if (strcmp(name, tre_ctype_map[i].name) == 0)
return tre_ctype_map[i].func;
}
return (tre_ctype_t)0;
}
It is prototyped as returning a character type, but if name is found, it returns a pointer to a function. The parsing code behaves as if it returned a character (I think). Could you possibly explain?
Thanks Steve
Steve, you’ve run into a confusing hack of mine. Please accept my apologies.
In the normal case, tre_ctype() is just the same as the wctype() function from the C library. It returns a “character class” object. The counterpart of tre_ctype() is tre_isctype(), which takes a character and a character class object, and returns non-zero if the character is part of the character class. Normally tre_isctype() is the same as iswctype().
If the system does not have wctype() and iswctype(), TRE uses it’s own implementation. In this case, the character class object returned by tre_ctype() is actually a function which gets called by tre_isctype().
You can find the macros that control this in tre-internal.sh. Search for SYSTEM_WCTYPE.