summaryrefslogtreecommitdiffstats
path: root/generic/regfree.c
diff options
context:
space:
mode:
authorstanton <stanton@noemail.net>1999-04-16 00:46:29 (GMT)
committerstanton <stanton@noemail.net>1999-04-16 00:46:29 (GMT)
commit98569293dc21e22480004e4e3f2ce85ec0bfd80f (patch)
treece9959f2747257d98d52ec8d18bf3b0de99b9535 /generic/regfree.c
parent6a4a1d8213f4de5bce0eaafa8f4d86117022bf1a (diff)
downloadtcl-98569293dc21e22480004e4e3f2ce85ec0bfd80f.zip
tcl-98569293dc21e22480004e4e3f2ce85ec0bfd80f.tar.gz
tcl-98569293dc21e22480004e4e3f2ce85ec0bfd80f.tar.bz2
merged tcl 8.1 branch back into the main trunk
FossilOrigin-Name: f3b32fb71c9011ac220779bd9dbe5617c9dc87d9
Diffstat (limited to 'generic/regfree.c')
-rw-r--r--generic/regfree.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/generic/regfree.c b/generic/regfree.c
new file mode 100644
index 0000000..a5c3f0b
--- /dev/null
+++ b/generic/regfree.c
@@ -0,0 +1,25 @@
+/*
+ * regfree - free an RE
+ *
+ * You might think that this could be incorporated into regcomp.c, and
+ * that would be a reasonable idea... except that this is a generic
+ * function (with a generic name), applicable to all compiled REs
+ * regardless of the size of their characters, whereas the stuff in
+ * regcomp.c gets compiled once per character size.
+ */
+
+#include "regguts.h"
+
+/*
+ - regfree - free an RE (generic function, punts to RE-specific function)
+ *
+ * Ignoring invocation with NULL is a convenience.
+ */
+VOID
+regfree(re)
+regex_t *re;
+{
+ if (re == NULL)
+ return;
+ (*((struct fns *)re->re_fns)->free)(re);
+}