Branch: Tag:

2000-07-05

2000-07-05 23:18:48 by Martin Stjernholm <mast@lysator.liu.se>

Added get_weak_flag().

Rev: src/builtin.cmod:1.8
Rev: tutorial/tutorial.wmml:1.201

195:    sp++;   }    + PIKEFUN int get_weak_flag(mixed m) +  efun; +  optflags OPT_TRY_OPTIMIZE; + { +  int flag; +  switch (m->type) { +  case T_ARRAY: +  flag = !!(m->u.array->flags & ARRAY_WEAK_FLAG); +  break; +  case T_MAPPING: +  flag = !!(m->u.mapping->flags & MAPPING_FLAG_WEAK); +  break; +  case T_MULTISET: +  flag = !!(m->u.multiset->ind->flags & (ARRAY_WEAK_FLAG|ARRAY_WEAK_SHRINK)); +  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   }