Main Page | Class List | Directories | File List | Class Members | File Members

svalue.h File Reference

#include "global.h"

Go to the source code of this file.

Classes

struct  processing
union  anything
struct  svalue
struct  ref_dummy

Defines

#define PIKE_T_ARRAY   0
#define PIKE_T_MAPPING   1
#define PIKE_T_MULTISET   2
#define PIKE_T_OBJECT   3
#define PIKE_T_FUNCTION   4
#define PIKE_T_PROGRAM   5
#define PIKE_T_STRING   6
#define PIKE_T_TYPE   7
#define PIKE_T_INT   8
#define PIKE_T_FLOAT   9
#define PIKE_T_ZERO   14
#define T_UNFINISHED   15
#define T_VOID   16
#define T_MANY   17
#define PIKE_T_RING   240
#define PIKE_T_NAME   241
#define PIKE_T_SCOPE   243
#define PIKE_T_TUPLE   244
#define T_ASSIGN   245
#define T_DELETED   246
#define PIKE_T_UNKNOWN   247
#define T_OBJ_INDEX   248
#define T_SVALUE_PTR   249
#define T_ARRAY_LVALUE   250
#define PIKE_T_MIXED   251
#define T_NOT   253
#define T_AND   254
#define T_OR   255
#define T_STORAGE   10000
#define T_MAPPING_DATA   10001
#define T_PIKE_FRAME   10002
#define T_MULTISET_DATA   10003
#define T_STRUCT_CALLABLE   10004
#define tArr(VAL)   "\000" VAL
#define tArray   tArr(tMix)
#define tMap(IND, VAL)   "\001" IND VAL
#define tMapping   tMap(tMix,tMix)
#define tSet(IND)   "\002" IND
#define tMultiset   tSet(tMix)
#define tObj   "\003\000\000\000\000\000"
#define tFuncV(ARGS, REST, RET)   MagictFuncV(RET,REST,ARGS)
#define tFunc(ARGS, RET)   MagictFunc(RET,ARGS)
#define tTuple(T1, T2)   "\364" T1 T2
#define tTriple(T1, T2, T3)   tTuple(T1, tTuple(T2, T3))
#define tQuad(T1, T2, T3, T4)   tTriple(tTuple(T1, T2), T3, T4)
#define MagictFuncV(RET, REST, ARGS)   "\004" ARGS "\021" REST RET
#define MagictFunc(RET, ARGS)   tFuncV(ARGS "", tVoid, RET)
#define tFunction   tFuncV("" ,tOr(tZero,tVoid),tOr(tMix,tVoid))
#define tNone   ""
#define tPrg(X)   "\005" X
#define tProgram(X)   "\005" X
#define tStr   "\006"
#define tString   "\006"
#define tType(T)   "\007" T
#define tInt   "\010\200\000\000\000\177\377\377\377"
#define tInt0   "\010\000\000\000\000\000\000\000\000"
#define tInt1   "\010\000\000\000\001\000\000\000\001"
#define tInt2   "\010\000\000\000\002\000\000\000\002"
#define tInt01   "\010\000\000\000\000\000\000\000\001"
#define tInt02   "\010\000\000\000\000\000\000\000\002"
#define tInt03   "\010\000\000\000\000\000\000\000\003"
#define tInt04   "\010\000\000\000\000\000\000\000\004"
#define tInt05   "\010\000\000\000\000\000\000\000\005"
#define tInt06   "\010\000\000\000\000\000\000\000\006"
#define tIntPos   "\010\000\000\000\000\177\377\377\377"
#define tInt1Plus   "\010\000\000\000\001\177\377\377\377"
#define tInt2Plus   "\010\000\000\000\002\177\377\377\377"
#define tInt_10   "\010\377\377\377\377\000\000\000\000"
#define tInt_11   "\010\377\377\377\377\000\000\000\001"
#define tByte   "\010\000\000\000\000\000\000\000\377"
#define tFlt   "\011"
#define tFloat   "\011"
#define tZero   "\016"
#define tVoid   "\020"
#define tVar(X)   #X
#define tSetvar(X, Y)   "\365" #X Y
#define tScope(X, T)   "\363" #X Y
#define tNot(X)   "\375" X
#define tAnd(X, Y)   "\376" X Y
#define tOr(X, Y)   "\377" X Y
#define tOr3(X, Y, Z)   tOr(X,tOr(Y,Z))
#define tOr4(X, Y, Z, A)   tOr(X,tOr(Y,tOr(Z,A)))
#define tOr5(X, Y, Z, A, B)   tOr(X,tOr(Y,tOr(Z,tOr(A,B))))
#define tOr6(X, Y, Z, A, B, C)   tOr(X,tOr(Y,tOr(Z,tOr(A,tOr(B,C)))))
#define tOr7(X, Y, Z, A, B, C, D)   tOr(X,tOr(Y,tOr(Z,tOr(A,tOr(B,tOr(C,D))))))
#define tOr8(A, B, C, D, E, F, G, H)   tOr(A,tOr7(B,C,D,E,F,G,H))
#define tOr9(A, B, C, D, E, F, G, H, I)   tOr(A,tOr8(B,C,D,E,F,G,H,I))
#define tMix   "\373"
#define tMixed   "\373"
#define tComplex   tOr6(tArray,tMapping,tMultiset,tObj,tFunction,tPrg(tObj))
#define tStringIndicable   tOr5(tMapping,tObj,tFunction,tPrg(tObj),tMultiset)
#define tRef   tOr(tString,tComplex)
#define tIfnot(X, Y)   tAnd(tNot(X),Y)
#define tAny   tOr(tVoid,tMix)
#define tName(X, Y)   "\361\0"X"\0"Y
#define tName1(X, Y)   "\361\1"X"\0\0"Y
#define tName2(X, Y)   "\361\2"X"\0\0\0\0"Y
#define tSimpleCallable   tOr3(tArray,tFunction,tObj)
#define tCallable   tOr3(tArr(tSimpleCallable),tFunction,tObj)
#define BIT_ARRAY   (1<<PIKE_T_ARRAY)
#define BIT_MAPPING   (1<<PIKE_T_MAPPING)
#define BIT_MULTISET   (1<<PIKE_T_MULTISET)
#define BIT_OBJECT   (1<<PIKE_T_OBJECT)
#define BIT_FUNCTION   (1<<PIKE_T_FUNCTION)
#define BIT_PROGRAM   (1<<PIKE_T_PROGRAM)
#define BIT_STRING   (1<<PIKE_T_STRING)
#define BIT_TYPE   (1<<PIKE_T_TYPE)
#define BIT_INT   (1<<PIKE_T_INT)
#define BIT_FLOAT   (1<<PIKE_T_FLOAT)
#define BIT_ZERO   (1<<PIKE_T_ZERO)
#define BIT_UNFINISHED   (1 << T_UNFINISHED)
#define BIT_VOID   (1 << T_VOID)
#define BIT_MANY   (1 << T_MANY)
#define BIT_NOTHING   0
#define BIT_MIXED   0x7fff
#define BIT_BASIC   (BIT_INT|BIT_FLOAT|BIT_STRING|BIT_TYPE)
#define BIT_COMPLEX   (BIT_ARRAY|BIT_MULTISET|BIT_OBJECT|BIT_PROGRAM|BIT_MAPPING|BIT_FUNCTION)
#define BIT_CALLABLE   (BIT_FUNCTION|BIT_PROGRAM|BIT_ARRAY|BIT_OBJECT)
#define BIT_REF_TYPES   (BIT_STRING|BIT_TYPE|BIT_COMPLEX)
#define MAX_COMPLEX   PIKE_T_PROGRAM
#define MAX_REF_TYPE   PIKE_T_TYPE
#define MAX_TYPE   PIKE_T_FLOAT
#define NUMBER_NUMBER   0
#define NUMBER_UNDEFINED   1
#define NUMBER_DESTRUCTED   2
#define FUNCTION_BUILTIN   USHRT_MAX
#define is_gt(a, b)   is_lt(b,a)
#define is_ge(a, b)   is_le(b,a)
#define UNSAFE_IS_ZERO(X)   ((X)->type==PIKE_T_INT?(X)->u.integer==0:(1<<(X)->type)&(BIT_OBJECT|BIT_FUNCTION)?!svalue_is_true(X):0)
#define SAFE_IS_ZERO(X)   ((X)->type==PIKE_T_INT?(X)->u.integer==0:(1<<(X)->type)&(BIT_OBJECT|BIT_FUNCTION)?!safe_svalue_is_true(X):0)
#define IS_UNDEFINED(X)   ((X)->type==PIKE_T_INT&&!(X)->u.integer&&(X)->subtype==1)
#define IS_DESTRUCTED(X)   (((X)->type == PIKE_T_OBJECT || (X)->type==PIKE_T_FUNCTION) && !(X)->u.object->prog)
#define check_destructed(S)
#define safe_check_destructed(var)
#define check_short_destructed(U, T)
#define IF_LOCAL_MUTEX(X)
#define add_ref(X)   (void)((X)->refs++)
#define sub_ref(X)   (--(X)->refs > 0)
#define pike_lock_data(X)   (void)(X)
#define pike_unlock_data(X)   (void)(X)
#define check_svalue(S)
#define check_type(T)
#define check_refs(S)
#define check_refs2(S, T)
#define check_type_hint(SVALS, NUM, TYPE_HINT)
#define dmalloc_check_svalue(S, L)   (S)
#define dmalloc_check_svalues(S, L, N)   (S)
#define dmalloc_check_union(U, T, L)   (U)
#define assert_svalue_locked(X)
#define swap_svalues_unlocked(X, Y)
#define free_svalue_unlocked(X)
#define free_short_svalue_unlocked(X, T)
#define add_ref_svalue_unlocked(X)
#define assign_svalue_no_free_unlocked(X, Y)
#define assign_svalue_unlocked(X, Y)
#define move_svalue(TO, FROM)
#define free_mixed_svalues(X, Y)
#define free_svalues(X, Y, Z)   debug_free_svalues((X),(Y),(Z));
#define low_clear_svalues(X, Y, N)
#define clear_svalues(X, Y)   low_clear_svalues((X),(Y),NUMBER_NUMBER)
#define clear_svalues_undefined(X, Y)   low_clear_svalues((X),(Y),NUMBER_UNDEFINED)
#define really_free_short_svalue(U, TYPE)
#define gc_cycle_check_without_recurse   gc_mark_without_recurse
#define gc_cycle_check_weak_without_recurse   gc_mark_without_recurse
#define gc_mark_external_svalues(S, NUM, PLACE)
#define gc_check_svalues(S, NUM)
#define gc_mark_svalues   real_gc_mark_svalues
#define gc_cycle_check_svalues   real_gc_cycle_check_svalues
#define gc_check_short_svalue(U, T)   real_gc_check_short_svalue(dmalloc_check_union((U),(T),DMALLOC_LOCATION()),T)
#define gc_mark_short_svalue(U, T)   real_gc_mark_short_svalue(dmalloc_check_union((U),(T),DMALLOC_LOCATION()),T)
#define gc_cycle_check_short_svalue(U, T)   real_gc_cycle_check_short_svalue(dmalloc_check_union((U),(T),DMALLOC_LOCATION()),(T))
#define gc_free_svalue(S)   real_gc_free_svalue(dmalloc_check_svalue(S,DMALLOC_LOCATION()))
#define gc_free_short_svalue(U, T)   real_gc_free_short_svalue(dmalloc_check_union((U),(T),DMALLOC_LOCATION()),(T))
#define T_ARRAY   PIKE_T_ARRAY
#define T_MAPPING   PIKE_T_MAPPING
#define T_MULTISET   PIKE_T_MULTISET
#define T_OBJECT   PIKE_T_OBJECT
#define T_FUNCTION   PIKE_T_FUNCTION
#define T_PROGRAM   PIKE_T_PROGRAM
#define T_STRING   PIKE_T_STRING
#define T_TYPE   PIKE_T_TYPE
#define T_FLOAT   PIKE_T_FLOAT
#define T_INT   PIKE_T_INT
#define T_ZERO   PIKE_T_ZERO
#define T_TUPLE   PIKE_T_TUPLE
#define T_SCOPE   PIKE_T_SCOPE
#define T_MIXED   PIKE_T_MIXED
#define swap_svalues   swap_svalues
#define free_svalue   free_svalue_unlocked
#define free_short_svalue   free_short_svalue_unlocked
#define add_ref_svalue   add_ref_svalue_unlocked
#define assign_svalue_no_free   assign_svalue_no_free_unlocked
#define assign_svalue   assign_svalue_unlocked
#define PIKE_MEMORY_OBJECT_MEMBERS
#define PIKE_CONSTANT_MEMOBJ_INIT(refs)   refs
#define INIT_PIKE_MEMOBJ(X)
#define EXIT_PIKE_MEMOBJ(X)

