Branch: Tag:

2001-06-11

2001-06-11 16:43:56 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Backported safe_apply_handler() from Pike 7.3.

Rev: src/cpp.c:1.85
Rev: src/interpret.c:1.186
Rev: src/interpret.h:1.79
Rev: src/program.c:1.295

5:   \*/   /**/   #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"
1584:    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