pike.git / src / interpret.c

version» Context lines:

pike.git/src/interpret.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: interpret.c,v 1.185 2001/06/08 14:28:22 mast Exp $"); + RCSID("$Id: interpret.c,v 1.186 2001/06/11 16:43:54 grubba Exp $");   #include "interpret.h"   #include "object.h"   #include "program.h"   #include "svalue.h"   #include "array.h"   #include "mapping.h"   #include "pike_error.h"   #include "language.h"   #include "stralloc.h"   #include "constants.h"
pike.git/src/interpret.c:1577:         PMOD_EXPORT void safe_apply(struct object *o, char *fun ,INT32 args)   {   #ifdef PIKE_DEBUG    if(!o->prog) fatal("Apply safe on destructed object.\n");   #endif    safe_apply_low(o, find_identifier(fun, o->prog), args);   }    + PMOD_EXPORT void safe_apply_handler(const char *fun, +  struct object *handler, +  struct object *compat, +  INT32 args) + { +  int i; +  if (handler && handler->prog && +  (i = find_identifier(fun, handler->prog)) != -1) { +  safe_apply_low(handler, i, args); +  } else if (compat && compat->prog && +  (i = find_identifier(fun, compat->prog)) != -1) { +  safe_apply_low(compat, i, args); +  } else { +  struct object *master_obj = master(); +  i = find_identifier(fun, master_obj->prog); +  safe_apply_low(master_obj, i, args); +  } + } +    PMOD_EXPORT void apply_lfun(struct object *o, int fun, int args)   {   #ifdef PIKE_DEBUG    if(fun < 0 || fun >= NUM_LFUNS)    fatal("Apply lfun on illegal value!\n");   #endif    if(!o->prog)    PIKE_ERROR("destructed object", "Apply on destructed object.\n", Pike_sp, args);       apply_low(o, (int)FIND_LFUN(o->prog,fun), args);