From 48beacf6e4438f457b33fddebaa8a81698dc77f8 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Thu, 20 Dec 2001 02:55:11 +0000 Subject: * Makefile.in (VPATH): Add regex directory. (NM): new variable. (OBSOLETE_FUNCTIONS): Ditto. (NEW_FUNCTIONS): Ditto. (install-headers): Install regex.h. (install-man): New target. (install): Use new target. (DLL_OFILES): Add v8_reg* stuff. (new-cygwin1.dll): Eliminate stamp-cygwin-lib creation. (libcygwin.a): Remove obsolete functions from import lib. Add new functions. * configure.in: Detect 'nm' tool. * configure: Regenerate. * cygwin.din: Export posix_reg* functions. Eliminate export of v8 reg* functions. This is now handled in object files themselves. * regex/*: New files. * regexp/v8_*.c: New files, renamed from non v8_ equivalents. --- winsup/cygwin/regex/regfree.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 winsup/cygwin/regex/regfree.c (limited to 'winsup/cygwin/regex/regfree.c') diff --git a/winsup/cygwin/regex/regfree.c b/winsup/cygwin/regex/regfree.c new file mode 100644 index 000000000..b8be143d8 --- /dev/null +++ b/winsup/cygwin/regex/regfree.c @@ -0,0 +1,38 @@ +#include "winsup.h" +#include +#include +#include +#include "regex.h" + +#include "utils.h" +#include "regex2.h" + +/* + - regfree - free everything + = extern void regfree(regex_t *); + */ +void +regfree(preg) +regex_t *preg; +{ + register struct re_guts *g; + + if (preg->re_magic != MAGIC1) /* oops */ + return; /* nice to complain, but hard */ + + g = preg->re_g; + if (g == NULL || g->magic != MAGIC2) /* oops again */ + return; + preg->re_magic = 0; /* mark it invalid */ + g->magic = 0; /* mark it invalid */ + + if (g->strip != NULL) + free((char *)g->strip); + if (g->sets != NULL) + free((char *)g->sets); + if (g->setbits != NULL) + free((char *)g->setbits); + if (g->must != NULL) + free(g->must); + free((char *)g); +} -- cgit v1.2.3