Typedefs

typedef node_s node

Functions

PMOD_EXPORT void really_free_short_svalue_ptr (void **s, TYPE_T type)
PMOD_EXPORT void really_free_svalue (struct svalue *s)
PMOD_EXPORT void do_free_svalue (struct svalue *s)
PMOD_EXPORT void debug_free_svalues (struct svalue *s, size_t num, INT32 type_hint DMALLOC_LINE_ARGS)
PMOD_EXPORT void debug_free_mixed_svalues (struct svalue *s, size_t num, INT32 type_hint DMALLOC_LINE_ARGS)
PMOD_EXPORT TYPE_FIELD assign_svalues_no_free (struct svalue *to, const struct svalue *from, size_t num, TYPE_FIELD type_hint)
PMOD_EXPORT TYPE_FIELD assign_svalues (struct svalue *to, const struct svalue *from, size_t num, TYPE_FIELD type_hint)
PMOD_EXPORT void assign_to_short_svalue (union anything *u, TYPE_T type, const struct svalue *s)
PMOD_EXPORT void assign_to_short_svalue_no_free (union anything *u, TYPE_T type, const struct svalue *s)
PMOD_EXPORT void assign_from_short_svalue_no_free (struct svalue *s, const union anything *u, TYPE_T type)
PMOD_EXPORT void assign_short_svalue_no_free (union anything *to, const union anything *from, TYPE_T type)
PMOD_EXPORT void assign_short_svalue (union anything *to, const union anything *from, TYPE_T type)
PMOD_EXPORT unsigned INT32 hash_svalue (const struct svalue *s)
PMOD_EXPORT int svalue_is_true (const struct svalue *s)
PMOD_EXPORT int safe_svalue_is_true (const struct svalue *s)
PMOD_EXPORT int is_identical (const struct svalue *a, const struct svalue *b)
PMOD_EXPORT int is_eq (const struct svalue *a, const struct svalue *b)
PMOD_EXPORT int low_is_equal (const struct svalue *a, const struct svalue *b, struct processing *p)
PMOD_EXPORT int low_short_is_equal (const union anything *a, const union anything *b, TYPE_T type, struct processing *p)
PMOD_EXPORT int is_equal (const struct svalue *a, const struct svalue *b)
PMOD_EXPORT int is_lt (const struct svalue *a, const struct svalue *b)
PMOD_EXPORT int is_le (const struct svalue *a, const struct svalue *b)
PMOD_EXPORT void describe_svalue (const struct svalue *s, int indent, struct processing *p)
PMOD_EXPORT void print_svalue (FILE *out, const struct svalue *s)
PMOD_EXPORT void print_short_svalue (FILE *out, const union anything *a, TYPE_T type)
PMOD_EXPORT void print_svalue_compact (FILE *out, const struct svalue *s)
PMOD_EXPORT void print_short_svalue_compact (FILE *out, const union anything *a, TYPE_T type)
PMOD_EXPORT void copy_svalues_recursively_no_free (struct svalue *to, const struct svalue *from, size_t num, struct mapping *m)
void check_short_svalue (const union anything *u, TYPE_T type)
void debug_check_svalue (const struct svalue *s)
void debug_check_type_hint (const struct svalue *svals, size_t num, TYPE_FIELD type_hint)
PMOD_EXPORT void real_gc_mark_external_svalues (const struct svalue *s, ptrdiff_t num, const char *place)
PMOD_EXPORT void real_gc_check_svalues (const struct svalue *s, size_t num)
void gc_check_weak_svalues (const struct svalue *s, size_t num)
PMOD_EXPORT void real_gc_check_short_svalue (const union anything *u, TYPE_T type)
void gc_check_weak_short_svalue (const union anything *u, TYPE_T type)
PMOD_EXPORT TYPE_FIELD real_gc_mark_svalues (struct svalue *s, size_t num)
TYPE_FIELD gc_mark_weak_svalues (struct svalue *s, size_t num)
int real_gc_mark_short_svalue (union anything *u, TYPE_T type)
int gc_mark_weak_short_svalue (union anything *u, TYPE_T type)
int gc_mark_without_recurse (struct svalue *s)
int gc_mark_weak_without_recurse (struct svalue *s)
PMOD_EXPORT TYPE_FIELD real_gc_cycle_check_svalues (struct svalue *s, size_t num)
TYPE_FIELD gc_cycle_check_weak_svalues (struct svalue *s, size_t num)
PMOD_EXPORT int real_gc_cycle_check_short_svalue (union anything *u, TYPE_T type)
int gc_cycle_check_weak_short_svalue (union anything *u, TYPE_T type)
void real_gc_free_svalue (struct svalue *s)
void real_gc_free_short_svalue (union anything *u, TYPE_T type)
PMOD_EXPORT INT32 pike_sizeof (const struct svalue *s)
int svalues_are_constant (struct svalue *s, INT32 num, TYPE_FIELD hint, struct processing *p)

