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.484 2003/04/14 15:04:41 mast Exp $ + || $Id: builtin_functions.c,v 1.485 2003/04/27 12:08:37 nilsson Exp $   */      #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.484 2003/04/14 15:04:41 mast Exp $"); + RCSID("$Id: builtin_functions.c,v 1.485 2003/04/27 12:08:37 nilsson 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:2595:    while(o && !o->prog) o=o->next;    pop_n_elems(args);    if(!o)    {    push_int(0);    }else{    ref_push_object(o);    }   }    - /*! @decl program object_program(mixed o) + /*! @decl program|function object_program(mixed o)    *! -  *! Return the program from which @[o] was instantiated. +  *! Return the program from which @[o] was instantiated. If the +  *! object was instantiated from an unnamed program, the +  *! generating function will be returned. E.g. +  *! @expr{object_program(class { }())@} will return the @i{function@} +  *! "class {}".    *!    *! If @[o] is not an object or has been destructed @expr{0@} (zero)    *! will be returned.    */   PMOD_EXPORT void f_object_program(INT32 args)   {    if(args < 1)    SIMPLE_TOO_FEW_ARGS_ERROR("object_program", 1);       if(Pike_sp[-args].type == T_OBJECT)
pike.git/src/builtin_functions.c:7826:    tFunc(tArray,tArray)),OPT_EXTERNAL_DEPEND);      /* function(object:object)|function(mapping:mapping)|function(multiset:multiset)|function(program:program)|function(array:array) */    ADD_EFUN("_prev",f__prev,    tOr5(tFunc(tObj,tObj),    tFunc(tMapping,tMapping),    tFunc(tMultiset,tMultiset),    tFunc(tPrg(tObj),tPrg(tObj)),    tFunc(tArray,tArray)),OPT_EXTERNAL_DEPEND);    - /* function(mixed:program) */ -  ADD_EFUN2("object_program", f_object_program,tFunc(tMix, tOr(tPrg(tObj),tObj)), +  /* function(mixed:program|function) */ +  ADD_EFUN2("object_program", f_object_program, +  tFunc(tMix, tOr(tPrg(tObj),tFunction)),    OPT_TRY_OPTIMIZE, fix_object_program_type, 0);      /* function(mixed:int) */    ADD_EFUN("objectp", f_objectp,tFunc(tMix,tInt),0);      /* function(mixed:int) */    ADD_EFUN("programp",f_programp,tFunc(tMix,tInt),0);      /* function(:int) */    ADD_EFUN("query_num_arg",f_query_num_arg,