diff --git a/src/modules/call_out/call_out.c b/src/modules/call_out/call_out.c index 1bc9082a088438243c83baed92331a49790fbf7c..d0fb9cf09b89d4c29604a587f5e646d3f9171e3f 100644 --- a/src/modules/call_out/call_out.c +++ b/src/modules/call_out/call_out.c @@ -4,7 +4,7 @@ ||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h" -RCSID("$Id: call_out.c,v 1.8 1997/02/19 05:05:32 hubbe Exp $"); +RCSID("$Id: call_out.c,v 1.9 1997/04/12 09:52:45 per Exp $"); #include "array.h" #include "dynamic_buffer.h" #include "object.h" @@ -315,6 +315,15 @@ static int find_call_out(struct svalue *fun) return -1; } + +static void f_do_call_outs(INT32 args) +{ + GETTIMEOFDAY(¤t_time); + do_call_outs(0, 0, (void *)1); + do_call_outs(0, 0, (void *)0); + pop_n_elems(args); +} + void f_find_call_out(INT32 args) { int e; @@ -425,6 +434,8 @@ void pike_module_init(void) { add_efun("call_out",f_call_out,"function(function,float|int,mixed...:mixed)",OPT_SIDE_EFFECT); add_efun("call_out_info",f_call_out_info,"function(:array*)",OPT_EXTERNAL_DEPEND); + add_efun("_do_call_outs",f_do_call_outs,"function(void:void)", + OPT_EXTERNAL_DEPEND); add_efun("find_call_out",f_find_call_out,"function(mixed:int)",OPT_EXTERNAL_DEPEND); add_efun("remove_call_out",f_remove_call_out,"function(mixed:int)",OPT_SIDE_EFFECT); } diff --git a/src/modules/call_out/testsuite.in b/src/modules/call_out/testsuite.in index 6fa1711338dcbd9d482e4589260d84f3242e23ce..436827c3ccf77552533569db07f118eed5ea21a0 100644 --- a/src/modules/call_out/testsuite.in +++ b/src/modules/call_out/testsuite.in @@ -12,3 +12,4 @@ test_eq(find_call_out(a),-1) test_true(zero_type(find_call_out(a))) test_do(remove_call_out(call_out_info()[-1][2])) test_true(!sizeof(call_out_info()) || function_name(call_out_info()[-1][2])!="a") +test_do(_do_call_outs()) diff --git a/tutorial/tutorial.html b/tutorial/tutorial.html index 843c5fe0353a4a980220a76310d413e95f0faa9b..eb1b5036a7db025a0633ae9df34a64e757d064df 100644 --- a/tutorial/tutorial.html +++ b/tutorial/tutorial.html @@ -9707,6 +9707,29 @@ contains an array that looks like this: </dl> </a> +<HR NEWPAGE> +<a name=_do_call_outs> +<dl> +<dt><b> <font size=+1>N</font><font size=-1>AME</font></b><dd> + <tt>_do_call_outs</tt> - do all pending call_outs. + +<dt><b> <font size=+1>S</font><font size=-1>YNTAX</font></b><dd> + <tt>void _do_call_out();</tt> + +<dt><b> <font size=+1>D</font><font size=-1>ESCRIPTION</font></b><dd> +<dd> This function runs all pending call_outs that should have been + run if pike returned to the backend. It should not be used in + normal operation. +<p> + As a side-effect, this function sets the value returned by + <tt>time(1)</tt> to the current time. +<p> +<dt><b> <font size=+1>S</font><font size=-1>EE</font> <font size=+1>A</font><font size=-1>LSO</font></b><dd> +<a href=call_out_call_out>call_out</a>, <a href=call_out_find_call_out>find_call_out</a> and <a href=call_out_remove_call_out>remove_call_out</a> +<p> +</dl> +</a> + <HR NEWPAGE> <a name=catch> <dl>