Variables

const struct svalue dest_ob_zero


Define Documentation

#define add_ref  )     (void)((X)->refs++)
 

#define add_ref_svalue   add_ref_svalue_unlocked
 

#define add_ref_svalue_unlocked  ) 
 

Value:

do {                            \
  struct svalue *_tmp=(X);                                      \
  check_type(_tmp->type); check_refs(_tmp);                     \
  if(_tmp->type <= MAX_REF_TYPE) add_ref(_tmp->u.dummy);        \
}while(0)

#define assert_svalue_locked  ) 
 

#define assign_svalue   assign_svalue_unlocked
 

#define assign_svalue_no_free   assign_svalue_no_free_unlocked
 

#define assign_svalue_no_free_unlocked X,
 ) 
 

Value:

do {    \
  struct svalue _tmp;                                   \
  struct svalue *_to=(X);                               \
  const struct svalue *_from=(Y);                       \
  check_type(_from->type); check_refs(_from);           \
  *_to=_tmp=*_from;                                     \
  if(_tmp.type <= MAX_REF_TYPE) add_ref(_tmp.u.dummy);  \
}while(0)

#define assign_svalue_unlocked X,
 ) 
 

Value:

do {    \
  struct svalue *_to2=(X);                      \
  const struct svalue *_from2=(Y);              \
  if (_to2 != _from2) {                         \
    free_svalue(_to2);                          \
     assign_svalue_no_free(_to2, _from2);       \
  }                                             \
}while(0)

