[t][TT #763] Fix is_deeply() on hashes with undefs and add tests
[parrot.git] / include / parrot / enums.h
blob83799260a6bc469a7471248dcb256489a864f0c4
1 /* enums.h
2 * $Id$
3 * Copyright (C) 2001-2008, Parrot Foundation.
4 * Overview:
5 * enums shared by much of the stack-handling code
6 * Data Structure and Algorithms:
7 * History:
8 * Notes:
9 * References:
12 #ifndef PARROT_ENUMS_H_GUARD
13 #define PARROT_ENUMS_H_GUARD
15 typedef enum {
16 NO_STACK_ENTRY_TYPE = 0,
17 STACK_ENTRY_MARK = 1,
18 STACK_ENTRY_DESTINATION = 2,
19 STACK_ENTRY_ACTION = 3,
20 STACK_ENTRY_PMC = 4
21 } Stack_entry_type;
23 typedef enum {
24 NO_STACK_ENTRY_FLAGS = 0,
25 STACK_ENTRY_CLEANUP_FLAG = 1 << 0
26 } Stack_entry_flags;
28 typedef enum {
29 NO_STACK_CHUNK_FLAGS = 0,
30 STACK_CHUNK_COW_FLAG = 1 << 0
31 } Stack_chunk_flags;
34 /* &gen_from_enum(iterator.pasm) */
35 typedef enum {
36 ITERATE_FROM_START,
37 ITERATE_FROM_START_KEYS,
38 ITERATE_GET_NEXT,
39 ITERATE_GET_PREV,
40 ITERATE_FROM_END
41 } Iterator_action_t;
43 /* &end_gen */
45 /* &gen_from_enum(call_bits.pasm lib/Parrot/Pmc2c/PCCMETHOD_BITS.pm) */
46 typedef enum {
47 /* 4 low bits are argument types */
48 PARROT_ARG_INTVAL = 0x000, /* 0 */
49 PARROT_ARG_STRING = 0x001, /* 1 */
50 PARROT_ARG_PMC = 0x002, /* 2 */
51 PARROT_ARG_FLOATVAL = 0x003, /* 3 */
52 PARROT_ARG_TYPE_MASK = 0x00f,
53 /* argument meaning and conversion bits */
54 PARROT_ARG_CONSTANT = 0x010, /* 16 */
55 /* bits a user has to define */
56 PARROT_ARG_FLATTEN = 0x020, /* .flatten_arg */
57 PARROT_ARG_SLURPY_ARRAY = PARROT_ARG_FLATTEN, /* i.e. foldup */
58 /* unused - 0x040 */
59 PARROT_ARG_OPTIONAL = 0x080, /* 128 */
60 PARROT_ARG_OPT_FLAG = 0x100, /* 256 prev optional was set */
61 PARROT_ARG_NAME = 0x200, /* 512 this String is an arg name */
62 PARROT_ARG_LOOKAHEAD = 0x400, /* 1024 this is a lookahead argument */
63 PARROT_ARG_INVOCANT = 0x800 /* 2048 this PMC is an invocant */
64 /* more to come soon */
66 } Call_bits_enum_t;
68 /* &end_gen */
70 #define PARROT_ARG_INTVAL_ISSET(o) ((o) & PARROT_ARG_INTVAL)
71 #define PARROT_ARG_STRING_ISSET(o) ((o) & PARROT_ARG_STRING)
72 #define PARROT_ARG_PMC_ISSET(o) ((o) & PARROT_ARG_PMC)
73 #define PARROT_ARG_FLOATVAL_ISSET(o) ((o) & PARROT_ARG_FLOATVAL)
74 #define PARROT_ARG_TYPE_MASK_MASK(o) ((o) & PARROT_ARG_TYPE_MASK)
75 #define PARROT_ARG_TYPE(o) PARROT_ARG_TYPE_MASK_MASK(o)
76 #define PARROT_ARG_CONSTANT_ISSET(o) ((o) & PARROT_ARG_CONSTANT)
77 #define PARROT_ARG_FLATTEN_ISSET(o) ((o) & PARROT_ARG_FLATTEN)
78 #define PARROT_ARG_SLURPY_ARRAY_ISSET(o) ((o) & PARROT_ARG_SLURPY_ARRAY)
79 #define PARROT_ARG_OPTIONAL_ISSET(o) ((o) & PARROT_ARG_OPTIONAL)
80 #define PARROT_ARG_OPT_FLAG_ISSET(o) ((o) & PARROT_ARG_OPT_FLAG)
81 #define PARROT_ARG_NAME_ISSET(o) ((o) & PARROT_ARG_NAME)
82 #define PARROT_ARG_INVOCANT_ISSET(o) ((o) & PARROT_ARG_INVOCANT)
85 #endif /* PARROT_ENUMS_H_GUARD */
88 * Local variables:
89 * c-file-style: "parrot"
90 * End:
91 * vim: expandtab shiftwidth=4: