pike.git / src / builtin.cmod

version» Context lines:

pike.git/src/builtin.cmod:1: - /* -*- c -*- */ + /* -*- c -*- +  * $Id: builtin.cmod,v 1.30 2001/06/05 00:03:57 mast Exp $ +  */      #include "global.h"   #include "interpret.h"   #include "svalue.h"   #include "opcodes.h"   #include "pike_macros.h"   #include "object.h"   #include "program.h"   #include "array.h"   #include "pike_error.h"
pike.git/src/builtin.cmod:16:   #include "pike_types.h"   #include "pike_memory.h"   #include "threads.h"   #include <math.h>   #include <ctype.h>   #include "module_support.h"   #include "cyclic.h"   #include "bignum.h"   #include "main.h"   #include "operators.h" + #include "builtin_functions.h"      /*! @decl array column(array data, mixed index)    *!    *! Extract a column from a two-dimensional array.    *!    *! This function is exactly equivalent to:    *! @code{map(@[data], lambda(mixed x,mixed y) { return x[y]; }, @[index])@}    *!    *! Except of course it is a lot shorter and faster.    *! That is, it indices every index in the array data on the value of
pike.git/src/builtin.cmod:387:    SIMPLE_BAD_ARG_ERROR("m_delete", 1, "object with _m_delete");       apply_low( map->u.object, id, 1 );    stack_swap();    pop_stack();    } else {    SIMPLE_BAD_ARG_ERROR("m_delete", 1, "object|mapping");    }   }    - /*! @decl int(0..1) get_weak_flag(array|mapping|multiset m) + /*! @decl int get_weak_flag(array|mapping|multiset m)    *! -  *! Returns 1 if the weak flag has been set for @[m]. +  *! Returns the weak flag settings for @[m]. It's a combination of +  *! @[Pike.WEAK_INDICES] and @[Pike.WEAK_VALUES].    */ - PIKEFUN int(0 .. 1) get_weak_flag(array|mapping|multiset m) + PIKEFUN int get_weak_flag(array|mapping|multiset m)    efun;    optflags OPT_EXTERNAL_DEPEND;   {    int flag = 0;    switch (m->type) {    case T_ARRAY: -  flag = !!(m->u.array->flags & ARRAY_WEAK_FLAG); +  flag = (m->u.array->flags & ARRAY_WEAK_FLAG) ? PIKE_WEAK_VALUES : 0;    break;    case T_MAPPING: -  flag = !!(mapping_get_flags(m->u.mapping) & MAPPING_FLAG_WEAK); +  flag = mapping_get_flags(m->u.mapping) & MAPPING_WEAK;    break;    case T_MULTISET: -  flag = !!(m->u.multiset->ind->flags & (ARRAY_WEAK_FLAG|ARRAY_WEAK_SHRINK)); +  flag = (m->u.multiset->ind->flags & (ARRAY_WEAK_FLAG|ARRAY_WEAK_SHRINK)) ? +  PIKE_WEAK_INDICES : 0;    break;    default:    SIMPLE_BAD_ARG_ERROR("get_weak_flag",1,"array|mapping|multiset");    }    pop_n_elems(args);    push_int(flag);   }      PIKEFUN program __empty_program()    efun;