#define BIT_ARRAY   (1<<PIKE_T_ARRAY)
 

#define BIT_BASIC   (BIT_INT|BIT_FLOAT|BIT_STRING|BIT_TYPE)
 

#define BIT_CALLABLE   (BIT_FUNCTION|BIT_PROGRAM|BIT_ARRAY|BIT_OBJECT)
 

#define BIT_COMPLEX   (BIT_ARRAY|BIT_MULTISET|BIT_OBJECT|BIT_PROGRAM|BIT_MAPPING|BIT_FUNCTION)
 

#define BIT_FLOAT   (1<<PIKE_T_FLOAT)
 

#define BIT_FUNCTION   (1<<PIKE_T_FUNCTION)
 

#define BIT_INT   (1<<PIKE_T_INT)
 

#define BIT_MANY   (1 << T_MANY)
 

#define BIT_MAPPING   (1<<PIKE_T_MAPPING)
 

#define BIT_MIXED   0x7fff
 

#define BIT_MULTISET   (1<<PIKE_T_MULTISET)
 

#define BIT_NOTHING   0
 

#define BIT_OBJECT   (1<<PIKE_T_OBJECT)
 

#define BIT_PROGRAM   (1<<PIKE_T_PROGRAM)
 

#define BIT_REF_TYPES   (BIT_STRING|BIT_TYPE|BIT_COMPLEX)
 

#define BIT_STRING   (1<<PIKE_T_STRING)
 

#define BIT_TYPE   (1<<PIKE_T_TYPE)
 

#define BIT_UNFINISHED   (1 << T_UNFINISHED)
 

#define BIT_VOID   (1 << T_VOID)
 

#define BIT_ZERO   (1<<PIKE_T_ZERO)
 

#define check_destructed  ) 
 

Value:

do{ \
  struct svalue *_s=(S); \
  if(IS_DESTRUCTED(_s)) { \
    free_object(_s->u.object); \
    _s->type = PIKE_T_INT; \
    _s->subtype = NUMBER_DESTRUCTED ; \
    _s->u.integer = 0; \
  } \
}while(0)

#define check_refs  ) 
 

#define check_refs2 S,
 ) 
 

