summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eshld/eshrt.esh22
1 files changed, 22 insertions, 0 deletions
diff --git a/eshld/eshrt.esh b/eshld/eshrt.esh
index 7e03ef2..bcc69b4 100644
--- a/eshld/eshrt.esh
+++ b/eshld/eshrt.esh
@@ -35,6 +35,8 @@ __prev_tu=''
__prev_vars=''
__var=''
__val=''
+__fn_begin_hooks=''
+__fn_end_hooks=''
__init_funcs=''
__fn_stack_push()
@@ -123,6 +125,11 @@ __fn_update_vars()
__fn_start()
{
+ # Hooks.
+ for __fn in ${__fn_begin_hooks}; do
+ ${__fn} ${2}
+ done
+
# Old state.
__prev_tu="${__fn_tu}"
__prev_vars="${__fn_vars}"
@@ -148,6 +155,11 @@ __fn_start()
__fn_end()
{
+ # Hooks.
+ for __fn in ${__fn_end_hooks}; do
+ ${__fn} ${__fn_name}
+ done
+
# Old state.
__fn_stack_pop
__fn_frame_decode
@@ -233,6 +245,16 @@ static()
done
}
+__fn_begin_hook()
+{
+ __fn_begin_hooks="${__fn_begin_hooks} ${1}"
+}
+
+__fn_end_hook()
+{
+ __fn_end_hooks="${__fn_end_hooks} ${1}"
+}
+
__init()
{
__init_funcs="${__init_funcs} ${1}"