e576bb | 2002-10-11 | Martin Nilsson | |
|
24ddc7 | 1998-03-28 | Henrik Grubbström (Grubba) | |
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | #ifndef PIKE_TYPES_H
#define PIKE_TYPES_H
|
b1f4eb | 1998-01-13 | Fredrik Hübinette (Hubbe) | | #include "svalue.h"
|
f2b826 | 2001-03-03 | Henrik Grubbström (Grubba) | | #define PIKE_TYPE_STACK_SIZE 100000
|
23f100 | 2001-03-03 | Henrik Grubbström (Grubba) | | #ifdef PIKE_DEBUG
void TYPE_STACK_DEBUG(const char *fun);
#else /* !PIKE_DEBUG */
#define TYPE_STACK_DEBUG(X)
#endif /* PIKE_DEBUG */
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | |
struct pike_type
{
INT32 refs;
|
938632 | 2011-07-21 | Henrik Grubbström (Grubba) | | #ifdef ATOMIC_SVALUE
INT32 ref_type;
#endif
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | | unsigned INT32 hash;
struct pike_type *next;
|
00f45d | 2007-03-26 | Henrik Grubbström (Grubba) | | unsigned INT32 flags;
|
1a647d | 2001-03-03 | Henrik Grubbström (Grubba) | | unsigned INT16 type;
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | | struct pike_type *car;
struct pike_type *cdr;
};
|
1a647d | 2001-03-03 | Henrik Grubbström (Grubba) | |
|
23db45 | 2003-08-20 | Martin Stjernholm | | extern struct pike_type **pike_type_hash;
extern size_t pike_type_hash_size;
|
03905b | 2003-06-30 | Martin Stjernholm | | #define CAR_TO_INT(TYPE) ((char *) (TYPE)->car - (char *) 0)
#define CDR_TO_INT(TYPE) ((char *) (TYPE)->cdr - (char *) 0)
|
ec1926 | 2001-08-31 | Martin Stjernholm | | #include "block_alloc_h.h"
|
13af4a | 2005-04-08 | Henrik Grubbström (Grubba) | | BLOCK_ALLOC(pike_type, n/a);
|
ec1926 | 2001-08-31 | Martin Stjernholm | |
|
00f45d | 2007-03-26 | Henrik Grubbström (Grubba) | |
#define PT_FLAG_MARKER_0 0x000001 /* The subtree holds a '0'. */
#define PT_FLAG_MARKER_1 0x000002 /* The subtree holds a '1'. */
#define PT_FLAG_MARKER_2 0x000004 /* The subtree holds a '2'. */
#define PT_FLAG_MARKER_3 0x000008 /* The subtree holds a '3'. */
#define PT_FLAG_MARKER_4 0x000010 /* The subtree holds a '4'. */
#define PT_FLAG_MARKER_5 0x000020 /* The subtree holds a '5'. */
#define PT_FLAG_MARKER_6 0x000040 /* The subtree holds a '6'. */
#define PT_FLAG_MARKER_7 0x000080 /* The subtree holds a '7'. */
#define PT_FLAG_MARKER_8 0x000100 /* The subtree holds a '8'. */
#define PT_FLAG_MARKER_9 0x000200 /* The subtree holds a '9'. */
#define PT_FLAG_MARKER 0x0003ff /* The subtree holds markers. */
#define PT_ASSIGN_SHIFT 12 /* Number of bits to shift. */
#define PT_FLAG_ASSIGN_0 0x001000 /* The subtree assigns '0'. */
#define PT_FLAG_ASSIGN_1 0x002000 /* The subtree assigns '1'. */
#define PT_FLAG_ASSIGN_2 0x004000 /* The subtree assigns '2'. */
#define PT_FLAG_ASSIGN_3 0x008000 /* The subtree assigns '3'. */
#define PT_FLAG_ASSIGN_4 0x010000 /* The subtree assigns '4'. */
#define PT_FLAG_ASSIGN_5 0x020000 /* The subtree assigns '5'. */
#define PT_FLAG_ASSIGN_6 0x040000 /* The subtree assigns '6'. */
#define PT_FLAG_ASSIGN_7 0x080000 /* The subtree assigns '7'. */
#define PT_FLAG_ASSIGN_8 0x100000 /* The subtree assigns '8'. */
#define PT_FLAG_ASSIGN_9 0x200000 /* The subtree assigns '9'. */
#define PT_FLAG_ASSIGN 0x3ff000 /* The subtree holds assigns. */
|
1a647d | 2001-03-03 | Henrik Grubbström (Grubba) | |
|
633f5c | 2007-04-27 | Henrik Grubbström (Grubba) | | #define PT_FLAG_MARK_ASSIGN 0x3ff3ff /* Assigns AND Markers. */
|
86245a | 2007-03-28 | Henrik Grubbström (Grubba) | | |
e1483f | 2011-12-11 | Henrik Grubbström (Grubba) | | * new_check_call(), check_splice_call() and get_first_arg_type() flags
|
86245a | 2007-03-28 | Henrik Grubbström (Grubba) | | */
|
ebd2e4 | 2008-06-18 | Henrik Grubbström (Grubba) | | #define CALL_STRICT 0x0001 /* Strict checking. */
|
960b40 | 2011-12-09 | Henrik Grubbström (Grubba) | | #define CALL_NOT_LAST_ARG 0x0002 /* This is not the last argument. */
|
ebd2e4 | 2008-06-18 | Henrik Grubbström (Grubba) | | #define CALL_7_6 0x0004 /* Pike 7.6 compatibility mode. */
#define CALL_WEAK_VOID 0x0008 /* Allow promotion of void to zero. */
#define CALL_ARG_LVALUE 0x0010 /* Argument is lvalue (sscanf). */
#define CALL_INHIBIT_WARNINGS 0x0020 /* Inhibit warnings. */
|
ff2bb1 | 2011-12-15 | Henrik Grubbström (Grubba) | | #define CALL_INVERTED_TYPES 0x0040 /* The fun and arg are inverted. */
|
86245a | 2007-03-28 | Henrik Grubbström (Grubba) | |
|
c6747d | 2007-04-13 | Henrik Grubbström (Grubba) | |
#define SOFT_WEAKER 0x0001 /* Soft cast to a weaker type. */
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | void debug_free_type(struct pike_type *t);
#ifdef DEBUG_MALLOC
|
be6fec | 2001-04-01 | Henrik Grubbström (Grubba) | | #define copy_pike_type(D, S) add_ref((struct pike_type *)debug_malloc_pass(D = (S)))
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | #else /* !DEBUG_MALLOC */
|
be6fec | 2001-04-01 | Henrik Grubbström (Grubba) | | #define copy_pike_type(D, S) add_ref(D = (S))
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | #endif /* DEBUG_MALLOC */
|
1a647d | 2001-03-03 | Henrik Grubbström (Grubba) | | #define CONSTTYPE(X) make_pike_type(X)
|
f2b826 | 2001-03-03 | Henrik Grubbström (Grubba) | | extern struct pike_type *type_stack[PIKE_TYPE_STACK_SIZE];
extern struct pike_type **pike_type_mark_stack[PIKE_TYPE_STACK_SIZE/4];
|
1a647d | 2001-03-03 | Henrik Grubbström (Grubba) | |
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | #ifdef DEBUG_MALLOC
|
0a30f5 | 2007-03-31 | Henrik Grubbström (Grubba) | | #define check_type_string(T) debug_check_type_string((struct pike_type *)debug_malloc_pass_named(T, "check_type_string"))
|
cd9dfa | 2008-03-29 | Martin Stjernholm | | #elif defined (PIKE_DEBUG)
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | #define check_type_string debug_check_type_string
|
335a41 | 2001-03-29 | Henrik Grubbström (Grubba) | | #endif /* PIKE_DEBUG */
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | |
|
97a733 | 2008-03-30 | Martin Stjernholm | | #define debug_free_type_preamble(T) do { \
debug_malloc_touch_named (T, "free_type"); \
|
cd9dfa | 2008-03-29 | Martin Stjernholm | | DO_IF_DEBUG ( \
DO_IF_PIKE_CLEANUP ( \
if (gc_external_refs_zapped) \
|
97a733 | 2008-03-30 | Martin Stjernholm | | gc_check_zapped (T, PIKE_T_TYPE, __FILE__, __LINE__))); \
} while (0)
#define free_type(T) do { \
struct pike_type *t_ = (T); \
debug_free_type_preamble (t_); \
|
cd9dfa | 2008-03-29 | Martin Stjernholm | | debug_free_type (t_); \
} while (0)
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | |
|
97a733 | 2008-03-30 | Martin Stjernholm | | #define free_pike_type free_type
|
1d5328 | 1996-11-25 | Fredrik Hübinette (Hubbe) | | extern int max_correct_args;
|
c507ca | 2007-03-20 | Henrik Grubbström (Grubba) | | PMOD_EXPORT extern struct pike_type *string0_type_string;
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | | PMOD_EXPORT extern struct pike_type *string_type_string;
PMOD_EXPORT extern struct pike_type *int_type_string;
PMOD_EXPORT extern struct pike_type *float_type_string;
PMOD_EXPORT extern struct pike_type *object_type_string;
PMOD_EXPORT extern struct pike_type *function_type_string;
PMOD_EXPORT extern struct pike_type *program_type_string;
PMOD_EXPORT extern struct pike_type *array_type_string;
|
dc8ade | 2001-03-02 | Henrik Grubbström (Grubba) | | PMOD_EXPORT extern struct pike_type *multiset_type_string;
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | | PMOD_EXPORT extern struct pike_type *mapping_type_string;
PMOD_EXPORT extern struct pike_type *type_type_string;
PMOD_EXPORT extern struct pike_type *mixed_type_string;
PMOD_EXPORT extern struct pike_type *void_type_string;
PMOD_EXPORT extern struct pike_type *zero_type_string;
PMOD_EXPORT extern struct pike_type *any_type_string;
PMOD_EXPORT extern struct pike_type *weak_type_string;
|
6f16cb | 2008-05-18 | Henrik Grubbström (Grubba) | | extern struct pike_type *sscanf_type_string;
extern struct pike_type *sscanf_76_type_string;
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | |
|
369940 | 2001-02-20 | Henrik Grubbström (Grubba) | | #define CONSTTYPE(X) make_pike_type(X)
|
940501 | 2007-04-26 | Martin Stjernholm | |
#ifdef DO_PIKE_CLEANUP
|
a7f052 | 2001-03-02 | Henrik Grubbström (Grubba) | | struct pike_type_location
{
struct pike_type *t;
struct pike_type_location *next;
};
extern struct pike_type_location *all_pike_type_locations;
#define MAKE_CONSTANT_TYPE(T, X) do { \
static struct pike_type_location type_; \
|
2129d2 | 2001-03-28 | Henrik Grubbström (Grubba) | | if (!type_.t) { \
|
a7f052 | 2001-03-02 | Henrik Grubbström (Grubba) | | type_.t = CONSTTYPE(X); \
type_.next = all_pike_type_locations; \
all_pike_type_locations = &type_; \
} \
|
be6fec | 2001-04-01 | Henrik Grubbström (Grubba) | | copy_pike_type((T), type_.t); \
|
a7f052 | 2001-03-02 | Henrik Grubbström (Grubba) | | } while(0)
|
940501 | 2007-04-26 | Martin Stjernholm | | #else /* !DO_PIKE_CLEANUP */
|
a7f052 | 2001-03-02 | Henrik Grubbström (Grubba) | | #define MAKE_CONSTANT_TYPE(T, X) do { \
static struct pike_type *type_; \
if (!type_) { \
type_ = CONSTTYPE(X); \
} \
|
be6fec | 2001-04-01 | Henrik Grubbström (Grubba) | | copy_pike_type((T), type_); \
|
a7f052 | 2001-03-02 | Henrik Grubbström (Grubba) | | } while(0)
|
940501 | 2007-04-26 | Martin Stjernholm | | #endif /* DO_PIKE_CLEANUP */
|
b2d75f | 1999-10-25 | Fredrik Hübinette (Hubbe) | |
|
71f3a2 | 1998-11-22 | Fredrik Hübinette (Hubbe) | | #ifdef PIKE_DEBUG
|
fb2f66 | 1998-11-05 | Fredrik Hübinette (Hubbe) | | #define init_type_stack() type_stack_mark()
#define exit_type_stack() do {\
|
393a59 | 2000-08-16 | Henrik Grubbström (Grubba) | | ptrdiff_t q_q_q_q = pop_stack_mark(); \
|
5aad93 | 2002-08-15 | Marcus Comstedt | | if(q_q_q_q) Pike_fatal("Type stack out of wack! %ld\n", \
|
d1cac5 | 2000-09-07 | Henrik Grubbström (Grubba) | | PTRDIFF_T_TO_LONG(q_q_q_q)); \
|
fb2f66 | 1998-11-05 | Fredrik Hübinette (Hubbe) | | } while(0)
#else
|
36feac | 1997-03-06 | Fredrik Hübinette (Hubbe) | | #define init_type_stack type_stack_mark
#define exit_type_stack pop_stack_mark
|
fb2f66 | 1998-11-05 | Fredrik Hübinette (Hubbe) | | #endif
|
36feac | 1997-03-06 | Fredrik Hübinette (Hubbe) | |
|
7e877a | 2003-04-02 | Martin Stjernholm | | void debug_push_type(unsigned int type);
void debug_push_reverse_type(unsigned int type);
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | #ifdef DEBUG_MALLOC
#define push_type(T) do { debug_push_type(T); debug_malloc_pass(debug_peek_type_stack()); } while(0)
#define push_reverse_type(T) do { debug_push_reverse_type(T); debug_malloc_pass(debug_peek_type_stack()); } while(0)
#else /* !DEBUG_MALLOC */
#define push_type debug_push_type
#define push_reverse_type debug_push_reverse_type
#endif /* DEBUG_MALLOC */
|
1a647d | 2001-03-03 | Henrik Grubbström (Grubba) | |
|
134717 | 1998-04-23 | Fredrik Hübinette (Hubbe) | | #define type_stack_mark() do { \
|
bad516 | 2000-06-23 | Fredrik Hübinette (Hubbe) | | if(Pike_compiler->pike_type_mark_stackp >= pike_type_mark_stack + NELEM(pike_type_mark_stack)) \
|
6de085 | 2004-01-23 | Martin Nilsson | | Pike_fatal("Type mark stack overflow.\n"); \
|
8e8b2e | 1999-11-24 | Henrik Grubbström (Grubba) | | else { \
|
bad516 | 2000-06-23 | Fredrik Hübinette (Hubbe) | | *Pike_compiler->pike_type_mark_stackp=Pike_compiler->type_stackp; \
Pike_compiler->pike_type_mark_stackp++; \
|
8e8b2e | 1999-11-24 | Henrik Grubbström (Grubba) | | } \
|
1a647d | 2001-03-03 | Henrik Grubbström (Grubba) | | TYPE_STACK_DEBUG("type_stack_mark"); \
|
91aab4 | 1999-12-13 | Martin Stjernholm | | } while(0)
|
134717 | 1998-04-23 | Fredrik Hübinette (Hubbe) | | #define reset_type_stack() do { \
type_stack_pop_to_mark(); \
type_stack_mark(); \
} while(0)
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | |
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | void debug_check_type_string(struct pike_type *s);
|
be478c | 1997-08-30 | Henrik Grubbström (Grubba) | | void init_types(void);
|
e0755c | 2000-08-15 | Henrik Grubbström (Grubba) | | ptrdiff_t pop_stack_mark(void);
|
7e877a | 2003-04-02 | Martin Stjernholm | | void debug_pop_type_stack(unsigned int expected);
|
be478c | 1997-08-30 | Henrik Grubbström (Grubba) | | void type_stack_pop_to_mark(void);
void type_stack_reverse(void);
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | struct pike_type *debug_peek_type_stack(void);
|
69aa4b | 2003-01-26 | Mirar (Pontus Hagland) | | void debug_push_int_type(INT_TYPE min, INT_TYPE max);
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | void debug_push_object_type(int flag, INT32 id);
void debug_push_object_type_backwards(int flag, INT32 id);
|
912912 | 2007-04-21 | Henrik Grubbström (Grubba) | | void debug_push_type_attribute(struct pike_string *attr);
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | void debug_push_type_name(struct pike_string *name);
|
b660c8 | 1999-03-01 | Fredrik Hübinette (Hubbe) | | INT32 extract_type_int(char *p);
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | void debug_push_unfinished_type(char *s);
void debug_push_assign_type(int marker);
void debug_push_finished_type(struct pike_type *type);
void debug_push_finished_type_backwards(struct pike_type *type);
|
b8d560 | 2007-11-11 | Martin Nilsson | | void debug_push_scope_type(int level);
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | | struct pike_type *debug_pop_unfinished_type(void);
|
884b6f | 2008-06-17 | Martin Stjernholm | | void compiler_discard_type (void);
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | | struct pike_type *debug_pop_type(void);
struct pike_type *debug_compiler_pop_type(void);
|
0929a0 | 2002-09-12 | Marcus Comstedt | | struct pike_type *parse_type(const char *s);
|
e0755c | 2000-08-15 | Henrik Grubbström (Grubba) | | void stupid_describe_type(char *a, ptrdiff_t len);
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | | void simple_describe_type(struct pike_type *s);
|
349641 | 2001-02-25 | Henrik Grubbström (Grubba) | | void my_describe_type(struct pike_type *type);
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | | struct pike_string *describe_type(struct pike_type *type);
TYPE_T compile_type_to_runtime_type(struct pike_type *s);
struct pike_type *or_pike_types(struct pike_type *a,
struct pike_type *b,
int zero_implied);
struct pike_type *and_pike_types(struct pike_type *a,
struct pike_type *b);
|
b8a688 | 2001-02-26 | Henrik Grubbström (Grubba) | | int strict_check_call(struct pike_type *fun_type, struct pike_type *arg_type);
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | | int check_soft_cast(struct pike_type *to, struct pike_type *from);
int match_types(struct pike_type *a,struct pike_type *b);
int pike_types_le(struct pike_type *a, struct pike_type *b);
struct pike_type *index_type(struct pike_type *type,
|
6e4c64 | 2002-09-11 | Marcus Comstedt | | struct pike_type *type_of_index,
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | | node *n);
|
663cbf | 2002-05-15 | Henrik Grubbström (Grubba) | | struct pike_type *range_type(struct pike_type *type,
struct pike_type *index1_type,
struct pike_type *index2_type);
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | | struct pike_type *array_value_type(struct pike_type *array_type);
struct pike_type *key_type(struct pike_type *type, node *n);
int check_indexing(struct pike_type *type,
|
6e4c64 | 2002-09-11 | Marcus Comstedt | | struct pike_type *type_of_index,
|
b8cda2 | 1997-01-21 | Fredrik Hübinette (Hubbe) | | node *n);
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | | int count_arguments(struct pike_type *s);
int minimum_arguments(struct pike_type *s);
|
1a647d | 2001-03-03 | Henrik Grubbström (Grubba) | | struct pike_type *check_call(struct pike_type *args,
struct pike_type *type,
int strict);
|
2d787e | 2006-10-27 | Henrik Grubbström (Grubba) | | struct pike_type *get_argument_type(struct pike_type *fun, int arg_no);
|
c6747d | 2007-04-13 | Henrik Grubbström (Grubba) | | struct pike_type *soft_cast(struct pike_type *soft_type,
struct pike_type *orig_type,
int flags);
|
0e835b | 2007-03-29 | Henrik Grubbström (Grubba) | | struct pike_type *low_new_check_call(struct pike_type *fun_type,
struct pike_type *arg_type,
|
912912 | 2007-04-21 | Henrik Grubbström (Grubba) | | INT32 flags,
struct svalue *sval);
|
00f45d | 2007-03-26 | Henrik Grubbström (Grubba) | | struct pike_type *new_get_return_type(struct pike_type *fun_type,
INT32 flags);
struct pike_type *get_first_arg_type(struct pike_type *fun_type,
INT32 flags);
|
ebd2e4 | 2008-06-18 | Henrik Grubbström (Grubba) | | struct pike_type *check_splice_call(struct pike_string *fun_name,
struct pike_type *fun_type,
INT32 argno,
struct pike_type *arg_type,
struct svalue *sval,
INT32 flags);
|
912912 | 2007-04-21 | Henrik Grubbström (Grubba) | | struct pike_type *new_check_call(struct pike_string *fun_name,
struct pike_type *fun_type,
|
6f16cb | 2008-05-18 | Henrik Grubbström (Grubba) | | node *args, INT32 *argno, INT32 flags);
|
8cfb91 | 2008-04-25 | Henrik Grubbström (Grubba) | | struct pike_type *zzap_function_return(struct pike_type *t,
struct pike_type *fun_ret);
|
01d015 | 2008-07-09 | Martin Stjernholm | | struct pike_type *get_type_of_svalue(const struct svalue *s);
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | | struct pike_type *object_type_to_program_type(struct pike_type *obj_t);
|
e68c78 | 2006-07-05 | Martin Stjernholm | | PMOD_EXPORT char *get_name_of_type(TYPE_T t);
|
be478c | 1997-08-30 | Henrik Grubbström (Grubba) | | void cleanup_pike_types(void);
|
f52b4a | 2001-12-14 | Martin Nilsson | | void cleanup_pike_type_table(void);
|
467f24 | 2011-01-28 | Henrik Grubbström (Grubba) | | PMOD_EXPORT void *find_type(struct pike_type *t,
void *(*cb)(struct pike_type *));
|
1eb985 | 2008-05-11 | Martin Stjernholm | | PMOD_EXPORT void visit_type (struct pike_type *t, int action);
|
cd9dfa | 2008-03-29 | Martin Stjernholm | | void gc_mark_type_as_referenced(struct pike_type *t);
|
97a733 | 2008-03-30 | Martin Stjernholm | | void gc_check_type (struct pike_type *t);
|
cd9dfa | 2008-03-29 | Martin Stjernholm | | void gc_check_all_types (void);
|
d5b674 | 2001-02-23 | Henrik Grubbström (Grubba) | | int type_may_overload(struct pike_type *type, int lfun);
|
94d66b | 2008-05-24 | Henrik Grubbström (Grubba) | | void yyexplain_nonmatching_types(int severity_level,
struct pike_string *a_file,
INT32 a_line,
struct pike_type *type_a,
struct pike_string *b_file,
INT32 b_line,
struct pike_type *type_b);
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | struct pike_type *debug_make_pike_type(const char *t);
|
9e6f6f | 2001-03-18 | Henrik Grubbström (Grubba) | | struct pike_string *type_to_string(struct pike_type *t);
|
d5b674 | 2001-02-23 | Henrik Grubbström (Grubba) | | int pike_type_allow_premature_toss(struct pike_type *type);
|
912912 | 2007-04-21 | Henrik Grubbström (Grubba) | | void register_attribute_handler(struct pike_string *attr,
struct svalue *handler);
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | |
|
5e8344 | 2008-05-11 | Martin Stjernholm | | #define visit_type_ref(T, REF_TYPE) \
visit_ref (pass_type (T), (REF_TYPE), \
(visit_thing_fn *) &visit_type, NULL)
|
391350 | 2002-06-25 | Henrik Grubbström (Grubba) | | #if 0 /* FIXME: Not supported under USE_PIKE_TYPE yet. */
|
91aab4 | 1999-12-13 | Martin Stjernholm | |
#define dtStore(TYPE) {int e; for (e=0; e<CONSTANT_STRLEN(TYPE); e++) unsafe_push_type((TYPE)[e]);}
#define dtArr(VAL) {unsafe_push_type(PIKE_T_ARRAY); {VAL}}
#define dtArray dtArr(dtMix)
#define dtMap(IND,VAL) {unsafe_push_type(PIKE_T_MAPPING); {VAL} {IND}}
#define dtMapping dtMap(dtMix,dtMix)
#define dtSet(IND) {unsafe_push_type(PIKE_T_MULTISET); {IND}}
#define dtMultiset dtSet(dtMix)
|
361142 | 2001-02-20 | Henrik Grubbström (Grubba) | | #define dtObjImpl(PROGRAM) {push_object_type_backwards(0, (PROGRAM)->id);}
#define dtObjIs(PROGRAM) {push_object_type_backwards(1, (PROGRAM)->id);}
|
91aab4 | 1999-12-13 | Martin Stjernholm | | #define dtObj dtStore(tObj)
#define dtFuncV(ARGS,REST,RET) MagicdtFuncV(RET,REST,ARGS)
#define dtFunc(ARGS,RET) MagicdtFunc(RET,ARGS)
#define MagicdtFuncV(RET,REST,ARGS) {unsafe_push_type(PIKE_T_FUNCTION); {ARGS} unsafe_push_type(T_MANY); {REST} {RET}}
#define MagicdtFunc(RET,ARGS) dtFuncV(ARGS {}, dtVoid, RET)
#define dtFunction dtFuncV({},dtAny,dtAny)
#define dtNone {}
#define dtPrg {unsafe_push_type(PIKE_T_PROGRAM);}
#define dtProgram {unsafe_push_type(PIKE_T_PROGRAM);}
#define dtStr {unsafe_push_type(PIKE_T_STRING);}
#define dtString {unsafe_push_type(PIKE_T_STRING);}
#define dtType {unsafe_push_type(PIKE_T_TYPE);}
#define dtFlt {unsafe_push_type(PIKE_T_FLOAT);}
#define dtFloat {unsafe_push_type(PIKE_T_FLOAT);}
#define dtIntRange(LOW,HIGH) {unsafe_push_type(PIKE_T_INT); push_type_int_backwards(LOW); push_type_int_backwards(HIGH);}
#define dtInt dtStore(tInt)
#define dtZero {unsafe_push_type(PIKE_T_ZERO);}
#define dtVoid {unsafe_push_type(T_VOID);}
#define dtVar(X) {unsafe_push_type(X);}
#define dtSetvar(X,TYPE) {unsafe_push_type(T_ASSIGN); {TYPE}}
#define dtNot(TYPE) {unsafe_push_type(T_NOT); {TYPE}}
#define dtAnd(A,B) {unsafe_push_type(T_AND); {A} {B}}
#define dtOr(A,B) {unsafe_push_type(T_OR); {A} {B}}
#define dtOr3(A,B,C) dtOr(A,dtOr(B,C))
#define dtOr4(A,B,C,D) dtOr(A,dtOr3(B,C,D))
#define dtOr5(A,B,C,D,E) dtOr(A,dtOr4(B,C,D,E))
#define dtOr6(A,B,C,D,E,F) dtOr(A,dtOr5(B,C,D,E,F))
|
2cd8ca | 2000-07-28 | Fredrik Hübinette (Hubbe) | | #define dtMix {unsafe_push_type(PIKE_T_MIXED);}
#define dtMixed {unsafe_push_type(PIKE_T_MIXED);}
|
91aab4 | 1999-12-13 | Martin Stjernholm | | #define dtComplex dtStore(tComplex)
#define dtStringIndicable dtStore(tStringIndicable)
#define dtRef dtStore(tRef)
#define dtIfnot(A,B) dtAnd(dtNot(A),B)
#define dtAny dtStore(tAny)
#define DTYPE_START do { \
unsafe_type_stack_mark(); \
unsafe_type_stack_mark(); \
} while (0)
#define DTYPE_END(TYPESTR) do { \
|
6de085 | 2004-01-23 | Martin Nilsson | | if(Pike_compiler->type_stackp >= type_stack + sizeof(type_stack)) \
Pike_fatal("Type stack overflow.\n"); \
|
91aab4 | 1999-12-13 | Martin Stjernholm | | type_stack_reverse(); \
(TYPESTR)=pop_unfinished_type(); \
} while (0)
|
391350 | 2002-06-25 | Henrik Grubbström (Grubba) | | #endif /* 0 */
|
91aab4 | 1999-12-13 | Martin Stjernholm | |
|
61e9a0 | 1998-01-25 | Fredrik Hübinette (Hubbe) | | #ifdef DEBUG_MALLOC
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | | #define pop_type() ((struct pike_type *)debug_malloc_pass(debug_pop_type()))
#define compiler_pop_type() ((struct pike_type *)debug_malloc_pass(debug_compiler_pop_type()))
|
61e9a0 | 1998-01-25 | Fredrik Hübinette (Hubbe) | | #define pop_unfinished_type() \
|
d68a07 | 2001-02-20 | Henrik Grubbström (Grubba) | | ((struct pike_type *)debug_malloc_pass(debug_pop_unfinished_type()))
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | #define make_pike_type(X) \
((struct pike_type *)debug_malloc_pass(debug_make_pike_type(X)))
|
00f45d | 2007-03-26 | Henrik Grubbström (Grubba) | | #define peek_type_stack() ((struct pike_type *)debug_malloc_pass(debug_peek_type_stack()))
|
5b368e | 2001-03-31 | Henrik Grubbström (Grubba) | | #define pop_type_stack(E) do { debug_malloc_pass(debug_peek_type_stack()); debug_pop_type_stack(E); } while(0)
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | #define push_int_type(MIN,MAX) do { debug_push_int_type(MIN,MAX);debug_malloc_pass(debug_peek_type_stack()); } while(0)
#define push_object_type(FLAG,ID) do { debug_push_object_type(FLAG,ID);debug_malloc_pass(debug_peek_type_stack()); } while(0)
#define push_object_type_backwards(FLAG,ID) do { debug_push_object_type_backwards(FLAG,ID);debug_malloc_pass(debug_peek_type_stack()); } while(0)
#define push_scope_type(LEVEL) do { debug_push_scope_type(LEVEL);debug_malloc_pass(debug_peek_type_stack()); } while(0)
|
912912 | 2007-04-21 | Henrik Grubbström (Grubba) | | #define push_type_attribute(ATTR) do { debug_push_type_attribute((struct pike_string *)debug_malloc_pass(ATTR));debug_malloc_pass(debug_peek_type_stack()); } while(0)
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | #define push_type_name(NAME) do { debug_push_type_name((struct pike_string *)debug_malloc_pass(NAME));debug_malloc_pass(debug_peek_type_stack()); } while(0)
#define push_unfinished_type(S) ERROR
#define push_assign_type(MARKER) do { debug_push_assign_type(MARKER);debug_malloc_pass(debug_peek_type_stack()); } while(0)
#define push_finished_type(T) do { debug_push_finished_type((struct pike_type *)debug_malloc_pass(T));debug_malloc_pass(debug_peek_type_stack()); } while(0)
|
00f45d | 2007-03-26 | Henrik Grubbström (Grubba) | | #define push_finished_type_with_markers(T,M,MS) do { debug_push_finished_type_with_markers((struct pike_type *)debug_malloc_pass(T),M,MS);debug_malloc_pass(debug_peek_type_stack()); } while(0)
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | #define push_finished_type_backwards(T) ERROR
|
61e9a0 | 1998-01-25 | Fredrik Hübinette (Hubbe) | | #else
|
52409b | 2001-03-29 | Henrik Grubbström (Grubba) | | #define make_pike_type debug_make_pike_type
|
61e9a0 | 1998-01-25 | Fredrik Hübinette (Hubbe) | | #define pop_type debug_pop_type
|
4142a6 | 1998-05-19 | Fredrik Hübinette (Hubbe) | | #define compiler_pop_type debug_compiler_pop_type
|
61e9a0 | 1998-01-25 | Fredrik Hübinette (Hubbe) | | #define pop_unfinished_type debug_pop_unfinished_type
|
00f45d | 2007-03-26 | Henrik Grubbström (Grubba) | | #define peek_type_stack debug_peek_type_stack
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | #define pop_type_stack debug_pop_type_stack
#define push_int_type debug_push_int_type
#define push_object_type debug_push_object_type
#define push_object_type_backwards debug_push_object_type_backwards
#define push_scope_type debug_push_scope_type
|
912912 | 2007-04-21 | Henrik Grubbström (Grubba) | | #define push_type_attribute debug_push_type_attribute
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | #define push_type_name debug_push_type_name
#define push_unfinished_type debug_push_unfinished_type
#define push_assign_type debug_push_assign_type
#define push_finished_type debug_push_finished_type
|
a0315f | 2001-03-29 | Henrik Grubbström (Grubba) | | #define push_finished_type_with_markers debug_push_finished_type_with_markers
|
9b5a82 | 2001-03-29 | Henrik Grubbström (Grubba) | | #define push_finished_type_backwards debug_push_finished_type_backwards
|
61e9a0 | 1998-01-25 | Fredrik Hübinette (Hubbe) | | #endif
|
45ee5d | 1999-02-10 | Fredrik Hübinette (Hubbe) | | #ifndef PIKE_DEBUG
#define check_type_string(X)
#endif
|
06983f | 1996-09-22 | Fredrik Hübinette (Hubbe) | | #endif
|