#define check_short_destructed U,
 ) 
 

Value:

do{ \
  union anything *_u=(U); \
  if(( (1<<(T)) & (BIT_OBJECT | BIT_FUNCTION) ) && \
     _u->object && !_u->object->prog) { \
    free_object(_u->object); \
    _u->object = 0; \
  } \
}while(0)

#define check_svalue  ) 
 

#define check_type  ) 
 

#define check_type_hint SVALS,
NUM,
TYPE_HINT   ) 
 

#define clear_svalues X,
 )     low_clear_svalues((X),(Y),NUMBER_NUMBER)
 

#define clear_svalues_undefined X,
 )     low_clear_svalues((X),(Y),NUMBER_UNDEFINED)
 

#define dmalloc_check_svalue S,
 )     (S)
 

#define dmalloc_check_svalues S,
L,
 )     (S)
 

#define dmalloc_check_union U,
T,
 )     (U)
 

#define EXIT_PIKE_MEMOBJ  ) 
 

Value:

do {            \
  struct ref_dummy *v_=(struct ref_dummy *)(X);         \
  DO_IF_SECURITY( FREE_PROT(v_) );              \
  IF_LOCAL_MUTEX(mt_destroy(&(v_->mutex)));     \
}while(0)

#define free_mixed_svalues X,
 ) 
 

Value:

do {            \
  struct svalue *s_=(X);                        \
  ptrdiff_t num_=(Y);                           \
  while(num_--)                                 \
  {                                             \
    dmalloc_touch_svalue(s_);                   \
    free_svalue(s_++);                          \
  }                                             \
}while(0)

#define free_short_svalue   free_short_svalue_unlocked
 

#define free_short_svalue_unlocked X,
 ) 
 

Value:

do {                            \
  union anything *_s=(X); TYPE_T _t=(T);                                \
  check_type(_t); check_refs2(_s,_t);                                   \
  assert_svalue_locked(_s);                                             \
  if(_t<=MAX_REF_TYPE && _s->refs) {                                    \
    if(sub_ref(_s->dummy) <= 0) really_free_short_svalue(_s,_t);        \
  }                                                                     \
  DO_IF_DMALLOC(_s->refs=(void *)-1);                                   \
  PIKE_MEM_WO(_s->refs);                                                \
}while(0)

#define free_svalue   free_svalue_unlocked
 

#define free_svalue_unlocked  ) 
 

Value:

do {                            \
  struct svalue *_s=(X);                                        \
  assert_svalue_locked(_s);                                     \
  check_type(_s->type); check_refs(_s);                         \
  if(_s->type<=MAX_REF_TYPE) {                                  \
    if(sub_ref(_s->u.dummy) <=0) { really_free_svalue(_s); }    \
  }                                                             \
  DO_IF_DMALLOC(_s->type=PIKE_T_UNKNOWN;_s->u.refs=(void *)-1); \
  PIKE_MEM_WO(*_s);                                             \
}while(0)

#define free_svalues X,
Y,
 )     debug_free_svalues((X),(Y),(Z));
 

#define FUNCTION_BUILTIN   USHRT_MAX
 

#define gc_check_short_svalue U,
 )     real_gc_check_short_svalue(dmalloc_check_union((U),(T),DMALLOC_LOCATION()),T)
 

#define gc_check_svalues S,
NUM   ) 
 

Value:

do {                                    \
    size_t num__ = (NUM);                                               \
    real_gc_check_svalues (                                             \
      dmalloc_check_svalues ((S), num__, DMALLOC_LOCATION()), num__);   \
  } while (0)

#define gc_cycle_check_short_svalue U,
 )     real_gc_cycle_check_short_svalue(dmalloc_check_union((U),(T),DMALLOC_LOCATION()),(T))
 

#define gc_cycle_check_svalues   real_gc_cycle_check_svalues
 

#define gc_cycle_check_weak_without_recurse   gc_mark_without_recurse
 

#define gc_cycle_check_without_recurse   gc_mark_without_recurse
 

#define gc_free_short_svalue U,
 )     real_gc_free_short_svalue(dmalloc_check_union((U),(T),DMALLOC_LOCATION()),(T))
 

#define gc_free_svalue  )     real_gc_free_svalue(dmalloc_check_svalue(S,DMALLOC_LOCATION()))
 

#define gc_mark_external_svalues S,
NUM,
PLACE   ) 
 

Value:

do {                    \
    size_t num__ = (NUM);                                               \
    real_gc_mark_external_svalues (                                     \
      dmalloc_check_svalues ((S), num__, DMALLOC_LOCATION()), num__, (PLACE)); \
  } while (0)

#define gc_mark_short_svalue U,
 )     real_gc_mark_short_svalue(dmalloc_check_union((U),(T),DMALLOC_LOCATION()),T)
 

#define gc_mark_svalues   real_gc_mark_svalues
 

#define IF_LOCAL_MUTEX  ) 
 

#define INIT_PIKE_MEMOBJ  ) 
 

Value:

do {                    \
  struct ref_dummy *v_=(struct ref_dummy *)(X);         \
  v_->refs=0;                                           \
  add_ref(v_); /* For DMALLOC... */                     \
  DO_IF_SECURITY( INITIALIZE_PROT(v_) );                \
  IF_LOCAL_MUTEX(mt_init_recursive(&(v_->mutex)));      \
}while(0)

