pike.git/
src/
builtin_functions.c
Branch:
Tag:
Non-build tags
All tags
No tags
1997-08-26
1997-08-26 23:24:45 by Henrik Grubbström (Grubba) <grubba@grubba.org>
44c89fad54bc065b048f352557f88eddfa5c3327 (
53
lines) (+
51
/-
2
)
[
Show
|
Annotate
]
Branch:
7.9
Fixed bug in combine_path().
Rev: src/builtin_functions.c:1.39
4:
||| See the files COPYING and DISCLAIMER for more information. \*/ #include "global.h"
-
RCSID("$Id: builtin_functions.c,v 1.
38
1997/08/
06
18
:
41
:
55
hubbe
Exp $");
+
RCSID("$Id: builtin_functions.c,v 1.
39
1997/08/
26
23
:
24
:
45
grubba
Exp $");
#include "interpret.h" #include "svalue.h" #include "pike_macros.h"
433:
} break;
-
case '/':
+
case 0:
-
+
if (to == ret) {
+
/* Special case, so we don't get an empty string */
+
to++;
+
}
+
/* FALL_THROUGH */
+
case '/':
from+=2; continue; }
1683:
} #endif
+
#ifdef PROFILING
+
static void f_get_prof_info(INT32 args)
+
{
+
struct program *prog;
+
int num_functions;
+
int i;
+
+
if (!args) {
+
error("get_profiling_info(): Too few arguments\n");
+
}
+
if (sp[-args].type != T_PROGRAM) {
+
error("get_profiling_info(): Bad argument 1\n");
+
}
+
+
prog = sp[-args].u.program;
+
prog->refs++;
+
+
pop_n_elems(args);
+
+
/* ({ num_clones, ([ "fun_name":({ num_calls }) ]) }) */
+
+
push_int(prog->num_clones);
+
+
for(num_functions=i=0; i<prog->num_identifiers; i++) {
+
if (IDENTIFIER_IS_FUNCTION(prog->identifiers[i].flags)) {
+
num_functions++;
+
prog->identifiers[i].name->refs++;
+
push_string(prog->identifiers[i].name);
+
+
push_int(prog->identifiers[i].num_calls);
+
f_aggregate(1);
+
}
+
}
+
f_aggregate_mapping(num_functions * 2);
+
f_aggregate(2);
+
}
+
#endif /* PROFILING */
+
void init_builtin_efuns() { init_operators();
1692:
add_efun("gethrtime", f_gethrtime,"function(void:int)", OPT_EXTERNAL_DEPEND); #endif
+
#ifdef PROFILING
+
add_efun("get_profiling_info", f_get_prof_info,
+
"function(program:array)", OPT_EXTERNAL_DEPEND);
+
#endif /* PROFILING */
+
add_efun("_refs",f__refs,"function(function|string|array|mapping|multiset|object|program:int)",OPT_EXTERNAL_DEPEND); add_efun("replace_master",f_replace_master,"function(object:void)",OPT_SIDE_EFFECT); add_efun("add_constant",f_add_constant,"function(string,void|mixed:void)",OPT_SIDE_EFFECT);