pike.git
/
src
/
builtin.cmod
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/builtin.cmod:1:
-
/* -*- c -*- */
+
/* -*- c -*-
+
*
$Id: builtin.cmod,v 1.18 2001
/
06/08 14:26:40 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"
//! 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 //! the argument index and returns an array with the results. //!
pike.git/src/builtin.cmod:290:
sp++; } else { apply_lfun( map->u.object, LFUN__M_DELETE, 1 ); stack_swap(); pop_stack(); } }
-
//! 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); } void init_builtin(void) { INIT }