#define IS_DESTRUCTED  )     (((X)->type == PIKE_T_OBJECT || (X)->type==PIKE_T_FUNCTION) && !(X)->u.object->prog)
 

#define is_ge a,
 )     is_le(b,a)
 

#define is_gt a,
 )     is_lt(b,a)
 

#define IS_UNDEFINED  )     ((X)->type==PIKE_T_INT&&!(X)->u.integer&&(X)->subtype==1)
 

#define low_clear_svalues X,
Y,
 ) 
 

Value:

do {            \
  struct svalue *s_=(X);                        \
  ptrdiff_t num_=(Y);                           \
  for(;num_-- > 0;s_++)                         \
  {                                             \
      s_->type=PIKE_T_INT;                      \
      s_->subtype=(N);                          \
      s_->u.integer=0;                          \
  }                                             \
}while(0)

#define MagictFunc RET,
ARGS   )     tFuncV(ARGS "", tVoid, RET)
 

#define MagictFuncV RET,
REST,
ARGS   )     "\004" ARGS "\021" REST RET
 

#define MAX_COMPLEX   PIKE_T_PROGRAM
 

#define MAX_REF_TYPE   PIKE_T_TYPE
 

#define MAX_TYPE   PIKE_T_FLOAT
 

#define move_svalue TO,
FROM   ) 
 

Value:

do {                                    \
    struct svalue *_to = (TO);                                          \
    struct svalue *_from = (FROM);                                      \
    dmalloc_touch_svalue(_from);                                        \
    *_to = *_from;                                                      \
    DO_IF_DMALLOC(_from->type = PIKE_T_UNKNOWN; _from->u.refs = (void *) -1); \
    PIKE_MEM_WO(*_from);                                                \
  } while (0)

#define NUMBER_DESTRUCTED   2
 

#define NUMBER_NUMBER   0
 

#define NUMBER_UNDEFINED   1
 

#define PIKE_CONSTANT_MEMOBJ_INIT refs   )     refs
 

#define pike_lock_data  )     (void)(X)
 

#define PIKE_MEMORY_OBJECT_MEMBERS
 

Value:

INT32 refs \
  DO_IF_SECURITY(; struct object *prot) \
  IF_LOCAL_MUTEX(; PIKE_MUTEX_T mutex)

#define PIKE_T_ARRAY   0
 

#define PIKE_T_FLOAT   9
 

#define PIKE_T_FUNCTION   4
 

#define PIKE_T_INT   8
 

#define PIKE_T_MAPPING   1
 

#define PIKE_T_MIXED   251
 

#define PIKE_T_MULTISET   2
 

#define PIKE_T_NAME   241
 

#define PIKE_T_OBJECT   3
 

#define PIKE_T_PROGRAM   5
 

#define PIKE_T_RING   240
 

#define PIKE_T_SCOPE   243
 

#define PIKE_T_STRING   6
 

#define PIKE_T_TUPLE   244
 

#define PIKE_T_TYPE   7
 

#define PIKE_T_UNKNOWN   247
 

#define PIKE_T_ZERO   14
 

#define pike_unlock_data  )     (void)(X)
 

#define really_free_short_svalue U,
TYPE   ) 
 

Value:

do {                            \
    union anything *any_ = (U);                                         \
    debug_malloc_touch (any_->ptr);                                     \
    really_free_short_svalue_ptr (&any_->ptr, (TYPE));                  \
  } while (0)

#define safe_check_destructed var   ) 
 

Value:

do{ \
  if((var->type == PIKE_T_OBJECT || var->type==PIKE_T_FUNCTION) && !var->u.object->prog) \
    var=&dest_ob_zero; \
}while(0)

#define SAFE_IS_ZERO  )     ((X)->type==PIKE_T_INT?(X)->u.integer==0:(1<<(X)->type)&(BIT_OBJECT|BIT_FUNCTION)?!safe_svalue_is_true(X):0)
 

#define sub_ref  )     (--(X)->refs > 0)
 

#define swap_svalues   swap_svalues
 

#define swap_svalues_unlocked X,
 ) 
 

Value:

do {            \
  struct svalue *_a=(X);                                \
  struct svalue *_b=(Y);                                \
  struct svalue _tmp;                                   \
  assert_svalue_locked(_a); assert_svalue_locked(_b);   \
  dmalloc_touch_svalue(_a);                             \
  dmalloc_touch_svalue(_b);                             \
  _tmp=*_a; *_a=*_b; *_b=_tmp;                          \
}while(0)

#define T_AND   254
 

#define T_ARRAY   PIKE_T_ARRAY
 

#define T_ARRAY_LVALUE   250
 

#define T_ASSIGN   245
 

#define T_DELETED   246
 

#define T_FLOAT   PIKE_T_FLOAT
 

#define T_FUNCTION   PIKE_T_FUNCTION
 

#define T_INT   PIKE_T_INT
 

#define T_MANY   17
 

#define T_MAPPING   PIKE_T_MAPPING
 

#define T_MAPPING_DATA   10001
 

#define T_MIXED   PIKE_T_MIXED
 

#define T_MULTISET   PIKE_T_MULTISET
 

#define T_MULTISET_DATA   10003
 

#define T_NOT   253
 

#define T_OBJ_INDEX   248
 

#define T_OBJECT   PIKE_T_OBJECT
 

#define T_OR   255
 

#define T_PIKE_FRAME   10002
 

#define T_PROGRAM   PIKE_T_PROGRAM
 

