cb2256 | 1995-10-11 | Fredrik Hübinette (Hubbe) | | |
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | ||| This file a part of Pike, and is copyright by Fredrik Hubinette
||| Pike is distributed as GPL (General Public License)
|
cb2256 | 1995-10-11 | Fredrik Hübinette (Hubbe) | | ||| See the files COPYING and DISCLAIMER for more information.
\*/
|
24ddc7 | 1998-03-28 | Henrik Grubbström (Grubba) | |
|
19c79c | 2000-06-29 | Henrik Grubbström (Grubba) | | * $Id: svalue.h,v 1.57 2000/06/29 16:44:24 grubba Exp $
|
24ddc7 | 1998-03-28 | Henrik Grubbström (Grubba) | | */
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | #ifndef SVALUE_H
#define SVALUE_H
|
bed960 | 1997-05-19 | Fredrik Hübinette (Hubbe) | | #include "global.h"
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
dfa5b3 | 1996-12-05 | Fredrik Hübinette (Hubbe) | | #ifndef STRUCT_ARRAY_DECLARED
#define STRUCT_ARRAY_DECLARED
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | struct array;
|
dfa5b3 | 1996-12-05 | Fredrik Hübinette (Hubbe) | | #endif
#ifndef STRUCT_MAPPING_DECLARED
#define STRUCT_MAPPING_DECLARED
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | struct mapping;
|
dfa5b3 | 1996-12-05 | Fredrik Hübinette (Hubbe) | | #endif
#ifndef STRUCT_MULTISET_DECLARED
#define STRUCT_MULTISET_DECLARED
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | struct multiset;
|
dfa5b3 | 1996-12-05 | Fredrik Hübinette (Hubbe) | | #endif
#ifndef STRUCT_OBJECT_DECLARED
#define STRUCT_OBJECT_DECLARED
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | struct object;
|
dfa5b3 | 1996-12-05 | Fredrik Hübinette (Hubbe) | | #endif
#ifndef STRUCT_PROGRAM_DECLARED
#define STRUCT_PROGRAM_DECLARED
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | struct program;
|
dfa5b3 | 1996-12-05 | Fredrik Hübinette (Hubbe) | | #endif
#ifndef STRUCT_PIKE_STRING_DECLARED
#define STRUCT_PIKE_STRING_DECLARED
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | struct pike_string;
|
dfa5b3 | 1996-12-05 | Fredrik Hübinette (Hubbe) | | #endif
#ifndef STRUCT_CALLABLE_DECLARED
#define STRUCT_CALLABLE_DECLARED
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | struct callable;
|
dfa5b3 | 1996-12-05 | Fredrik Hübinette (Hubbe) | | #endif
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
struct processing
{
struct processing *next;
void *pointer_a, *pointer_b;
};
union anything
{
struct callable *efun;
struct array *array;
struct mapping *mapping;
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | struct multiset *multiset;
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | struct object *object;
struct program *program;
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | struct pike_string *string;
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | INT32 *refs;
|
8a222b | 1998-02-27 | Fredrik Hübinette (Hubbe) | | INT_TYPE integer;
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | FLOAT_TYPE float_number;
struct svalue *lval;
union anything *short_lval;
};
|
dfa5b3 | 1996-12-05 | Fredrik Hübinette (Hubbe) | | #ifndef STRUCT_SVALUE_DECLARED
#define STRUCT_SVALUE_DECLARED
#endif
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | struct svalue
{
|
39e0bd | 1996-06-09 | Fredrik Hübinette (Hubbe) | | unsigned INT16 type;
|
bdb509 | 1996-09-25 | Fredrik Hübinette (Hubbe) | | unsigned INT16 subtype;
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | union anything u;
};
|
0542ef | 1999-11-17 | Fredrik Hübinette (Hubbe) | | #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
|
538e81 | 1999-12-10 | Henrik Grubbström (Grubba) | | #define PIKE_T_TYPE 7 /* Not supported yet */
|
5a5944 | 1999-12-11 | Henrik Grubbström (Grubba) | | #define PIKE_T_INT 8
#define PIKE_T_FLOAT 9
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
5bd05e | 1999-11-23 | Henrik Grubbström (Grubba) | | #define PIKE_T_ZERO 14 /* Can return 0, but nothing else */
#define T_UNFINISHED 15 /* Reserved for the garbage-collector */
#define T_VOID 16 /* Can't return any value */
#define T_MANY 17
|
3c04e8 | 1997-03-13 | Fredrik Hübinette (Hubbe) | |
|
538e81 | 1999-12-10 | Henrik Grubbström (Grubba) | | #define PIKE_T_SCOPE 243 /* Not supported yet */
#define PIKE_T_TUPLE 244 /* Not supported yet */
|
9e5238 | 1998-03-01 | Fredrik Hübinette (Hubbe) | | #define T_ASSIGN 245
|
39e0bd | 1996-06-09 | Fredrik Hübinette (Hubbe) | | #define T_DELETED 246
|
fe2559 | 1999-12-19 | Henrik Grubbström (Grubba) | | #define T_UNKNOWN 247
#define T_SHORT_LVALUE 248
#define T_LVALUE 249
#define T_ARRAY_LVALUE 250
#define T_MIXED 251
#define T_NOT 253
#define T_AND 254
#define T_OR 255
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
54db6c | 1999-03-27 | Henrik Grubbström (Grubba) | |
|
45ee5d | 1999-02-10 | Fredrik Hübinette (Hubbe) | | #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"
|
efa5fa | 1999-08-06 | Fredrik Hübinette (Hubbe) | |
#define tFuncV(ARGS,REST,RET) MagictFuncV(RET,REST,ARGS)
#define tFunc(ARGS,RET) MagictFunc(RET,ARGS)
|
538e81 | 1999-12-10 | Henrik Grubbström (Grubba) | | #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)
|
efa5fa | 1999-08-06 | Fredrik Hübinette (Hubbe) | |
#define MagictFuncV(RET,REST,ARGS) "\004" ARGS "\021" REST RET
#define MagictFunc(RET,ARGS) tFuncV(ARGS "", tVoid, RET)
|
3123ab | 2000-01-03 | Martin Stjernholm | | #define tFunction tFuncV("" ,tOr(tZero,tVoid),tOr(tMix,tVoid))
|
e64f5a | 1999-06-19 | Fredrik Hübinette (Hubbe) | | #define tNone ""
|
45ee5d | 1999-02-10 | Fredrik Hübinette (Hubbe) | | #define tPrg "\005"
#define tProgram "\005"
#define tStr "\006"
#define tString "\006"
|
538e81 | 1999-12-10 | Henrik Grubbström (Grubba) | | #define tType "\007"
|
5a5944 | 1999-12-11 | Henrik Grubbström (Grubba) | | #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"
|
c3965a | 2000-04-19 | Henrik Grubbström (Grubba) | | #define tInt2 "\010\000\000\000\002\000\000\000\002"
|
5a5944 | 1999-12-11 | Henrik Grubbström (Grubba) | | #define tInt01 "\010\000\000\000\000\000\000\000\001"
|
69dfee | 1999-12-14 | Martin Stjernholm | | #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"
|
5a5944 | 1999-12-11 | Henrik Grubbström (Grubba) | | #define tIntPos "\010\000\000\000\000\177\377\377\377"
|
c3965a | 2000-04-19 | Henrik Grubbström (Grubba) | | #define tInt1Plus "\010\000\000\000\001\177\377\377\377"
#define tInt2Plus "\010\000\000\000\002\177\377\377\377"
|
5a5944 | 1999-12-11 | Henrik Grubbström (Grubba) | | #define tByte "\010\000\000\000\000\000\000\000\377"
|
fe2559 | 1999-12-19 | Henrik Grubbström (Grubba) | | #define tFlt "\011"
#define tFloat "\011"
|
45ee5d | 1999-02-10 | Fredrik Hübinette (Hubbe) | |
|
5bd05e | 1999-11-23 | Henrik Grubbström (Grubba) | | #define tZero "\016"
|
45ee5d | 1999-02-10 | Fredrik Hübinette (Hubbe) | | #define tVoid "\020"
#define tVar(X) #X
#define tSetvar(X,Y) "\365" #X Y
|
538e81 | 1999-12-10 | Henrik Grubbström (Grubba) | | #define tScope(X,T) "\363" #X Y
|
fe2559 | 1999-12-19 | Henrik Grubbström (Grubba) | | #define tNot(X) "\375" X
#define tAnd(X,Y) "\376" X Y
#define tOr(X,Y) "\377" X Y
|
45ee5d | 1999-02-10 | Fredrik Hübinette (Hubbe) | | #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))))))
|
b93cd7 | 1999-07-27 | Mirar (Pontus Hagland) | | #define tOr8(A,B,C,D,E,F,G,H) tOr(A,tOr7(B,C,D,E,F,G,H))
|
fe2559 | 1999-12-19 | Henrik Grubbström (Grubba) | | #define tMix "\373"
#define tMixed "\373"
|
45ee5d | 1999-02-10 | Fredrik Hübinette (Hubbe) | | #define tComplex tOr6(tArray,tMapping,tMultiset,tObj,tFunction,tProgram)
|
b93cd7 | 1999-07-27 | Mirar (Pontus Hagland) | | #define tStringIndicable tOr5(tMapping,tObj,tFunction,tProgram,tMultiset)
|
45ee5d | 1999-02-10 | Fredrik Hübinette (Hubbe) | | #define tRef tOr(tString,tComplex)
#define tIfnot(X,Y) tAnd(tNot(X),Y)
|
be0770 | 1999-11-25 | Martin Stjernholm | | #define tAny tOr(tVoid,tMix)
|
45ee5d | 1999-02-10 | Fredrik Hübinette (Hubbe) | |
|
0542ef | 1999-11-17 | Fredrik Hübinette (Hubbe) | | #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)
|
538e81 | 1999-12-10 | Henrik Grubbström (Grubba) | | #define BIT_TYPE (1<<PIKE_T_TYPE)
|
0542ef | 1999-11-17 | Fredrik Hübinette (Hubbe) | | #define BIT_INT (1<<PIKE_T_INT)
#define BIT_FLOAT (1<<PIKE_T_FLOAT)
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
5bd05e | 1999-11-23 | Henrik Grubbström (Grubba) | | #define BIT_ZERO (1<<PIKE_T_ZERO)
|
3c04e8 | 1997-03-13 | Fredrik Hübinette (Hubbe) | |
|
4eb50a | 1996-05-16 | Fredrik Hübinette (Hubbe) | |
|
5bd05e | 1999-11-23 | Henrik Grubbström (Grubba) | | #define BIT_UNFINISHED (1 << T_UNFINISHED)
|
4eb50a | 1996-05-16 | Fredrik Hübinette (Hubbe) | |
|
3c04e8 | 1997-03-13 | Fredrik Hübinette (Hubbe) | |
|
5bd05e | 1999-11-23 | Henrik Grubbström (Grubba) | | #define BIT_VOID (1 << T_VOID)
|
3c04e8 | 1997-03-13 | Fredrik Hübinette (Hubbe) | |
#define BIT_MANY (1 << T_MANY)
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | #define BIT_NOTHING 0
|
4eb50a | 1996-05-16 | Fredrik Hübinette (Hubbe) | | #define BIT_MIXED 0x7fff
|
538e81 | 1999-12-10 | Henrik Grubbström (Grubba) | | #define BIT_BASIC (BIT_INT|BIT_FLOAT|BIT_STRING|BIT_TYPE)
|
575666 | 1996-09-23 | Fredrik Hübinette (Hubbe) | | #define BIT_COMPLEX (BIT_ARRAY|BIT_MULTISET|BIT_OBJECT|BIT_PROGRAM|BIT_MAPPING|BIT_FUNCTION)
|
898bb9 | 1999-06-07 | Fredrik Hübinette (Hubbe) | | #define BIT_CALLABLE (BIT_FUNCTION|BIT_PROGRAM|BIT_ARRAY|BIT_OBJECT)
|
624d09 | 1996-02-24 | Fredrik Hübinette (Hubbe) | |
|
7e97c3 | 1999-01-21 | Fredrik Hübinette (Hubbe) | |
|
0542ef | 1999-11-17 | Fredrik Hübinette (Hubbe) | | #define MAX_COMPLEX PIKE_T_PROGRAM
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
538e81 | 1999-12-10 | Henrik Grubbström (Grubba) | | #define MAX_REF_TYPE PIKE_T_TYPE
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
5a5944 | 1999-12-11 | Henrik Grubbström (Grubba) | | #define MAX_TYPE PIKE_T_FLOAT
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
#define NUMBER_NUMBER 0
#define NUMBER_UNDEFINED 1
#define NUMBER_DESTRUCTED 2
|
bdb509 | 1996-09-25 | Fredrik Hübinette (Hubbe) | | #define FUNCTION_BUILTIN USHRT_MAX
|
bce86c | 1996-02-25 | Fredrik Hübinette (Hubbe) | | #define is_gt(a,b) is_lt(b,a)
|
0542ef | 1999-11-17 | Fredrik Hübinette (Hubbe) | | #define IS_ZERO(X) ((X)->type==PIKE_T_INT?(X)->u.integer==0:(1<<(X)->type)&(BIT_OBJECT|BIT_FUNCTION)?!svalue_is_true(X):0)
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
0542ef | 1999-11-17 | Fredrik Hübinette (Hubbe) | | #define IS_UNDEFINED(X) ((X)->type==PIKE_T_INT&&!(X)->u.integer&&(X)->subtype==1)
|
3495fe | 1997-02-06 | Fredrik Hübinette (Hubbe) | |
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | #define check_destructed(S) \
do{ \
struct svalue *_s=(S); \
|
0542ef | 1999-11-17 | Fredrik Hübinette (Hubbe) | | if((_s->type == PIKE_T_OBJECT || _s->type==PIKE_T_FUNCTION) && !_s->u.object->prog) { \
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | free_object(_s->u.object); \
|
0542ef | 1999-11-17 | Fredrik Hübinette (Hubbe) | | _s->type = PIKE_T_INT; \
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | _s->subtype = NUMBER_DESTRUCTED ; \
_s->u.integer = 0; \
} \
}while(0)
|
453f4c | 1996-08-12 | Fredrik Hübinette (Hubbe) | |
#define safe_check_destructed(var) do{ \
|
0542ef | 1999-11-17 | Fredrik Hübinette (Hubbe) | | if((var->type == PIKE_T_OBJECT || var->type==PIKE_T_FUNCTION) && !var->u.object->prog) \
|
453f4c | 1996-08-12 | Fredrik Hübinette (Hubbe) | | var=&dest_ob_zero; \
}while(0)
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | #define check_short_destructed(U,T) \
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)
|
71f3a2 | 1998-11-22 | Fredrik Hübinette (Hubbe) | | #ifdef PIKE_DEBUG
|
a4033e | 2000-04-14 | Fredrik Hübinette (Hubbe) | | extern void describe(void *);
|
ae9503 | 1999-04-07 | Fredrik Hübinette (Hubbe) | | #define check_type(T) if(T > MAX_TYPE && T!=T_LVALUE && T!=T_SHORT_LVALUE && T!=T_VOID && T!=T_DELETED && T!=T_ARRAY_LVALUE) fatal("Type error: %d\n",T)
|
a4033e | 2000-04-14 | Fredrik Hübinette (Hubbe) | |
|
433d5d | 2000-06-16 | Fredrik Hübinette (Hubbe) | | #define check_svalue(S) debug_check_svalue(dmalloc_check_svalue(S,DMALLOC_LOCATION()))
|
e2d9e6 | 2000-06-10 | Martin Stjernholm | |
|
a4033e | 2000-04-14 | Fredrik Hübinette (Hubbe) | | #define check_refs(S) do {\
|
0d3fd4 | 2000-04-17 | Martin Stjernholm | | if((S)->type <= MAX_REF_TYPE && (!(S)->u.refs || (S)->u.refs[0] < 0)) { \
|
a4033e | 2000-04-14 | Fredrik Hübinette (Hubbe) | | describe((S)->u.refs); \
fatal("Svalue to object without references.\n"); \
} }while(0)
#define check_refs2(S,T) do { \
|
0d3fd4 | 2000-04-17 | Martin Stjernholm | | if((T) <= MAX_REF_TYPE && (S)->refs && (S)->refs[0] <= 0) {\
|
a4033e | 2000-04-14 | Fredrik Hübinette (Hubbe) | | describe((S)->refs); \
fatal("(short) Svalue to object without references.\n"); \
} }while(0)
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
8c8337 | 1998-04-16 | Fredrik Hübinette (Hubbe) | | #ifdef DEBUG_MALLOC
|
ead205 | 2000-06-16 | Fredrik Hübinette (Hubbe) | | static inline struct svalue *dmalloc_check_svalue(struct svalue *s, char *l)
{
debug_malloc_update_location(s,l);
|
433d5d | 2000-06-16 | Fredrik Hübinette (Hubbe) | | #if 0
|
ead205 | 2000-06-16 | Fredrik Hübinette (Hubbe) | | if(s->type <= MAX_REF_TYPE)
debug_malloc_update_location(s->u.refs,l);
|
433d5d | 2000-06-16 | Fredrik Hübinette (Hubbe) | | #endif
|
ead205 | 2000-06-16 | Fredrik Hübinette (Hubbe) | | return s;
}
|
433d5d | 2000-06-16 | Fredrik Hübinette (Hubbe) | | static inline union anything *dmalloc_check_union(union anything *u,int type, char * l)
|
ead205 | 2000-06-16 | Fredrik Hübinette (Hubbe) | | {
debug_malloc_update_location(u,l);
|
433d5d | 2000-06-16 | Fredrik Hübinette (Hubbe) | | #if 0
|
ead205 | 2000-06-16 | Fredrik Hübinette (Hubbe) | | if(type <= MAX_REF_TYPE)
debug_malloc_update_location(u->refs,l);
|
433d5d | 2000-06-16 | Fredrik Hübinette (Hubbe) | | #endif
|
ead205 | 2000-06-16 | Fredrik Hübinette (Hubbe) | | return u;
}
|
8c8337 | 1998-04-16 | Fredrik Hübinette (Hubbe) | | #define add_ref(X) ((INT32 *)debug_malloc_pass( &((X)->refs)))[0]++
#else
|
ead205 | 2000-06-16 | Fredrik Hübinette (Hubbe) | | #define dmalloc_check_svalue(S,L) (S)
#define dmalloc_check_union(U,T,L) (U)
|
8c8337 | 1998-04-16 | Fredrik Hübinette (Hubbe) | | #define add_ref(X) (X)->refs++
#endif
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | #else
|
e2d9e6 | 2000-06-10 | Martin Stjernholm | | #define check_svalue(S)
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | #define check_type(T)
#define check_refs(S)
#define check_refs2(S,T)
|
8c8337 | 1998-04-16 | Fredrik Hübinette (Hubbe) | | #define add_ref(X) (X)->refs++
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
#endif
|
1e4e5f | 2000-04-07 | Fredrik Hübinette (Hubbe) | | #define free_svalue(X) do { struct svalue *_s=(X); check_type(_s->type); check_refs(_s); if(_s->type<=MAX_REF_TYPE) { debug_malloc_touch(_s->u.refs); if(--*(_s->u.refs) <=0) { really_free_svalue(_s); } DO_IF_DMALLOC(_s->u.refs=(void *)-1;) }}while(0)
#define free_short_svalue(X,T) do { union anything *_s=(X); TYPE_T _t=(T); check_type(_t); check_refs2(_s,_t); if(_t<=MAX_REF_TYPE && _s->refs) if(--*(_s->refs) <= 0) { really_free_short_svalue(_s,_t); } DO_IF_DMALLOC(_s->refs=(void *)-1;) }while(0)
|
d9ec8a | 1999-06-09 | Mirar (Pontus Hagland) | | #define add_ref_svalue(X) do { struct svalue *_tmp=(X); check_type(_tmp->type); check_refs(_tmp); if(_tmp->type <= MAX_REF_TYPE) { debug_malloc_touch(_tmp->u.refs); _tmp->u.refs[0]++; } }while(0)
|
3c0c28 | 1998-01-26 | Fredrik Hübinette (Hubbe) | | #define assign_svalue_no_free(X,Y) do { struct svalue _tmp, *_to=(X), *_from=(Y); check_type(_from->type); check_refs(_from); *_to=_tmp=*_from; if(_tmp.type <= MAX_REF_TYPE) { debug_malloc_touch(_tmp.u.refs); _tmp.u.refs[0]++; } }while(0)
|
d3d172 | 1997-01-31 | Fredrik Hübinette (Hubbe) | | #define assign_svalue(X,Y) do { struct svalue *_to2=(X), *_from2=(Y); free_svalue(_to2); assign_svalue_no_free(_to2, _from2); }while(0)
|
453f4c | 1996-08-12 | Fredrik Hübinette (Hubbe) | | extern struct svalue dest_ob_zero;
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
07ae47 | 1998-04-23 | Fredrik Hübinette (Hubbe) | | #ifdef DEBUG_MALLOC
|
20f7a0 | 2000-03-20 | Fredrik Hübinette (Hubbe) | | #define free_svalues(X,Y,Z) debug_free_svalues((X),(Y),(Z), DMALLOC_LOCATION())
|
07ae47 | 1998-04-23 | Fredrik Hübinette (Hubbe) | | #else
#define free_svalues(X,Y,Z) debug_free_svalues((X),(Y),(Z))
#endif
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
98af0d | 1998-04-07 | Fredrik Hübinette (Hubbe) | | void really_free_short_svalue(union anything *s, TYPE_T type);
|
d3d172 | 1997-01-31 | Fredrik Hübinette (Hubbe) | | void really_free_svalue(struct svalue *s);
|
569d5e | 1998-09-18 | Fredrik Hübinette (Hubbe) | | void do_free_svalue(struct svalue *s);
|
19c79c | 2000-06-29 | Henrik Grubbström (Grubba) | | void debug_free_svalues(struct svalue *s, size_t num, INT32 type_hint DMALLOC_LINE_ARGS);
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | void assign_svalues_no_free(struct svalue *to,
struct svalue *from,
|
19c79c | 2000-06-29 | Henrik Grubbström (Grubba) | | size_t num,
|
fc7695 | 1996-02-17 | Fredrik Hübinette (Hubbe) | | INT32 type_hint);
|
99946c | 1996-02-17 | Fredrik Hübinette (Hubbe) | | void assign_svalues(struct svalue *to,
struct svalue *from,
|
19c79c | 2000-06-29 | Henrik Grubbström (Grubba) | | size_t num,
|
99946c | 1996-02-17 | Fredrik Hübinette (Hubbe) | | TYPE_FIELD types);
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | void assign_to_short_svalue(union anything *u,
TYPE_T type,
struct svalue *s);
void assign_to_short_svalue_no_free(union anything *u,
|
fc7695 | 1996-02-17 | Fredrik Hübinette (Hubbe) | | TYPE_T type,
struct svalue *s);
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | void assign_from_short_svalue_no_free(struct svalue *s,
|
569d5e | 1998-09-18 | Fredrik Hübinette (Hubbe) | | union anything *u,
TYPE_T type);
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | void assign_short_svalue_no_free(union anything *to,
union anything *from,
TYPE_T type);
void assign_short_svalue(union anything *to,
union anything *from,
TYPE_T type);
|
07c073 | 1996-06-21 | Fredrik Hübinette (Hubbe) | | unsigned INT32 hash_svalue(struct svalue *s);
int svalue_is_true(struct svalue *s);
|
0e03f6 | 2000-01-27 | Fredrik Hübinette (Hubbe) | | int is_identical(struct svalue *a, struct svalue *b);
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | int is_eq(struct svalue *a, struct svalue *b);
int low_is_equal(struct svalue *a,
struct svalue *b,
struct processing *p);
int low_short_is_equal(const union anything *a,
const union anything *b,
TYPE_T type,
struct processing *p);
int is_equal(struct svalue *a,struct svalue *b);
|
07c073 | 1996-06-21 | Fredrik Hübinette (Hubbe) | | int is_lt(struct svalue *a,struct svalue *b);
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | void describe_svalue(struct svalue *s,int indent,struct processing *p);
|
0e03f6 | 2000-01-27 | Fredrik Hübinette (Hubbe) | | void print_svalue (FILE *out, struct svalue *s);
|
19c79c | 2000-06-29 | Henrik Grubbström (Grubba) | | void clear_svalues(struct svalue *s, size_t num);
void clear_svalues_undefined(struct svalue *s, size_t num);
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | void copy_svalues_recursively_no_free(struct svalue *to,
struct svalue *from,
|
19c79c | 2000-06-29 | Henrik Grubbström (Grubba) | | size_t num,
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | struct processing *p);
|
569d5e | 1998-09-18 | Fredrik Hübinette (Hubbe) | | void check_short_svalue(union anything *u, TYPE_T type);
|
e2d9e6 | 2000-06-10 | Martin Stjernholm | | void debug_check_svalue(struct svalue *s);
|
19c79c | 2000-06-29 | Henrik Grubbström (Grubba) | | void real_gc_xmark_svalues(struct svalue *s, size_t num);
TYPE_FIELD real_gc_check_svalues(struct svalue *s, size_t num);
|
1e4e5f | 2000-04-07 | Fredrik Hübinette (Hubbe) | | void real_gc_check_short_svalue(union anything *u, TYPE_T type);
|
19c79c | 2000-06-29 | Henrik Grubbström (Grubba) | | TYPE_FIELD gc_check_weak_svalues(struct svalue *s, size_t num);
|
e2d9e6 | 2000-06-10 | Martin Stjernholm | | void gc_check_weak_short_svalue(union anything *u, TYPE_T type);
|
19c79c | 2000-06-29 | Henrik Grubbström (Grubba) | | void real_gc_mark_svalues(struct svalue *s, size_t num);
|
e2d9e6 | 2000-06-10 | Martin Stjernholm | | void real_gc_mark_short_svalue(union anything *u, TYPE_T type);
|
19c79c | 2000-06-29 | Henrik Grubbström (Grubba) | | TYPE_FIELD gc_mark_weak_svalues(struct svalue *s, size_t num);
|
e2d9e6 | 2000-06-10 | Martin Stjernholm | | int gc_mark_weak_short_svalue(union anything *u, TYPE_T type);
|
19c79c | 2000-06-29 | Henrik Grubbström (Grubba) | | void real_gc_cycle_check_svalues(struct svalue *s, size_t num);
|
e2d9e6 | 2000-06-10 | Martin Stjernholm | | void real_gc_cycle_check_short_svalue(union anything *u, TYPE_T type);
|
19c79c | 2000-06-29 | Henrik Grubbström (Grubba) | | TYPE_FIELD gc_cycle_check_weak_svalues(struct svalue *s, size_t num);
|
e2d9e6 | 2000-06-10 | Martin Stjernholm | | int gc_cycle_check_weak_short_svalue(union anything *u, TYPE_T type);
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | INT32 pike_sizeof(struct svalue *s);
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
433d5d | 2000-06-16 | Fredrik Hübinette (Hubbe) | | #define gc_xmark_svalues(S,N) real_gc_xmark_svalues(dmalloc_check_svalue(S,DMALLOC_LOCATION()),N)
#define gc_check_svalues(S,N) real_gc_check_svalues(dmalloc_check_svalue(S,DMALLOC_LOCATION()),N)
#define gc_check_short_svalue(U,T) real_gc_check_short_svalue(dmalloc_check_union((U),(T),DMALLOC_LOCATION()),T)
#define gc_mark_svalues(S,N) real_gc_mark_svalues(dmalloc_check_svalue((S),DMALLOC_LOCATION()),N)
#define gc_mark_short_svalue(U,T) real_gc_mark_short_svalue(dmalloc_check_union((U),(T),DMALLOC_LOCATION()),T)
#define gc_cycle_check_svalues(S,N) real_gc_cycle_check_svalues(dmalloc_check_svalue(S,DMALLOC_LOCATION()),N)
#define gc_cycle_check_short_svalue(U,T) real_gc_cycle_check_short_svalue(dmalloc_check_union((U),(T),DMALLOC_LOCATION()),(T))
|
103dc0 | 2000-04-12 | Henrik Grubbström (Grubba) | |
|
0542ef | 1999-11-17 | Fredrik Hübinette (Hubbe) | | #ifndef NO_PIKE_SHORTHAND
#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
|
538e81 | 1999-12-10 | Henrik Grubbström (Grubba) | | #define T_TYPE PIKE_T_TYPE
|
0542ef | 1999-11-17 | Fredrik Hübinette (Hubbe) | | #define T_FLOAT PIKE_T_FLOAT
#define T_INT PIKE_T_INT
|
5bd05e | 1999-11-23 | Henrik Grubbström (Grubba) | | #define T_ZERO PIKE_T_ZERO
|
538e81 | 1999-12-10 | Henrik Grubbström (Grubba) | | #define T_TUPLE PIKE_T_TUPLE
#define T_SCOPE PIKE_T_SCOPE
|
0542ef | 1999-11-17 | Fredrik Hübinette (Hubbe) | |
|
538e81 | 1999-12-10 | Henrik Grubbström (Grubba) | | #endif /* !NO_PIKE_SHORTHAND */
|
0542ef | 1999-11-17 | Fredrik Hübinette (Hubbe) | |
|
538e81 | 1999-12-10 | Henrik Grubbström (Grubba) | |
#endif /* !SVALUE_H */
|