diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-12-14 12:57:23 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2014-12-14 12:57:23 +0100 |
commit | 27195517c5bfdbc8821bfd3c957b6c35d6c13544 (patch) | |
tree | 1637434994d8d32ac4c13729ff756be80c279b10 /regcomp.c | |
parent | 271484c6837d9f5a36501dfb98494ae6eaae43aa (diff) | |
parent | 766e109fd638ef1eac33717b52e04a351da46483 (diff) |
Merge tag 'upstream/5.9.6'
Upstream version 5.9.6
Diffstat (limited to 'regcomp.c')
-rw-r--r-- | regcomp.c | 35 |
1 files changed, 34 insertions, 1 deletions
@@ -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 |