#define T_SCOPE   PIKE_T_SCOPE
 

#define T_STORAGE   10000
 

#define T_STRING   PIKE_T_STRING
 

#define T_STRUCT_CALLABLE   10004
 

#define T_SVALUE_PTR   249
 

#define T_TUPLE   PIKE_T_TUPLE
 

#define T_TYPE   PIKE_T_TYPE
 

#define T_UNFINISHED   15
 

#define T_VOID   16
 

#define T_ZERO   PIKE_T_ZERO
 

#define tAnd X,
 )     "\376" X Y
 

#define tAny   tOr(tVoid,tMix)
 

#define tArr VAL   )     "\000" VAL
 

#define tArray   tArr(tMix)
 

#define tByte   "\010\000\000\000\000\000\000\000\377"
 

#define tCallable   tOr3(tArr(tSimpleCallable),tFunction,tObj)
 

#define tComplex   tOr6(tArray,tMapping,tMultiset,tObj,tFunction,tPrg(tObj))
 

#define tFloat   "\011"
 

#define tFlt   "\011"
 

#define tFunc ARGS,
RET   )     MagictFunc(RET,ARGS)
 

#define tFunction   tFuncV("" ,tOr(tZero,tVoid),tOr(tMix,tVoid))
 

#define tFuncV ARGS,
REST,
RET   )     MagictFuncV(RET,REST,ARGS)
 

#define tIfnot X,
 )     tAnd(tNot(X),Y)
 

#define tInt   "\010\200\000\000\000\177\377\377\377"
 

#define tInt0   "\010\000\000\000\000\000\000\000\000"
 

#define tInt01   "\010\000\000\000\000\000\000\000\001"
 

#define tInt02   "\010\000\000\000\000\000\000\000\002"
 

#define tInt03   "\010\000\000\000\000\000\000\000\003"
 

#define tInt04   "\010\000\000\000\000\000\000\000\004"
 

#define tInt05   "\010\000\000\000\000\000\000\000\005"
 

#define tInt06   "\010\000\000\000\000\000\000\000\006"
 

#define tInt1   "\010\000\000\000\001\000\000\000\001"
 

#define tInt1Plus   "\010\000\000\000\001\177\377\377\377"
 

#define tInt2   "\010\000\000\000\002\000\000\000\002"
 

#define tInt2Plus   "\010\000\000\000\002\177\377\377\377"
 

#define tInt_10   "\010\377\377\377\377\000\000\000\000"
 

#define tInt_11   "\010\377\377\377\377\000\000\000\001"
 

#define tIntPos   "\010\000\000\000\000\177\377\377\377"
 

#define tMap IND,
VAL   )     "\001" IND VAL
 

#define tMapping   tMap(tMix,tMix)
 

#define tMix   "\373"
 

#define tMixed   "\373"
 

#define tMultiset   tSet(tMix)
 

#define tName X,
 )     "\361\0"X"\0"Y
 

#define tName1 X,
 )     "\361\1"X"\0\0"Y
 

#define tName2 X,
 )     "\361\2"X"\0\0\0\0"Y
 

#define tNone   ""
 

#define tNot  )     "\375" X
 

#define tObj   "\003\000\000\000\000\000"
 

#define tOr X,
 )     "\377" X Y
 

#define tOr3 X,
Y,
 )     tOr(X,tOr(Y,Z))
 

#define tOr4 X,
Y,
Z,
 )     tOr(X,tOr(Y,tOr(Z,A)))
 

#define tOr5 X,
Y,
Z,
A,
 )     tOr(X,tOr(Y,tOr(Z,tOr(A,B))))
 

#define tOr6 X,
Y,
Z,
A,
B,
 )     tOr(X,tOr(Y,tOr(Z,tOr(A,tOr(B,C)))))
 

#define tOr7 X,
Y,
Z,
A,
B,
C,
 )     tOr(X,tOr(Y,tOr(Z,tOr(A,tOr(B,tOr(C,D))))))
 

#define tOr8 A,
B,
C,
D,
E,
F,
G,
 )     tOr(A,tOr7(B,C,D,E,F,G,H))
 

#define tOr9 A,
B,
C,
D,
E,
F,
G,
H,
 )     tOr(A,tOr8(B,C,D,E,F,G,H,I))
 

#define tPrg  )     "\005" X
 

#define tProgram  )     "\005" X
 

#define tQuad T1,
T2,
T3,
T4   )     tTriple(tTuple(T1, T2), T3, T4)
 

#define tRef   tOr(tString,tComplex)
 

#define tScope X,
 )     "\363" #X Y
 

#define tSet IND   )     "\002" IND
 

#define tSetvar X,
 )     "\365" #X Y
 

#define tSimpleCallable   tOr3(tArray,tFunction,tObj)
 

#define tStr   "\006"
 

#define tString   "\006"
 

#define tStringIndicable   tOr5(tMapping,tObj,tFunction,tPrg(tObj),tMultiset)
 

#define tTriple T1,
T2,
T3   )     tTuple(T1, tTuple(T2, T3))
 

#define tTuple T1,
T2   )     "\364" T1 T2
 

#define tType  )     "\007" T
 

#define tVar  )     #X
 

#define tVoid   "\020"
 

#define tZero   "\016"
 

#define UNSAFE_IS_ZERO  )     ((X)->type==PIKE_T_INT?(X)->u.integer==0:(1<<(X)->type)&(BIT_OBJECT|BIT_FUNCTION)?!svalue_is_true(X):0)
 


