summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2014-12-14 12:57:21 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2014-12-14 12:57:21 +0100
commit766e109fd638ef1eac33717b52e04a351da46483 (patch)
treec8bbecdc1d0d5d3e4bd89bcb28306597af9a1312 /regcomp.c
parent0dbf3761f6b98e5c16c9bfa0306ae5d3257d081f (diff)
Imported Upstream version 5.9.6upstream/5.9.6
Diffstat (limited to 'regcomp.c')
-rw-r--r--regcomp.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/regcomp.c b/regcomp.c
index 995e1d8..b93ca94 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -2,7 +2,7 @@
regcomp.c - Oniguruma (regular expression library)
**********************************************************************/
/*-
- * Copyright (c) 2002-2008 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
+ * Copyright (c) 2002-2013 K.Kosako <sndgk393 AT ybb DOT ne DOT jp>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -5575,11 +5575,44 @@ onig_init(void)
}
+static OnigEndCallListItemType* EndCallTop;
+
+extern void onig_add_end_call(void (*func)(void))
+{
+ OnigEndCallListItemType* item;
+
+ item = (OnigEndCallListItemType* )xmalloc(sizeof(*item));
+ if (item == 0) return ;
+
+ item->next = EndCallTop;
+ item->func = func;
+
+ EndCallTop = item;
+}
+
+static void
+exec_end_call_list(void)
+{
+ OnigEndCallListItemType* prev;
+ void (*func)(void);
+
+ while (EndCallTop != 0) {
+ func = EndCallTop->func;
+ (*func)();
+
+ prev = EndCallTop;
+ EndCallTop = EndCallTop->next;
+ xfree(prev);
+ }
+}
+
extern int
onig_end(void)
{
THREAD_ATOMIC_START;
+ exec_end_call_list();
+
#ifdef ONIG_DEBUG_STATISTICS
onig_print_statistics(stderr);
#endif