pike.git/
src/
builtin_functions.c
Branch:
Tag:
Non-build tags
All tags
No tags
2006-01-26
2006-01-26 21:12:43 by Henrik Grubbström (Grubba) <grubba@grubba.org>
5671cee027d1bc08f0e486eb5bde08990138e115 (
59
lines) (+
57
/-
2
)
[
Show
|
Annotate
]
Branch:
7.9
Added get_active_{compilation,error}_handler().
Rev: src/builtin_functions.c:1.604
2:
|| This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id: builtin_functions.c,v 1.
603
2006/01/
20
17
:
51
:
52
grubba Exp $
+
|| $Id: builtin_functions.c,v 1.
604
2006/01/
26
21
:
12
:
43
grubba Exp $
*/ #include "global.h"
2231:
ref_push_mapping(get_builtin_constants()); }
+
/*! @decl object get_active_compilation_handler()
+
*!
+
*! Returns the currently active compilation compatibility handler, or
+
*! @tt{0@} (zero) if none is active.
+
*!
+
*! @note
+
*! This function should only be used during a call of @[compile()].
+
*!
+
*! @seealso
+
*! @[get_active_error_handler()], @[compile()],
+
*! @[master()->get_compilation_handler()]
+
*/
+
PMOD_EXPORT void f_get_active_compilation_handler(INT32 args)
+
{
+
pop_n_elems(args);
+
if (compat_handler) {
+
ref_push_object(compat_handler);
+
} else {
+
push_int(0);
+
}
+
}
+
+
/*! @decl object get_active_error_handler()
+
*!
+
*! Returns the currently active compilation error handler
+
*! (argument 4 to @[compile()]), or @tt{0@} (zero) if none
+
*! is active.
+
*!
+
*! @note
+
*! This function should only be used during a call of @[compile()].
+
*!
+
*! @seealso
+
*! @[get_active_compilation_handler()], @[compile()]
+
*/
+
PMOD_EXPORT void f_get_active_error_handler(INT32 args)
+
{
+
pop_n_elems(args);
+
if (error_handler) {
+
ref_push_object(error_handler);
+
} else {
+
push_int(0);
+
}
+
}
+
/*! @decl array allocate(int size) *! @decl array allocate(int size, mixed init) *!
8436:
ADD_EFUN("all_constants",f_all_constants, tFunc(tNone,tMap(tStr,tMix)),OPT_EXTERNAL_DEPEND);
+
/* function(:object) */
+
ADD_EFUN("get_active_compilation_handler",
+
f_get_active_compilation_handler,
+
tFunc(tNone, tObj), OPT_EXTERNAL_DEPEND);
+
+
/* function(:object) */
+
ADD_EFUN("get_active_error_handler",
+
f_get_active_error_handler,
+
tFunc(tNone, tObj), OPT_EXTERNAL_DEPEND);
+
/* function(int,void|0=mixed:array(0)) */ ADD_EFUN("allocate", f_allocate, tFunc(tInt tOr(tVoid,tSetvar(0,tMix)),tArr(tVar(0))), 0);