pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:1:   /*   || 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.512 2003/09/11 13:45:44 grubba Exp $ + || $Id: builtin_functions.c,v 1.513 2003/10/19 16:56:00 mast Exp $   */      #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.512 2003/09/11 13:45:44 grubba Exp $"); + RCSID("$Id: builtin_functions.c,v 1.513 2003/10/19 16:56:00 mast Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"   #include "constants.h"   #include "mapping.h"   #include "stralloc.h"
pike.git/src/builtin_functions.c:7764:    *! builtin functions and functions in destructed objects.    */   PMOD_EXPORT void f_function_defined(INT32 args)   {    check_all_args("Function.defined",args,BIT_FUNCTION, 0);       if(Pike_sp[-args].subtype != FUNCTION_BUILTIN &&    Pike_sp[-args].u.object->prog)    {    struct program *p = Pike_sp[-args].u.object->prog; +  struct program *id_prog, *p2;    int func = Pike_sp[-args].subtype;    struct identifier *id;    INT32 line;    struct pike_string *file = NULL;       if (p == pike_trampoline_program) {    struct pike_trampoline *t =    (struct pike_trampoline *) Pike_sp[-args].u.object->storage;    if (t->frame->current_object->prog) {    p = t->frame->current_object->prog;    func = t->func;    }    }       id=ID_FROM_INT(p, func); -  +  id_prog = PROG_FROM_INT (p, func); +     if(IDENTIFIER_IS_PIKE_FUNCTION( id->identifier_flags ) &&    id->func.offset != -1) -  file = low_get_line(p->program + id->func.offset, p, &line); +  file = low_get_line(id_prog->program + id->func.offset, id_prog, &line); +  else if (IDENTIFIER_IS_CONSTANT (id->identifier_flags) && +  id->func.offset >= 0 && +  (p2 = program_from_svalue (&id_prog->constants[id->func.offset].sval))) +  file = low_get_program_line (p2, &line);    else    /* The program line is better than nothing for C functions. */    file = low_get_program_line (p, &line);       if (file)    {    pop_n_elems(args);    if (line) {    push_string(file);    push_constant_text(":");