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.507 2003/09/05 12:36:22 jhs Exp $ + || $Id: builtin_functions.c,v 1.508 2003/09/05 15:50:22 grubba Exp $   */      #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.507 2003/09/05 12:36:22 jhs Exp $"); + RCSID("$Id: builtin_functions.c,v 1.508 2003/09/05 15:50:22 grubba 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:816:    case T_OBJECT:    if (Pike_sp[-args].u.object->prog) {    struct object *o = Pike_sp[-args].u.object;    struct program *p = o->prog;    /* NOTE: Fake lfun! */    int id = low_find_lfun(p, LFUN__SEARCH);    int next, ind;       /* First try lfun::_search(). */    if (id >= 0) { -  apply_lfun(o, id, args-1); +  apply_low(o, id, args-1);    stack_pop_n_elems_keep_top(1);    return;    }       /* Check if we have an iterator. */    if (((id = find_identifier("value", p)) >= 0) &&    ((next = find_identifier("next", p)) >= 0) &&    ((ind = find_identifier("index", p)) >= 0)) {    /* We have an iterator. */       /* Set the start position if needed. */    if (args > 2) {    apply(o, "set_index", args-2);    pop_stack();    }       /* At this point we have two values on the stack. */       while(1) { -  apply_lfun(o, id, 0); +  apply_low(o, id, 0);    if (is_eq(Pike_sp-2, Pike_sp-1)) {    /* Found. */ -  apply_lfun(o, ind, 0); +  apply_low(o, ind, 0);    stack_pop_n_elems_keep_top(3);    return;    } -  apply_lfun(o, next, 0); +  apply_low(o, next, 0);    if (UNSAFE_IS_ZERO(Pike_sp-1)) {    /* Not found. */    pop_n_elems(4);    /* FIXME: Should probably indicate not found in some other way.    * On the other hand, the iterator should be false now.    */    push_undefined();    return;    }    pop_n_elems(2);