From b8c5b28e407485c96fd8f9c273dda58f1e2b1f95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=BCbinette=20=28Hubbe=29?= <hubbe@hubbe.net> Date: Thu, 25 May 2000 15:30:02 -0700 Subject: [PATCH] some more functions moved Rev: src/builtin.cmod:1.5 Rev: src/builtin_functions.c:1.279 --- src/builtin.cmod | 30 ++++++++++++++++++++++++++++++ src/builtin_functions.c | 32 +------------------------------- 2 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/builtin.cmod b/src/builtin.cmod index e66432331e..9d24ad6f7d 100644 --- a/src/builtin.cmod +++ b/src/builtin.cmod @@ -20,6 +20,7 @@ #include "cyclic.h" #include "bignum.h" #include "main.h" +#include "operators.h" PIKEFUN array column(array tmp, mixed val) @@ -145,6 +146,35 @@ PIKEFUN int program_inherits(program p, program p2) RETURN !!low_get_storage(p2,p); } +PIKEFUN string program_defined(program p) + errname Program.defined; + optflags OPT_TRY_OPTIMIZE; +{ + if(p && p->num_linenumbers) + { + char *tmp; + INT32 line; + if((tmp=get_line(p->program, p, &line))) + { + struct pike_string *tmp2; + tmp2=make_shared_string(tmp); + pop_n_elems(args); + + push_string(tmp2); + if(line > 1) + { + push_constant_text(":"); + push_int(line); + f_add(3); + } + return; + } + } + + pop_n_elems(args); + push_int(0); +} + PIKEFUN int string_width(string s) errname String.width; optflags OPT_TRY_OPTIMIZE; diff --git a/src/builtin_functions.c b/src/builtin_functions.c index 082bb88b84..1354f4a716 100644 --- a/src/builtin_functions.c +++ b/src/builtin_functions.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: builtin_functions.c,v 1.278 2000/05/25 20:08:55 hubbe Exp $"); +RCSID("$Id: builtin_functions.c,v 1.279 2000/05/25 22:30:02 hubbe Exp $"); #include "interpret.h" #include "svalue.h" #include "pike_macros.h" @@ -5483,36 +5483,6 @@ void f_inherit_list(INT32 args) } -void f_program_defined(INT32 args) -{ - struct program *p; - get_all_args("Program.defined",args,"%p",&p); - - if(p && p->num_linenumbers) - { - char *tmp; - INT32 line; - if((tmp=get_line(p->program, p, &line))) - { - struct pike_string *tmp2; - tmp2=make_shared_string(tmp); - pop_n_elems(args); - - push_string(tmp2); - if(line > 1) - { - push_constant_text(":"); - push_int(line); - f_add(3); - } - return; - } - } - - pop_n_elems(args); - push_int(0); -} - void f_function_defined(INT32 args) { check_all_args("Function.defined",args,BIT_FUNCTION, 0); -- GitLab