e576bb | 2002-10-11 | Martin Nilsson | |
|
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"
|
c7f271 | 2007-06-09 | Martin Stjernholm | | #include "dmalloc.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) | |
|
38ac33 | 2003-11-14 | Martin Stjernholm | | #ifndef STRUCT_NODE_S_DECLARED
#define STRUCT_NODE_S_DECLARED
struct node_s;
typedef struct node_s node;
#endif
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | struct processing
{
struct processing *next;
void *pointer_a, *pointer_b;
};
|
13670c | 2015-05-25 | Martin Nilsson | |
|
45637c | 2001-04-07 | Fredrik Hübinette (Hubbe) | | struct ref_dummy;
|
e83eb9 | 2001-03-22 | Fredrik Hübinette (Hubbe) | |
|
67a0a3 | 2005-09-12 | H. William Welliver III | |
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | union anything
{
|
67a0a3 | 2005-09-12 | H. William Welliver III | | INT_TYPE integer;
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | 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;
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | | struct pike_type *type;
|
b032b9 | 2000-08-10 | Henrik Grubbström (Grubba) | | INT32 *refs;
|
e83eb9 | 2001-03-22 | Fredrik Hübinette (Hubbe) | | struct ref_dummy *dummy;
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | FLOAT_TYPE float_number;
|
67a0a3 | 2005-09-12 | H. William Welliver III | | int identifier;
struct svalue *lval;
|
a9e411 | 2001-12-10 | Martin Stjernholm | | void *ptr;
|
df8691 | 2008-03-29 | Martin Stjernholm | | #ifdef DEBUG_MALLOC
|
86100c | 2008-03-29 | Martin Stjernholm | | char *loc;
|
df8691 | 2008-03-29 | Martin Stjernholm | | #endif
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | };
|
dfa5b3 | 1996-12-05 | Fredrik Hübinette (Hubbe) | | #ifndef STRUCT_SVALUE_DECLARED
#define STRUCT_SVALUE_DECLARED
#endif
|
3cd748 | 2001-04-28 | Martin Stjernholm | |
|
c29940 | 2001-11-10 | Martin Stjernholm | | |
be227c | 2001-04-30 | Martin Stjernholm | | * bits in it internally. */
|
bf3c85 | 2014-06-26 | Henrik Grubbström (Grubba) | | #if !defined(HAVE_UNION_INIT) && !defined(NO_COMBINED_TYPE_SUBTYPE)
#define NO_COMBINED_TYPE_SUBTYPE
#endif
|
67a0a3 | 2005-09-12 | H. William Welliver III | |
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | struct svalue
{
|
bf3c85 | 2014-06-26 | Henrik Grubbström (Grubba) | | #ifndef NO_COMBINED_TYPE_SUBTYPE
|
a5cf65 | 2014-06-24 | Henrik Grubbström (Grubba) | | union {
struct {
unsigned short type;
unsigned short subtype;
} t;
|
6d89d1 | 2014-06-24 | Henrik Grubbström (Grubba) | | #if PIKE_BYTEORDER == 1234
|
a5cf65 | 2014-06-24 | Henrik Grubbström (Grubba) | | ptrdiff_t type_subtype;
|
6d89d1 | 2014-06-24 | Henrik Grubbström (Grubba) | | #else
INT32 type_subtype;
#if SIZEOF_CHAR_P == 8
INT32 pad__;
#endif
#endif
|
a5cf65 | 2014-06-24 | Henrik Grubbström (Grubba) | | } tu;
|
bf3c85 | 2014-06-26 | Henrik Grubbström (Grubba) | | #else /* NO_COMBINED_TYPE_SUBTYPE */
struct {
struct {
unsigned short type;
unsigned short subtype;
} t;
} tu;
#endif /* NO_COMBINED_TYPE_SUBTYPE */
|
67a0a3 | 2005-09-12 | H. William Welliver III | | union anything u;
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | };
|
bf3c85 | 2014-06-26 | Henrik Grubbström (Grubba) | | #define TYPEOF(SVAL) ((SVAL).tu.t.type)
#define SUBTYPEOF(SVAL) ((SVAL).tu.t.subtype)
#define SET_SVAL_TYPE(SVAL, TYPE) (TYPEOF(SVAL) = (TYPE))
#define SET_SVAL_SUBTYPE(SVAL, TYPE) (SUBTYPEOF(SVAL) = (TYPE))
#ifdef NO_COMBINED_TYPE_SUBTYPE
#define SET_SVAL_TYPE_SUBTYPE(SVAL, TYPE, SUBTYPE) \
((TYPEOF(SVAL) = (TYPE)), \
(SUBTYPEOF(SVAL) = (SUBTYPE)))
|
722f71 | 2014-06-28 | Henrik Grubbström (Grubba) | |
#define SET_SVAL_TYPE_DC(SVAL, TYPE) SET_SVAL_TYPE(SVAL, TYPE)
|
bf3c85 | 2014-06-26 | Henrik Grubbström (Grubba) | | #else
|
7666f8 | 2014-06-19 | Per Hedbor | | #if PIKE_BYTEORDER == 1234
|
ea4359 | 2014-07-02 | Arne Goedeke | | #define TYPE_SUBTYPE(X,Y) ((unsigned int)(X)|((unsigned int)(Y)<<16))
|
7666f8 | 2014-06-19 | Per Hedbor | | #else
|
ea4359 | 2014-07-02 | Arne Goedeke | | #define TYPE_SUBTYPE(X,Y) ((unsigned int)(Y)|((unsigned int)(X)<<16))
|
7666f8 | 2014-06-19 | Per Hedbor | | #endif
#define SET_SVAL_TYPE_SUBTYPE(SVAL, TYPE, SUBTYPE) \
|
a5cf65 | 2014-06-24 | Henrik Grubbström (Grubba) | | ((SVAL).tu.type_subtype = TYPE_SUBTYPE(TYPE,SUBTYPE))
|
722f71 | 2014-06-28 | Henrik Grubbström (Grubba) | |
#define SET_SVAL_TYPE_DC(SVAL, TYPE) SET_SVAL_TYPE_SUBTYPE(SVAL, TYPE, 0)
|
bf3c85 | 2014-06-26 | Henrik Grubbström (Grubba) | | #endif
|
7666f8 | 2014-06-19 | Per Hedbor | |
|
5d5f7e | 2012-07-22 | Bill Welliver | | #define SET_SVAL(SVAL, TYPE, SUBTYPE, FIELD, EXPR) do { \
|
c0c9c4 | 2011-10-23 | Henrik Grubbström (Grubba) | | /* Set the type afterwards to avoid a clobbered \
* svalue in case EXPR throws. */ \
|
a5cf65 | 2014-06-24 | Henrik Grubbström (Grubba) | | struct svalue * __sv_ptr = &( SVAL ); \
|
5d5f7e | 2012-07-22 | Bill Welliver | | __sv_ptr->u.FIELD = (EXPR); \
|
bf3c85 | 2014-06-26 | Henrik Grubbström (Grubba) | | SET_SVAL_TYPE_SUBTYPE(*__sv_ptr, TYPE, SUBTYPE); \
|
c0c9c4 | 2011-10-23 | Henrik Grubbström (Grubba) | | } while(0)
|
5d5f7e | 2012-07-22 | Bill Welliver | |
|
722f71 | 2014-06-28 | Henrik Grubbström (Grubba) | | #define INVALIDATE_SVAL(SVAL) SET_SVAL_TYPE_DC(SVAL, 99) /* an invalid type */
|
8b6207 | 2011-09-24 | Henrik Grubbström (Grubba) | |
|
833cae | 2013-06-12 | Henrik Grubbström (Grubba) | |
#define PIKE_T_INT 0
#define PIKE_T_FLOAT 1
#define PIKE_T_ARRAY 8
#define PIKE_T_MAPPING 9
#define PIKE_T_MULTISET 10
#define PIKE_T_OBJECT 11
#define PIKE_T_FUNCTION 12
#define PIKE_T_PROGRAM 13
#define PIKE_T_STRING 14
#define PIKE_T_TYPE 15
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
b6876b | 2007-04-21 | Henrik Grubbström (Grubba) | |
|
833cae | 2013-06-12 | Henrik Grubbström (Grubba) | |
#define PIKE_T_ZERO 6 /**< Can return 0, but nothing else */
|
67a0a3 | 2005-09-12 | H. William Welliver III | |
|
833cae | 2013-06-12 | Henrik Grubbström (Grubba) | | #define T_UNFINISHED 7
|
a90303 | 2003-02-16 | Martin Stjernholm | |
|
cc063b | 2014-12-07 | Henrik Grubbström (Grubba) | |
|
67a0a3 | 2005-09-12 | H. William Welliver III | | #define T_VOID 16 /**< Can't return any value. Also used on stack to fill out the second
|
a90303 | 2003-02-16 | Martin Stjernholm | | * svalue on an lvalue when it isn't used. */
|
5bd05e | 1999-11-23 | Henrik Grubbström (Grubba) | | #define T_MANY 17
|
3c04e8 | 1997-03-13 | Fredrik Hübinette (Hubbe) | |
|
13df5b | 2005-12-04 | Martin Nilsson | | #define PIKE_T_INT_UNTYPED 18 /* Optimization of int type size */
|
1ab4ac | 2008-01-26 | Martin Stjernholm | | /* Type to put in freed svalues. Only the type field in such svalues
* is defined. Freeing a PIKE_T_FREE svalue is allowed and does
* nothing. mark_free_svalue() is preferably used to set this type.
*
* Traditionally T_INT has been used for this without setting a proper
* subtype; if T_INT is to be used then the subtype must be set to
* NUMBER_NUMBER.
*
* PIKE_T_FREE svalues are recorded as BIT_INT in type hint fields.
*/
|
cc063b | 2014-12-07 | Henrik Grubbström (Grubba) | | #define PIKE_T_FREE 19
/** svalue.u.lval points to an svalue. Primarily used in lvalues on
* stack, but can also occur in arrays containing lvalue pairs.
*/
#define T_SVALUE_PTR 20
/** svalue.u.identifer is an identifier index in an object. Primarily
* used in lvalues on stack, but can also occur in arrays containing
* lvalue pairs.
*/
#define T_OBJ_INDEX 21
#define T_ARRAY_LVALUE 22
/* No types above this value should appear on the stack. */
#define PIKE_T_STACK_MAX T_ARRAY_LVALUE
/*
* The following types are only used in compile-time types and
* as markers in struct identifier.
*/
#define PIKE_T_GET_SET 32 /* Getter setter.
* Only valid in struct identifier */
|
1ab4ac | 2008-01-26 | Martin Stjernholm | |
|
b6876b | 2007-04-21 | Henrik Grubbström (Grubba) | | #define PIKE_T_ATTRIBUTE 238 /* Attribute node. */
|
cf4e17 | 2007-03-03 | Henrik Grubbström (Grubba) | | #define PIKE_T_NSTRING 239 /* Narrow string. Only for serialization. */
|
ce88d6 | 2001-03-19 | Henrik Grubbström (Grubba) | | #define PIKE_T_RING 240
|
67a0a3 | 2005-09-12 | H. William Welliver III | | #define PIKE_T_NAME 241 /**< Named type. */
#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
|
04966d | 2000-10-03 | Fredrik Hübinette (Hubbe) | | #define PIKE_T_UNKNOWN 247
|
a90303 | 2003-02-16 | Martin Stjernholm | |
|
2cd8ca | 2000-07-28 | Fredrik Hübinette (Hubbe) | | #define PIKE_T_MIXED 251
|
fe2559 | 1999-12-19 | Henrik Grubbström (Grubba) | | #define T_NOT 253
#define T_AND 254
#define T_OR 255
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
818191 | 2010-11-25 | Henrik Grubbström (Grubba) | | /* This flag is only valid in struct reference, and corresponds
* to struct identifier identifier_flags IDENTIFIER_NO_THIS_REF. */
#define PIKE_T_NO_REF_FLAG 256
#define PIKE_T_NO_REF_OBJECT (PIKE_T_NO_REF_FLAG|PIKE_T_OBJECT)
#define PIKE_T_NO_REF_FUNCTION (PIKE_T_NO_REF_FLAG|PIKE_T_FUNCTION)
#define PIKE_T_NO_REF_MIXED (PIKE_T_NO_REF_FLAG|PIKE_T_MIXED)
#define PIKE_T_NO_REF_INT (PIKE_T_NO_REF_FLAG|PIKE_T_INT)
#define PIKE_T_NO_REF_FLOAT (PIKE_T_NO_REF_FLAG|PIKE_T_FLOAT)
|
9e5195 | 2001-08-20 | Martin Stjernholm | | /* These are only used together with describe() and friends. */
#define T_STORAGE 10000
#define T_MAPPING_DATA 10001
#define T_PIKE_FRAME 10002
|
a9e411 | 2001-12-10 | Martin Stjernholm | | #define T_MULTISET_DATA 10003
|
6d77e1 | 2003-08-20 | Martin Stjernholm | | #define T_STRUCT_CALLABLE 10004
|
54db6c | 1999-03-27 | Henrik Grubbström (Grubba) | |
|
833cae | 2013-06-12 | Henrik Grubbström (Grubba) | | /* NOTE: The t* macros below currently use the old type encoding
* to be compatible with __parse_pike_type() in older
* versions of Pike.
*/
|
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) | | /* These two magic funcions are used to make MSVC++ work
* even if 'ARGS' is empty.
*/
#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 ""
|
8c953a | 2001-03-28 | Henrik Grubbström (Grubba) | | #define tPrg(X) "\005" X
#define tProgram(X) "\005" X
|
45ee5d | 1999-02-10 | Fredrik Hübinette (Hubbe) | | #define tStr "\006"
#define tString "\006"
|
317de9 | 2008-06-18 | Henrik Grubbström (Grubba) | | #define tNStr(T) "\357" T
|
4e6c08 | 2007-05-02 | Henrik Grubbström (Grubba) | | #define tStr0 "\357" tZero
#define tStr7 "\357" "\010\000\000\000\000\000\000\000\177"
#define tStr8 "\357" "\010\000\000\000\000\000\000\000\377"
#define tStr16 "\357" "\010\000\000\000\000\000\000\377\377"
|
cf4e17 | 2007-03-03 | Henrik Grubbström (Grubba) | | #define tStr32 "\006"
|
54f8ac | 2001-03-17 | Henrik Grubbström (Grubba) | | #define tType(T) "\007" T
|
13df5b | 2005-12-04 | Martin Nilsson | | #define tInt "\022"
|
5a5944 | 1999-12-11 | Henrik Grubbström (Grubba) | | #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"
|
e45609 | 2000-08-29 | Martin Stjernholm | | #define tInt06 "\010\000\000\000\000\000\000\000\006"
|
4cb9f8 | 2007-05-01 | Martin Nilsson | | #define tInt07 "\010\000\000\000\000\000\000\000\007"
#define tInt08 "\010\000\000\000\000\000\000\000\010"
#define tInt09 "\010\000\000\000\000\000\000\000\011"
|
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"
|
23b827 | 2003-11-04 | Henrik Grubbström (Grubba) | | #define tInt_10 "\010\377\377\377\377\000\000\000\000"
|
bc0661 | 2005-03-21 | Martin Nilsson | | #define tInt_11 "\010\377\377\377\377\000\000\000\001"
|
5a5944 | 1999-12-11 | Henrik Grubbström (Grubba) | | #define tByte "\010\000\000\000\000\000\000\000\377"
|
a8685d | 2013-05-29 | Henrik Grubbström (Grubba) | | #define tWord "\010\000\000\000\000\000\000\377\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))
|
9f0d2e | 2000-09-26 | Henrik Wallin | | #define tOr9(A,B,C,D,E,F,G,H,I) tOr(A,tOr8(B,C,D,E,F,G,H,I))
|
fe2559 | 1999-12-19 | Henrik Grubbström (Grubba) | | #define tMix "\373"
#define tMixed "\373"
|
8c953a | 2001-03-28 | Henrik Grubbström (Grubba) | | #define tComplex tOr6(tArray,tMapping,tMultiset,tObj,tFunction,tPrg(tObj))
#define tStringIndicable tOr5(tMapping,tObj,tFunction,tPrg(tObj),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)
|
6179f5 | 2007-04-21 | Henrik Grubbström (Grubba) | | #define tAttr(X,Y) "\356\0"X"\0"Y
|
f64b27 | 2002-11-21 | Marcus Comstedt | | #define tName(X,Y) "\361\0"X"\0"Y
|
222018 | 2002-11-22 | Henrik Grubbström (Grubba) | | #if PIKE_BYTEORDER == 1234
/* Little endian */
|
6179f5 | 2007-04-21 | Henrik Grubbström (Grubba) | | #define tAttr1(X,Y) "\356\5"X"\0\0"Y
#define tAttr2(X,Y) "\356\6"X"\0\0\0\0"Y
|
222018 | 2002-11-22 | Henrik Grubbström (Grubba) | | #define tName1(X,Y) "\361\5"X"\0\0"Y
#define tName2(X,Y) "\361\6"X"\0\0\0\0"Y
#else /* PIKE_BYTEORDER != 1234 */
/* Big endian */
|
6179f5 | 2007-04-21 | Henrik Grubbström (Grubba) | | #define tAttr1(X,Y) "\356\1"X"\0\0"Y
#define tAttr2(X,Y) "\356\2"X"\0\0\0\0"Y
|
f64b27 | 2002-11-21 | Marcus Comstedt | | #define tName1(X,Y) "\361\1"X"\0\0"Y
#define tName2(X,Y) "\361\2"X"\0\0\0\0"Y
|
222018 | 2002-11-22 | Henrik Grubbström (Grubba) | | #endif /* PIKE_BYTEORDER == 1234 */
|
45ee5d | 1999-02-10 | Fredrik Hübinette (Hubbe) | |
|
4835da | 2007-10-02 | Henrik Grubbström (Grubba) | | /* Some convenience macros for common attributes. */
#define tSprintfFormat(X) tAttr("sprintf_format", X)
#define tSprintfArgs(X) tAttr("sprintf_args", X)
#define tDeprecated(X) tAttr("deprecated", X)
|
1f2133 | 2000-07-28 | Fredrik Hübinette (Hubbe) | | #define tSimpleCallable tOr3(tArray,tFunction,tObj)
#define tCallable tOr3(tArr(tSimpleCallable),tFunction,tObj)
|
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)
|
67a0a3 | 2005-09-12 | H. William Welliver III | | /** Used to signify that the type field hasn't been set according to
|
e5c232 | 2003-04-28 | Martin Stjernholm | | * reality. */
|
5bd05e | 1999-11-23 | Henrik Grubbström (Grubba) | | #define BIT_UNFINISHED (1 << T_UNFINISHED)
|
4eb50a | 1996-05-16 | Fredrik Hübinette (Hubbe) | |
|
13670c | 2015-05-25 | Martin Nilsson | | |
3c04e8 | 1997-03-13 | Fredrik Hübinette (Hubbe) | | * argument may be omitted.
*/
|
5bd05e | 1999-11-23 | Henrik Grubbström (Grubba) | | #define BIT_VOID (1 << T_VOID)
|
3c04e8 | 1997-03-13 | Fredrik Hübinette (Hubbe) | |
|
67a0a3 | 2005-09-12 | H. William Welliver III | | |
833cae | 2013-06-12 | Henrik Grubbström (Grubba) | | * arguments have to be of this type.
|
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
|
0729e6 | 2013-06-15 | Henrik Grubbström (Grubba) | | #define BIT_MIXED 0xff7f
|
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)
|
e5c232 | 2003-04-28 | Martin Stjernholm | | #define BIT_REF_TYPES (BIT_STRING|BIT_TYPE|BIT_COMPLEX)
|
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
|
833cae | 2013-06-12 | Henrik Grubbström (Grubba) | |
#define MIN_REF_TYPE PIKE_T_ARRAY
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
833cae | 2013-06-12 | Henrik Grubbström (Grubba) | | #define MAX_TYPE PIKE_T_TYPE
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
833cae | 2013-06-12 | Henrik Grubbström (Grubba) | | #define REFCOUNTED_TYPE(T) (((T) & ~(MIN_REF_TYPE - 1)) == MIN_REF_TYPE)
|
4a93e8 | 2013-06-11 | Henrik Grubbström (Grubba) | |
|
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
|
38bb46 | 2013-08-14 | Marcus Comstedt | | extern PMOD_EXPORT const struct svalue svalue_undefined, svalue_int_zero;
#ifdef HAVE_UNION_INIT
extern PMOD_EXPORT const struct svalue svalue_int_one;
#else
extern PMOD_EXPORT struct svalue svalue_int_one;
#endif
|
e371f5 | 2008-05-30 | Martin Stjernholm | |
|
bce86c | 1996-02-25 | Fredrik Hübinette (Hubbe) | | #define is_gt(a,b) is_lt(b,a)
|
f5971b | 2004-11-27 | Martin Stjernholm | | #define is_ge(a,b) is_le(b,a)
|
016714 | 2001-12-16 | Martin Stjernholm | |
|
32f895 | 2013-06-12 | Per Hedbor | | #define UNSAFE_IS_ZERO(X) (TYPEOF(*(X))==PIKE_T_INT?(X)->u.integer==0:(1<<TYPEOF(*(X)))&(BIT_OBJECT|BIT_FUNCTION)?!complex_svalue_is_true(X):0)
|
7a46d5 | 2011-09-24 | Henrik Grubbström (Grubba) | | #define SAFE_IS_ZERO(X) (TYPEOF(*(X))==PIKE_T_INT?(X)->u.integer==0:(1<<TYPEOF(*(X)))&(BIT_OBJECT|BIT_FUNCTION)?!safe_svalue_is_true(X):0)
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
7a46d5 | 2011-09-24 | Henrik Grubbström (Grubba) | | #define IS_UNDEFINED(X) (check_svalue (X), TYPEOF(*(X))==PIKE_T_INT&&SUBTYPEOF(*(X))==NUMBER_UNDEFINED)
|
3495fe | 1997-02-06 | Fredrik Hübinette (Hubbe) | |
|
ce832b | 2015-05-21 | Tobias S. Josefowitz | | #define IS_DESTRUCTED(X) \
((TYPEOF(*(X)) == PIKE_T_OBJECT && !(X)->u.object->prog) || \
(TYPEOF(*(X)) == PIKE_T_FUNCTION && SUBTYPEOF(*(X)) != FUNCTION_BUILTIN\
&& (!(X)->u.object->prog \
|| ((X)->u.object->prog == pike_trampoline_program \
&& !((struct pike_trampoline *)(X)->u.object->storage) \
|
8284ad | 2015-05-21 | Tobias S. Josefowitz | | ->frame->current_object->prog \
|
3eb729 | 2015-05-21 | Tobias S. Josefowitz | | && SUBTYPEOF(*(X)) == QUICK_FIND_LFUN(pike_trampoline_program,\
|
8284ad | 2015-05-21 | Tobias S. Josefowitz | | LFUN_CALL)))))
|
7a46d5 | 2011-09-24 | Henrik Grubbström (Grubba) | |
#define check_destructed(S) \
do{ \
struct svalue *_s=(S); \
if(IS_DESTRUCTED(_s)) { \
free_object(_s->u.object); \
|
c0c9c4 | 2011-10-23 | Henrik Grubbström (Grubba) | | SET_SVAL(*_s, PIKE_T_INT, \
NUMBER_DESTRUCTED, \
integer, 0); \
|
7a46d5 | 2011-09-24 | Henrik Grubbström (Grubba) | | } \
}while(0)
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
453f4c | 1996-08-12 | Fredrik Hübinette (Hubbe) | |
#define safe_check_destructed(var) do{ \
|
d51098 | 2011-12-28 | Henrik Grubbström (Grubba) | | if(IS_DESTRUCTED(var)) \
var=&svalue_int_zero; \
}while(0)
|
453f4c | 1996-08-12 | Fredrik Hübinette (Hubbe) | |
|
d51098 | 2011-12-28 | Henrik Grubbström (Grubba) | |
|
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)
|
e83eb9 | 2001-03-22 | Fredrik Hübinette (Hubbe) | |
|
557f74 | 2014-05-23 | Per Hedbor | | #define add_ref(X) ((void)((X)->refs++))
|
67b731 | 2002-12-01 | Martin Stjernholm | | #define sub_ref(X) (--(X)->refs > 0)
|
e83eb9 | 2001-03-22 | Fredrik Hübinette (Hubbe) | |
|
71f3a2 | 1998-11-22 | Fredrik Hübinette (Hubbe) | | #ifdef PIKE_DEBUG
|
fb42db | 2000-12-13 | Fredrik Hübinette (Hubbe) | | PMOD_EXPORT extern void describe(void *);
|
c29940 | 2001-11-10 | Martin Stjernholm | | PMOD_EXPORT extern const char msg_type_error[];
|
bfeae6 | 2005-09-06 | Henrik Grubbström (Grubba) | | PMOD_EXPORT extern const char msg_assign_svalue_error[];
|
69db48 | 2008-03-29 | Martin Stjernholm | |
|
cc063b | 2014-12-07 | Henrik Grubbström (Grubba) | | #define IS_INVALID_TYPE(T) is_invalid_stack_type(T)
|
69db48 | 2008-03-29 | Martin Stjernholm | |
|
8cbd55 | 2008-01-29 | Martin Stjernholm | | #define check_type(T) do { \
|
69db48 | 2008-03-29 | Martin Stjernholm | | TYPE_T typ_ = (T); \
if (IS_INVALID_TYPE (typ_)) Pike_fatal(msg_type_error, typ_); \
|
8cbd55 | 2008-01-29 | Martin Stjernholm | | } while (0)
|
a4033e | 2000-04-14 | Fredrik Hübinette (Hubbe) | |
|
df8691 | 2008-03-29 | Martin Stjernholm | | #define check_svalue_type(S) do { \
const struct svalue *sval_ = (S); \
|
7a46d5 | 2011-09-24 | Henrik Grubbström (Grubba) | | TYPE_T typ_ = TYPEOF(*sval_); \
|
69db48 | 2008-03-29 | Martin Stjernholm | | if (IS_INVALID_TYPE (typ_)) debug_svalue_type_error (sval_); \
|
df8691 | 2008-03-29 | Martin Stjernholm | | } while (0)
|
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 | |
|
6d77e1 | 2003-08-20 | Martin Stjernholm | | void low_thorough_check_short_svalue (const union anything *u, TYPE_T type);
#define thorough_check_short_svalue(U, T) do { \
union anything *anyth_ = (U); \
TYPE_T typ_ = (T); \
check_short_svalue (anyth_, typ_); \
if (d_flag <= 50) /* Done directly by check_svalue otherwise. */ \
|
4a93e8 | 2013-06-11 | Henrik Grubbström (Grubba) | | if (REFCOUNTED_TYPE(typ_)) \
|
6d77e1 | 2003-08-20 | Martin Stjernholm | | low_thorough_check_short_svalue (anyth_, typ_); \
} while (0)
#define thorough_check_svalue(S) do { \
struct svalue *sval_ = (S); \
check_svalue (sval_); \
if (d_flag <= 50) /* Done directly by check_svalue otherwise. */ \
|
4a93e8 | 2013-06-11 | Henrik Grubbström (Grubba) | | if (REFCOUNTED_TYPE(TYPEOF(*sval_))) \
|
7a46d5 | 2011-09-24 | Henrik Grubbström (Grubba) | | low_thorough_check_short_svalue (&sval_->u, TYPEOF(*sval_)); \
|
6d77e1 | 2003-08-20 | Martin Stjernholm | | } while (0)
|
dd0fe0 | 2008-05-11 | Martin Stjernholm | | void check_short_svalue(const union anything *u, TYPE_T type);
PMOD_EXPORT void debug_svalue_type_error (const struct svalue *s);
|
cc063b | 2014-12-07 | Henrik Grubbström (Grubba) | | PMOD_EXPORT int is_invalid_stack_type(unsigned int t);
|
dd0fe0 | 2008-05-11 | Martin Stjernholm | | PMOD_EXPORT 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);
|
c29940 | 2001-11-10 | Martin Stjernholm | | PMOD_EXPORT extern const char msg_sval_obj_wo_refs[];
|
a4033e | 2000-04-14 | Fredrik Hübinette (Hubbe) | | #define check_refs(S) do {\
|
4a93e8 | 2013-06-11 | Henrik Grubbström (Grubba) | | if(REFCOUNTED_TYPE(TYPEOF(*(S))) && (!(S)->u.refs || (S)->u.refs[0] < 0)) { \
|
f9bafd | 2008-12-12 | Martin Stjernholm | | fprintf (stderr, "%s", msg_sval_obj_wo_refs); \
|
b9f328 | 2004-04-03 | Martin Stjernholm | | describe((S)->u.refs); \
|
f9bafd | 2008-12-12 | Martin Stjernholm | | Pike_fatal("%s", msg_sval_obj_wo_refs); \
|
b9f328 | 2004-04-03 | Martin Stjernholm | | } }while(0)
|
a4033e | 2000-04-14 | Fredrik Hübinette (Hubbe) | |
|
c29940 | 2001-11-10 | Martin Stjernholm | | PMOD_EXPORT extern const char msg_ssval_obj_wo_refs[];
|
a4033e | 2000-04-14 | Fredrik Hübinette (Hubbe) | | #define check_refs2(S,T) do { \
|
4a93e8 | 2013-06-11 | Henrik Grubbström (Grubba) | | if(REFCOUNTED_TYPE(T) && (S)->refs && (S)->refs[0] <= 0) {\
|
92d0c4 | 2008-12-14 | Martin Stjernholm | | fprintf (stderr, "%s", msg_ssval_obj_wo_refs); \
|
b9f328 | 2004-04-03 | Martin Stjernholm | | describe((S)->refs); \
|
92d0c4 | 2008-12-14 | Martin Stjernholm | | Pike_fatal("%s", msg_ssval_obj_wo_refs); \
|
a4033e | 2000-04-14 | Fredrik Hübinette (Hubbe) | | } }while(0)
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
e5c232 | 2003-04-28 | Martin Stjernholm | | #define check_type_hint(SVALS, NUM, TYPE_HINT) \
debug_check_type_hint ((SVALS), (NUM), (TYPE_HINT))
|
8c8337 | 1998-04-16 | Fredrik Hübinette (Hubbe) | | #ifdef DEBUG_MALLOC
|
e993fe | 2015-04-01 | Henrik Grubbström (Grubba) | | static INLINE struct svalue PIKE_UNUSED_ATTRIBUTE *dmalloc_check_svalue(struct svalue *s, char *l)
|
ead205 | 2000-06-16 | Fredrik Hübinette (Hubbe) | | {
|
4a93e8 | 2013-06-11 | Henrik Grubbström (Grubba) | | if(s && REFCOUNTED_TYPE(TYPEOF(*s)))
|
ead205 | 2000-06-16 | Fredrik Hübinette (Hubbe) | | debug_malloc_update_location(s->u.refs,l);
return s;
}
|
e993fe | 2015-04-01 | Henrik Grubbström (Grubba) | | static INLINE struct svalue PIKE_UNUSED_ATTRIBUTE *dmalloc_check_svalues(struct svalue *s, size_t num, char *l)
|
e7f132 | 2004-09-30 | Martin Stjernholm | | {
while (num--) dmalloc_check_svalue (s + num, l);
return s;
}
|
e993fe | 2015-04-01 | Henrik Grubbström (Grubba) | | static INLINE union anything PIKE_UNUSED_ATTRIBUTE *dmalloc_check_union(union anything *u,int type, char * l)
|
ead205 | 2000-06-16 | Fredrik Hübinette (Hubbe) | | {
|
4a93e8 | 2013-06-11 | Henrik Grubbström (Grubba) | | if(u && REFCOUNTED_TYPE(type))
|
ead205 | 2000-06-16 | Fredrik Hübinette (Hubbe) | | debug_malloc_update_location(u->refs,l);
return u;
}
|
e83eb9 | 2001-03-22 | Fredrik Hübinette (Hubbe) | | #undef add_ref
|
24bce6 | 2003-03-14 | Henrik Grubbström (Grubba) | | #define add_ref(X) (((INT32 *)debug_malloc_update_location( &((X)->refs), DMALLOC_NAMED_LOCATION(" add_ref")))[0]++)
|
557f74 | 2014-05-23 | Per Hedbor | | #undef sub_ref
|
24bce6 | 2003-03-14 | Henrik Grubbström (Grubba) | | #define sub_ref(X) (--((INT32 *)debug_malloc_update_location( &((X)->refs), DMALLOC_NAMED_LOCATION(" sub_ref")))[0] > 0)
|
e83eb9 | 2001-03-22 | Fredrik Hübinette (Hubbe) | |
|
7d269e | 2008-05-11 | Martin Stjernholm | | #else /* !DEBUG_MALLOC */
|
ead205 | 2000-06-16 | Fredrik Hübinette (Hubbe) | | #define dmalloc_check_svalue(S,L) (S)
|
e7f132 | 2004-09-30 | Martin Stjernholm | | #define dmalloc_check_svalues(S,L,N) (S)
|
ead205 | 2000-06-16 | Fredrik Hübinette (Hubbe) | | #define dmalloc_check_union(U,T,L) (U)
|
7d269e | 2008-05-11 | Martin Stjernholm | | #endif /* !DEBUG_MALLOC */
|
e993fe | 2015-04-01 | Henrik Grubbström (Grubba) | | static INLINE struct array PIKE_UNUSED_ATTRIBUTE *pass_array (struct array *a) {return a;}
static INLINE struct mapping PIKE_UNUSED_ATTRIBUTE *pass_mapping (struct mapping *m) {return m;}
static INLINE struct multiset PIKE_UNUSED_ATTRIBUTE *pass_multiset (struct multiset *l) {return l;}
static INLINE struct object PIKE_UNUSED_ATTRIBUTE *pass_object (struct object *o) {return o;}
static INLINE struct program PIKE_UNUSED_ATTRIBUTE *pass_program (struct program *p) {return p;}
static INLINE struct pike_string PIKE_UNUSED_ATTRIBUTE *pass_string (struct pike_string *s) {return s;}
static INLINE struct pike_type PIKE_UNUSED_ATTRIBUTE *pass_type (struct pike_type *t) {return t;}
static INLINE struct callable PIKE_UNUSED_ATTRIBUTE *pass_callable (struct callable *c) {return c;}
|
8c8337 | 1998-04-16 | Fredrik Hübinette (Hubbe) | |
|
e5c232 | 2003-04-28 | Martin Stjernholm | | #else /* !PIKE_DEBUG */
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
ed3dca | 2008-06-29 | Martin Stjernholm | | #define check_svalue(S) ((void) 0)
#define check_short_svalue(U, T) ((void) 0)
|
8cbd55 | 2008-01-29 | Martin Stjernholm | | #define check_type(T) do {} while (0)
|
df8691 | 2008-03-29 | Martin Stjernholm | | #define check_svalue_type(S) do {} while (0)
|
8cbd55 | 2008-01-29 | Martin Stjernholm | | #define check_refs(S) do {} while (0)
#define check_refs2(S,T) do {} while (0)
|
ed3dca | 2008-06-29 | Martin Stjernholm | | #define check_type_hint(SVALS, NUM, TYPE_HINT) ((void) 0)
|
ce6ab0 | 2000-07-04 | Martin Stjernholm | | #define dmalloc_check_svalue(S,L) (S)
|
e7f132 | 2004-09-30 | Martin Stjernholm | | #define dmalloc_check_svalues(S,L,N) (S)
|
ce6ab0 | 2000-07-04 | Martin Stjernholm | | #define dmalloc_check_union(U,T,L) (U)
|
e83eb9 | 2001-03-22 | Fredrik Hübinette (Hubbe) | |
|
7d269e | 2008-05-11 | Martin Stjernholm | | #define pass_array(A) (A)
#define pass_mapping(M) (M)
#define pass_multiset(L) (L)
#define pass_object(O) (O)
#define pass_program(P) (P)
#define pass_string(S) (S)
#define pass_type(T) (T)
#define pass_callable(C) (C)
|
e5c232 | 2003-04-28 | Martin Stjernholm | | #endif /* !PIKE_DEBUG */
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
1ab4ac | 2008-01-26 | Martin Stjernholm | |
#define mark_free_svalue(X) do { \
struct svalue *_X__ = (X); \
|
df8691 | 2008-03-29 | Martin Stjernholm | | DO_IF_DMALLOC ( \
_X__->u.loc = " " __FILE__ ":" DEFINETOSTR (__LINE__); \
_X__->u.loc++; /* Attempt to achieve an odd address. */ \
); \
|
1ab4ac | 2008-01-26 | Martin Stjernholm | | PIKE_MEM_WO(*_X__); \
|
7a46d5 | 2011-09-24 | Henrik Grubbström (Grubba) | | SET_SVAL_TYPE(*_X__, PIKE_T_FREE); \
|
1ab4ac | 2008-01-26 | Martin Stjernholm | | } while (0)
#define assert_free_svalue(X) do { \
DO_IF_DEBUG ( \
struct svalue *_X__ = (X); \
|
7a46d5 | 2011-09-24 | Henrik Grubbström (Grubba) | | SET_SVAL_TYPE(*_X__, PIKE_T_UNKNOWN); \
|
df8691 | 2008-03-29 | Martin Stjernholm | | DO_IF_DMALLOC ( \
_X__->u.loc = " " __FILE__ ":" DEFINETOSTR (__LINE__); \
_X__->u.loc++; /* Attempt to achieve an odd address. */ \
); \
DO_IF_NOT_DMALLOC (_X__->u.ptr = (void *) -1); \
|
1ab4ac | 2008-01-26 | Martin Stjernholm | | PIKE_MEM_WO (*_X__); \
); \
} while (0)
|
aad99b | 2001-03-28 | Fredrik Hübinette (Hubbe) | |
|
557f74 | 2014-05-23 | Per Hedbor | | #define swap_svalues(X,Y) do { \
|
708d8d | 2001-04-28 | Martin Stjernholm | | struct svalue *_a=(X); \
struct svalue *_b=(Y); \
struct svalue _tmp; \
|
8de8c2 | 2003-02-15 | Martin Stjernholm | | dmalloc_touch_svalue(_a); \
dmalloc_touch_svalue(_b); \
|
aad99b | 2001-03-28 | Fredrik Hübinette (Hubbe) | | _tmp=*_a; *_a=*_b; *_b=_tmp; \
}while(0)
|
1ab4ac | 2008-01-26 | Martin Stjernholm | |
|
557f74 | 2014-05-23 | Per Hedbor | | #define free_svalue(X) do { \
|
aad99b | 2001-03-28 | Fredrik Hübinette (Hubbe) | | struct svalue *_s=(X); \
|
1ab4ac | 2008-01-26 | Martin Stjernholm | | DO_IF_DEBUG ( \
|
7a46d5 | 2011-09-24 | Henrik Grubbström (Grubba) | | if (TYPEOF(*_s) != PIKE_T_FREE) { \
|
df8691 | 2008-03-29 | Martin Stjernholm | | check_svalue_type(_s); \
|
1ab4ac | 2008-01-26 | Martin Stjernholm | | check_refs(_s); \
} \
); \
|
4a93e8 | 2013-06-11 | Henrik Grubbström (Grubba) | | if (!REFCOUNTED_TYPE(TYPEOF(*_s))) \
|
1ab4ac | 2008-01-26 | Martin Stjernholm | | assert_free_svalue (_s); \
|
97a733 | 2008-03-30 | Martin Stjernholm | | else { \
DO_IF_DEBUG ( \
DO_IF_PIKE_CLEANUP ( \
if (gc_external_refs_zapped) \
|
7a46d5 | 2011-09-24 | Henrik Grubbström (Grubba) | | gc_check_zapped (_s->u.ptr, TYPEOF(*_s), __FILE__, __LINE__))); \
|
97a733 | 2008-03-30 | Martin Stjernholm | | if (sub_ref(_s->u.dummy) <=0) \
really_free_svalue(_s); \
else \
assert_free_svalue (_s); \
} \
|
aad99b | 2001-03-28 | Fredrik Hübinette (Hubbe) | | }while(0)
|
557f74 | 2014-05-23 | Per Hedbor | | #define free_short_svalue(X,T) do { \
|
aad99b | 2001-03-28 | Fredrik Hübinette (Hubbe) | | union anything *_s=(X); TYPE_T _t=(T); \
check_type(_t); check_refs2(_s,_t); \
|
4a93e8 | 2013-06-11 | Henrik Grubbström (Grubba) | | if(REFCOUNTED_TYPE(_t) && _s->refs) { \
|
97a733 | 2008-03-30 | Martin Stjernholm | | DO_IF_DEBUG ( \
DO_IF_PIKE_CLEANUP ( \
if (gc_external_refs_zapped) \
gc_check_zapped (_s->ptr, _t, __FILE__, __LINE__))); \
|
aad99b | 2001-03-28 | Fredrik Hübinette (Hubbe) | | if(sub_ref(_s->dummy) <= 0) really_free_short_svalue(_s,_t); \
} \
|
aff360 | 2002-11-23 | Martin Stjernholm | | DO_IF_DMALLOC(_s->refs=(void *)-1); \
PIKE_MEM_WO(_s->refs); \
|
aad99b | 2001-03-28 | Fredrik Hübinette (Hubbe) | | }while(0)
|
1ab4ac | 2008-01-26 | Martin Stjernholm | |
|
557f74 | 2014-05-23 | Per Hedbor | | #define add_ref_svalue(X) do { \
|
aad99b | 2001-03-28 | Fredrik Hübinette (Hubbe) | | struct svalue *_tmp=(X); \
|
1ab4ac | 2008-01-26 | Martin Stjernholm | | DO_IF_DEBUG ( \
|
7a46d5 | 2011-09-24 | Henrik Grubbström (Grubba) | | if (TYPEOF(*_tmp) != PIKE_T_FREE) { \
|
df8691 | 2008-03-29 | Martin Stjernholm | | check_svalue_type(_tmp); \
|
1ab4ac | 2008-01-26 | Martin Stjernholm | | check_refs(_tmp); \
} \
); \
|
4a93e8 | 2013-06-11 | Henrik Grubbström (Grubba) | | if(REFCOUNTED_TYPE(TYPEOF(*_tmp))) add_ref(_tmp->u.dummy); \
|
aad99b | 2001-03-28 | Fredrik Hübinette (Hubbe) | | }while(0)
|
1ab4ac | 2008-01-26 | Martin Stjernholm | |
|
557f74 | 2014-05-23 | Per Hedbor | | #define assign_svalue_no_free(X,Y) do { \
|
708d8d | 2001-04-28 | Martin Stjernholm | | struct svalue *_to=(X); \
|
3cd748 | 2001-04-28 | Martin Stjernholm | | const struct svalue *_from=(Y); \
|
1ab4ac | 2008-01-26 | Martin Stjernholm | | DO_IF_DEBUG ( \
|
7a46d5 | 2011-09-24 | Henrik Grubbström (Grubba) | | if (TYPEOF(*_from) != PIKE_T_FREE) { \
|
df8691 | 2008-03-29 | Martin Stjernholm | | check_svalue_type(_from); \
|
1ab4ac | 2008-01-26 | Martin Stjernholm | | check_refs(_from); \
} \
if (_to == _from) \
Pike_fatal(msg_assign_svalue_error, _to); \
); \
|
bfeae6 | 2005-09-06 | Henrik Grubbström (Grubba) | | *_to=*_from; \
|
4a93e8 | 2013-06-11 | Henrik Grubbström (Grubba) | | if(REFCOUNTED_TYPE(TYPEOF(*_to))) add_ref(_to->u.dummy); \
|
aad99b | 2001-03-28 | Fredrik Hübinette (Hubbe) | | }while(0)
|
1ab4ac | 2008-01-26 | Martin Stjernholm | |
|
557f74 | 2014-05-23 | Per Hedbor | | #define assign_svalue(X,Y) do { \
|
3cd748 | 2001-04-28 | Martin Stjernholm | | struct svalue *_to2=(X); \
const struct svalue *_from2=(Y); \
|
aad99b | 2001-03-28 | Fredrik Hübinette (Hubbe) | | if (_to2 != _from2) { \
free_svalue(_to2); \
assign_svalue_no_free(_to2, _from2); \
} \
}while(0)
|
d3d172 | 1997-01-31 | Fredrik Hübinette (Hubbe) | |
|
1ab4ac | 2008-01-26 | Martin Stjernholm | |
|
941cf2 | 2002-11-23 | Martin Stjernholm | | #define move_svalue(TO, FROM) do { \
struct svalue *_to = (TO); \
struct svalue *_from = (FROM); \
dmalloc_touch_svalue(_from); \
*_to = *_from; \
|
1ab4ac | 2008-01-26 | Martin Stjernholm | | assert_free_svalue (_from); \
|
941cf2 | 2002-11-23 | Martin Stjernholm | | } while (0)
|
1ab4ac | 2008-01-26 | Martin Stjernholm | |
|
2ac950 | 2001-08-14 | Fredrik Hübinette (Hubbe) | | #define free_mixed_svalues(X,Y) do { \
struct svalue *s_=(X); \
ptrdiff_t num_=(Y); \
while(num_--) \
{ \
dmalloc_touch_svalue(s_); \
free_svalue(s_++); \
} \
|
31268a | 2003-05-13 | Martin Stjernholm | | }while(0)
|
2ac950 | 2001-08-14 | Fredrik Hübinette (Hubbe) | |
|
1ab4ac | 2008-01-26 | Martin Stjernholm | |
|
07ae47 | 1998-04-23 | Fredrik Hübinette (Hubbe) | | #ifdef DEBUG_MALLOC
|
24bce6 | 2003-03-14 | Henrik Grubbström (Grubba) | | #define free_svalues(X,Y,Z) debug_free_svalues((X),(Y),(Z), DMALLOC_NAMED_LOCATION(" free_svalues"));
|
07ae47 | 1998-04-23 | Fredrik Hübinette (Hubbe) | | #else
|
2ac950 | 2001-08-14 | Fredrik Hübinette (Hubbe) | | #define free_svalues(X,Y,Z) debug_free_svalues((X),(Y),(Z));
|
07ae47 | 1998-04-23 | Fredrik Hübinette (Hubbe) | | #endif
|
2ac950 | 2001-08-14 | Fredrik Hübinette (Hubbe) | | #define low_clear_svalues(X,Y,N) do { \
struct svalue *s_=(X); \
ptrdiff_t num_=(Y); \
for(;num_-- > 0;s_++) \
{ \
|
c0c9c4 | 2011-10-23 | Henrik Grubbström (Grubba) | | SET_SVAL(*s_, PIKE_T_INT, (N), integer, 0); \
|
2ac950 | 2001-08-14 | Fredrik Hübinette (Hubbe) | | } \
}while(0)
#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)
|
97e42a | 2002-05-02 | Martin Stjernholm | | #define really_free_short_svalue(U, TYPE) do { \
union anything *any_ = (U); \
|
8de8c2 | 2003-02-15 | Martin Stjernholm | | debug_malloc_touch (any_->ptr); \
|
97e42a | 2002-05-02 | Martin Stjernholm | | really_free_short_svalue_ptr (&any_->ptr, (TYPE)); \
} while (0)
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
97e42a | 2002-05-02 | Martin Stjernholm | | PMOD_EXPORT void really_free_short_svalue_ptr(void **s, TYPE_T type);
|
1f2133 | 2000-07-28 | Fredrik Hübinette (Hubbe) | | 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);
|
84387d | 2001-09-24 | Fredrik Hübinette (Hubbe) | | PMOD_EXPORT void debug_free_mixed_svalues(struct svalue *s, size_t num, INT32 type_hint DMALLOC_LINE_ARGS);
|
e5c232 | 2003-04-28 | Martin Stjernholm | | 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);
|
1f2133 | 2000-07-28 | Fredrik Hübinette (Hubbe) | | PMOD_EXPORT void assign_to_short_svalue(union anything *u,
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | TYPE_T type,
|
3cd748 | 2001-04-28 | Martin Stjernholm | | const struct svalue *s);
|
1f2133 | 2000-07-28 | Fredrik Hübinette (Hubbe) | | PMOD_EXPORT void assign_to_short_svalue_no_free(union anything *u,
|
fc7695 | 1996-02-17 | Fredrik Hübinette (Hubbe) | | TYPE_T type,
|
3cd748 | 2001-04-28 | Martin Stjernholm | | const struct svalue *s);
|
1f2133 | 2000-07-28 | Fredrik Hübinette (Hubbe) | | PMOD_EXPORT void assign_from_short_svalue_no_free(struct svalue *s,
|
3cd748 | 2001-04-28 | Martin Stjernholm | | const union anything *u,
|
569d5e | 1998-09-18 | Fredrik Hübinette (Hubbe) | | TYPE_T type);
|
1f2133 | 2000-07-28 | Fredrik Hübinette (Hubbe) | | PMOD_EXPORT void assign_short_svalue_no_free(union anything *to,
|
3cd748 | 2001-04-28 | Martin Stjernholm | | const union anything *from,
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | TYPE_T type);
|
1f2133 | 2000-07-28 | Fredrik Hübinette (Hubbe) | | PMOD_EXPORT void assign_short_svalue(union anything *to,
|
3cd748 | 2001-04-28 | Martin Stjernholm | | const union anything *from,
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | TYPE_T type);
|
3cd748 | 2001-04-28 | Martin Stjernholm | | PMOD_EXPORT unsigned INT32 hash_svalue(const struct svalue *s);
|
32f895 | 2013-06-12 | Per Hedbor | | PMOD_EXPORT int complex_svalue_is_true(const struct svalue *s);
|
3cd748 | 2001-04-28 | Martin Stjernholm | | PMOD_EXPORT int svalue_is_true(const struct svalue *s);
|
016714 | 2001-12-16 | Martin Stjernholm | | PMOD_EXPORT int safe_svalue_is_true(const struct svalue *s);
|
3cd748 | 2001-04-28 | Martin Stjernholm | | 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,
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | struct processing *p);
|
1f2133 | 2000-07-28 | Fredrik Hübinette (Hubbe) | | PMOD_EXPORT int low_short_is_equal(const union anything *a,
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | | const union anything *b,
TYPE_T type,
struct processing *p);
|
3cd748 | 2001-04-28 | Martin Stjernholm | | 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);
|
f5971b | 2004-11-27 | Martin Stjernholm | | PMOD_EXPORT int is_le(const struct svalue *a, const struct svalue *b);
|
3cd748 | 2001-04-28 | Martin Stjernholm | | PMOD_EXPORT void describe_svalue(const struct svalue *s,int indent,struct processing *p);
|
6a45bb | 2006-02-28 | Martin Stjernholm | | PMOD_EXPORT void safe_describe_svalue(const struct svalue *s,int indent,struct processing *p);
|
3cd748 | 2001-04-28 | Martin Stjernholm | | PMOD_EXPORT void print_svalue (FILE *out, const struct svalue *s);
|
e6f6de | 2007-10-12 | Martin Stjernholm | | PMOD_EXPORT void safe_print_svalue (FILE *out, const struct svalue *s);
|
99cee9 | 2004-04-03 | Martin Stjernholm | | PMOD_EXPORT void print_short_svalue (FILE *out, const union anything *a, TYPE_T type);
|
e6f6de | 2007-10-12 | Martin Stjernholm | | PMOD_EXPORT void safe_print_short_svalue (FILE *out, const union anything *a, TYPE_T type);
|
3a5d8a | 2003-09-09 | Martin Stjernholm | | PMOD_EXPORT void print_svalue_compact (FILE *out, const struct svalue *s);
|
e6f6de | 2007-10-12 | Martin Stjernholm | | PMOD_EXPORT void safe_print_svalue_compact (FILE *out, const struct svalue *s);
|
99cee9 | 2004-04-03 | Martin Stjernholm | | PMOD_EXPORT void print_short_svalue_compact (FILE *out, const union anything *a, TYPE_T type);
|
e6f6de | 2007-10-12 | Martin Stjernholm | | PMOD_EXPORT void safe_print_short_svalue_compact (FILE *out, const union anything *a, TYPE_T type);
|
d53904 | 2008-08-17 | Martin Stjernholm | | #ifdef PIKE_DEBUG
PMOD_EXPORT void safe_pike_vfprintf (FILE *out, const char *fmt, va_list args);
PMOD_EXPORT void safe_pike_fprintf (FILE *out, const char *fmt, ...);
#endif
|
1f2133 | 2000-07-28 | Fredrik Hübinette (Hubbe) | | PMOD_EXPORT void copy_svalues_recursively_no_free(struct svalue *to,
|
9cc28d | 2004-05-28 | Henrik Grubbström (Grubba) | | const struct svalue *from,
size_t num,
struct mapping *m);
|
3cd748 | 2001-04-28 | Martin Stjernholm | | 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);
|
d6896c | 2000-12-16 | Marcus Comstedt | | PMOD_EXPORT TYPE_FIELD real_gc_mark_svalues(struct svalue *s, size_t num);
|
19c79c | 2000-06-29 | Henrik Grubbström (Grubba) | | TYPE_FIELD gc_mark_weak_svalues(struct svalue *s, size_t num);
|
1f2133 | 2000-07-28 | Fredrik Hübinette (Hubbe) | | int real_gc_mark_short_svalue(union anything *u, TYPE_T type);
|
e2d9e6 | 2000-06-10 | Martin Stjernholm | | int gc_mark_weak_short_svalue(union anything *u, TYPE_T type);
|
7f947e | 2001-06-05 | Martin Stjernholm | | int gc_mark_without_recurse(struct svalue *s);
int gc_mark_weak_without_recurse(struct svalue *s);
|
d6896c | 2000-12-16 | Marcus Comstedt | | PMOD_EXPORT TYPE_FIELD real_gc_cycle_check_svalues(struct svalue *s, size_t num);
|
19c79c | 2000-06-29 | Henrik Grubbström (Grubba) | | TYPE_FIELD gc_cycle_check_weak_svalues(struct svalue *s, size_t num);
|
d6896c | 2000-12-16 | Marcus Comstedt | | PMOD_EXPORT int real_gc_cycle_check_short_svalue(union anything *u, TYPE_T type);
|
e2d9e6 | 2000-06-10 | Martin Stjernholm | | int gc_cycle_check_weak_short_svalue(union anything *u, TYPE_T type);
|
797274 | 2000-12-14 | Martin Stjernholm | | void real_gc_free_svalue(struct svalue *s);
void real_gc_free_short_svalue(union anything *u, TYPE_T type);
|
1d3eae | 2014-08-27 | Per Hedbor | | PMOD_EXPORT INT_TYPE pike_sizeof(const struct svalue *s);
|
cca487 | 2010-02-18 | Stephen R. van den Berg | | int svalues_are_constant(const struct svalue *s,
|
84387d | 2001-09-24 | Fredrik Hübinette (Hubbe) | | INT32 num,
TYPE_FIELD hint,
struct processing *p);
|
5267b7 | 1995-08-09 | Fredrik Hübinette (Hubbe) | |
|
e993fe | 2015-04-01 | Henrik Grubbström (Grubba) | | static INLINE TYPE_FIELD PIKE_UNUSED_ATTRIBUTE BITOF(struct svalue sv) {
|
3635f8 | 2014-01-11 | Tobias S. Josefowitz | | if (TYPEOF(sv) >= sizeof(TYPE_FIELD) * 8) {
return BIT_MIXED | BIT_UNFINISHED;
}
return 1 << TYPEOF(sv);
}
|
84387d | 2001-09-24 | Fredrik Hübinette (Hubbe) | | #define gc_cycle_check_without_recurse gc_mark_without_recurse
#define gc_cycle_check_weak_without_recurse gc_mark_without_recurse
|
e7f132 | 2004-09-30 | Martin Stjernholm | | #define gc_mark_external_svalues(S, NUM, PLACE) do { \
size_t num__ = (NUM); \
real_gc_mark_external_svalues ( \
dmalloc_check_svalues ((S), num__, DMALLOC_LOCATION()), num__, (PLACE)); \
} while (0)
#define gc_check_svalues(S, NUM) do { \
size_t num__ = (NUM); \
real_gc_check_svalues ( \
dmalloc_check_svalues ((S), num__, DMALLOC_LOCATION()), num__); \
} while (0)
#ifdef DEBUG_MALLOC
|
e993fe | 2015-04-01 | Henrik Grubbström (Grubba) | | static INLINE TYPE_FIELD PIKE_UNUSED_ATTRIBUTE dmalloc_gc_mark_svalues (struct svalue *s, size_t num, char *l)
|
e7f132 | 2004-09-30 | Martin Stjernholm | | {return real_gc_mark_svalues (dmalloc_check_svalues (s, num, l), num);}
#define gc_mark_svalues(S, NUM) dmalloc_gc_mark_svalues ((S), (NUM), DMALLOC_LOCATION())
|
e993fe | 2015-04-01 | Henrik Grubbström (Grubba) | | static INLINE TYPE_FIELD PIKE_UNUSED_ATTRIBUTE dmalloc_gc_cycle_check_svalues (struct svalue *s, size_t num, char *l)
|
e7f132 | 2004-09-30 | Martin Stjernholm | | {return real_gc_cycle_check_svalues (dmalloc_check_svalues (s, num, l), num);}
#define gc_cycle_check_svalues(S, NUM) dmalloc_gc_cycle_check_svalues ((S), (NUM), DMALLOC_LOCATION())
#else
#define gc_mark_svalues real_gc_mark_svalues
#define gc_cycle_check_svalues real_gc_cycle_check_svalues
#endif
|
433d5d | 2000-06-16 | Fredrik Hübinette (Hubbe) | | #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))
|
797274 | 2000-12-14 | Martin Stjernholm | | #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))
|
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
|
2cd8ca | 2000-07-28 | Fredrik Hübinette (Hubbe) | | #define T_MIXED PIKE_T_MIXED
|
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) | |
|
938632 | 2011-07-21 | Henrik Grubbström (Grubba) | | #define PIKE_CONSTANT_MEMOBJ_INIT(refs, type) refs
|
f4d757 | 2001-04-15 | Martin Stjernholm | |
|
e13490 | 2015-03-16 | Martin Nilsson | | #define INIT_PIKE_MEMOBJ(X, TYPE) do { \
struct ref_dummy *v_=(struct ref_dummy *)(X); \
v_->refs=0; \
add_ref(v_); /* For DMALLOC... */ \
|
45637c | 2001-04-07 | Fredrik Hübinette (Hubbe) | | }while(0)
|
e13490 | 2015-03-16 | Martin Nilsson | | #define EXIT_PIKE_MEMOBJ(X) do { \
struct ref_dummy *v_=(struct ref_dummy *)(X); \
|
45637c | 2001-04-07 | Fredrik Hübinette (Hubbe) | | }while(0)
struct ref_dummy
{
|
f42642 | 2015-03-17 | Martin Nilsson | | INT32 refs;
|
45637c | 2001-04-07 | Fredrik Hübinette (Hubbe) | | };
|
538e81 | 1999-12-10 | Henrik Grubbström (Grubba) | |
|
3e130c | 2008-05-30 | Martin Stjernholm | |
#ifdef HAVE_UNION_INIT
|
a5cf65 | 2014-06-24 | Henrik Grubbström (Grubba) | | #define SVALUE_INIT(TYPE, SUBTYPE, VAL) {{{TYPE, SUBTYPE}}, {VAL}}
#define SVALUE_INIT_INT(VAL) {{{T_INT, NUMBER_NUMBER}}, {VAL}}
#define SVALUE_INIT_FREE {{{PIKE_T_FREE, NUMBER_NUMBER}}, {0}}
|
3e130c | 2008-05-30 | Martin Stjernholm | | #else
|
bf3c85 | 2014-06-26 | Henrik Grubbström (Grubba) | | #define SVALUE_INIT(TYPE, SUBTYPE, VAL) {{{TYPE, SUBTYPE}}}
#define SVALUE_INIT_INT(VAL) {{{T_INT, NUMBER_NUMBER}}}
#define SVALUE_INIT_FREE {{{PIKE_T_FREE, NUMBER_NUMBER}}}
|
3e130c | 2008-05-30 | Martin Stjernholm | | #endif
|
538e81 | 1999-12-10 | Henrik Grubbström (Grubba) | | #endif /* !SVALUE_H */
|