Typedef Documentation

typedef struct node_s node
 


Function Documentation

PMOD_EXPORT void assign_from_short_svalue_no_free struct svalue s,
const union anything u,
TYPE_T  type
 

PMOD_EXPORT void assign_short_svalue union anything to,
const union anything from,
TYPE_T  type
 

PMOD_EXPORT void assign_short_svalue_no_free union anything to,
const union anything from,
TYPE_T  type
 

PMOD_EXPORT TYPE_FIELD assign_svalues struct svalue to,
const struct svalue from,
size_t  num,
TYPE_FIELD  type_hint
 

PMOD_EXPORT TYPE_FIELD assign_svalues_no_free struct svalue to,
const struct svalue from,
size_t  num,
TYPE_FIELD  type_hint
 

PMOD_EXPORT void assign_to_short_svalue union anything u,
TYPE_T  type,
const struct svalue s
 

PMOD_EXPORT void assign_to_short_svalue_no_free union anything u,
TYPE_T  type,
const struct svalue s
 

void check_short_svalue const union anything u,
TYPE_T  type
 

PMOD_EXPORT void copy_svalues_recursively_no_free struct svalue to,
const struct svalue from,
size_t  num,
struct mapping m
 

void debug_check_svalue const struct svalue s  ) 
 

void debug_check_type_hint const struct svalue svals,
size_t  num,
TYPE_FIELD  type_hint
 

PMOD_EXPORT void debug_free_mixed_svalues struct svalue s,
size_t  num,
INT32 type_hint  DMALLOC_LINE_ARGS
 

PMOD_EXPORT void debug_free_svalues struct svalue s,
size_t  num,
INT32 type_hint  DMALLOC_LINE_ARGS
 

PMOD_EXPORT void describe_svalue const struct svalue s,
int  indent,
struct processing p
 

PMOD_EXPORT void do_free_svalue struct svalue s  ) 
 

void gc_check_weak_short_svalue const union anything u,
TYPE_T  type
 

void gc_check_weak_svalues const struct svalue s,
size_t  num
 

int gc_cycle_check_weak_short_svalue union anything u,
TYPE_T  type
 

TYPE_FIELD gc_cycle_check_weak_svalues struct svalue s,
size_t  num
 

int gc_mark_weak_short_svalue union anything u,
TYPE_T  type
 

TYPE_FIELD gc_mark_weak_svalues struct svalue s,
size_t  num
 

int gc_mark_weak_without_recurse struct svalue s  ) 
 

int gc_mark_without_recurse struct svalue s  ) 
 

PMOD_EXPORT unsigned INT32 hash_svalue const struct svalue s  ) 
 

PMOD_EXPORT int is_eq const struct svalue a,
const struct svalue b
 

PMOD_EXPORT int is_equal const struct svalue a,
const struct svalue b
 

PMOD_EXPORT int is_identical const struct svalue a,
const struct svalue b
 

PMOD_EXPORT int is_le const struct svalue a,
const struct svalue b
 

PMOD_EXPORT int is_lt const struct svalue a,
const struct svalue b
 

PMOD_EXPORT int low_is_equal const struct svalue a,
const struct svalue b,
struct processing p
 

PMOD_EXPORT int low_short_is_equal const union anything a,
const union anything b,
TYPE_T  type,
struct processing p
 

PMOD_EXPORT INT32 pike_sizeof const struct svalue s  ) 
 

PMOD_EXPORT void print_short_svalue FILE *  out,
const union anything a,
TYPE_T  type
 

PMOD_EXPORT void print_short_svalue_compact FILE *  out,
const union anything a,
TYPE_T  type
 

PMOD_EXPORT void print_svalue FILE *  out,
const struct svalue s
 

PMOD_EXPORT void print_svalue_compact FILE *  out,
const struct svalue s
 

PMOD_EXPORT void real_gc_check_short_svalue const union anything u,
TYPE_T  type
 

PMOD_EXPORT void real_gc_check_svalues const struct svalue s,
size_t  num
 

PMOD_EXPORT int real_gc_cycle_check_short_svalue union anything u,
TYPE_T  type
 

PMOD_EXPORT TYPE_FIELD real_gc_cycle_check_svalues struct svalue s,
size_t  num
 

void real_gc_free_short_svalue union anything u,
TYPE_T  type
 

void real_gc_free_svalue struct svalue s  ) 
 

PMOD_EXPORT void real_gc_mark_external_svalues const struct svalue s,
ptrdiff_t  num,
const char *  place
 

int real_gc_mark_short_svalue union anything u,
TYPE_T  type
 

PMOD_EXPORT TYPE_FIELD real_gc_mark_svalues struct svalue s,
size_t  num
 

PMOD_EXPORT void really_free_short_svalue_ptr void **  s,
TYPE_T  type
 

PMOD_EXPORT void really_free_svalue struct svalue s  ) 
 

PMOD_EXPORT int safe_svalue_is_true const struct svalue s  ) 
 

PMOD_EXPORT int svalue_is_true const struct svalue s  ) 
 

int svalues_are_constant struct svalue s,
INT32  num,
TYPE_FIELD  hint,
struct processing p
 


Variable Documentation

const struct svalue dest_ob_zero
 


Generated on Fri Jul 22 23:44:30 2005 for Pike by  doxygen 1.3.9.1