pike.git/
src/
builtin_functions.c
Branch:
Tag:
Non-build tags
All tags
No tags
2000-05-17
2000-05-17 18:27:50 by Henrik Grubbström (Grubba) <grubba@grubba.org>
9aadf27c8cc47fee628c44fea93f19201847d2f7 (
17
lines) (+
7
/-
10
)
[
Show
|
Annotate
]
Branch:
7.9
_typeof() now returns a type and not a string.
Rev: src/builtin_functions.c:1.275
5:
\*/ /**/ #include "global.h"
-
RCSID("$Id: builtin_functions.c,v 1.
274
2000/05/
11
14
:
09
:
45
grubba Exp $");
+
RCSID("$Id: builtin_functions.c,v 1.
275
2000/05/
17
18
:
27
:
50
grubba Exp $");
#include "interpret.h" #include "svalue.h" #include "pike_macros.h"
4401:
void f__typeof(INT32 args) {
-
INT32 i;
-
struct pike_string *s
,*t
;
+
struct pike_string *s;
if(!args) SIMPLE_TOO_FEW_ARGS_ERROR("_typeof", 1);
-
low_init_threads_disable();
-
s=get_type_of_svalue(sp-args);
-
t=describe_type(s);
-
exit_threads_disable(NULL);
+
s
=
get_type_of_svalue(sp-args);
-
free_string(s);
+
pop_n_elems(args);
-
push_string(
t
);
+
push_string(
s
);
+
sp[-1].type = T_TYPE;
} void f_replace_master(INT32 args)
5730:
ADD_EFUN("_refs",f__refs,tFunc(tRef,tInt),OPT_EXTERNAL_DEPEND); ADD_EFUN("_leak",f__leak,tFunc(tRef,tInt),OPT_EXTERNAL_DEPEND);
-
ADD_EFUN("_typeof",f__typeof,tFunc(tMix,
tStr
),0);
+
ADD_EFUN("_typeof",f__typeof,tFunc(tMix,
tType
),0);
/* class __master * Used to prototype the master object.