Go to the documentation of this file.
37 #define NULL ((void *)0)
54 #define REVERSE_BIT_POSITION(p) (7 - p)
65 #define BIT_PACKED 0x00 // 0b00000000
66 #define BYTE_ALIGNMENT 0x40 // 0b01000000
67 #define PRE_COMPRESSION 0x80 // 0b10000000
68 #define ALIGNMENT 0xc0 // 0b11000000
70 #define COMPRESSION 0x01 // 0b00000001
71 #define STRICT 0x02 // 0b00000010
72 #define FRAGMENT 0x04 // 0b00000100
73 #define SELF_CONTAINED 0x08 // 0b00001000
75 #define GET_ALIGNMENT(p) ((p) & ALIGNMENT)
76 #define WITH_COMPRESSION(p) (((p) & COMPRESSION) != 0)
77 #define WITH_STRICT(p) (((p) & STRICT) != 0)
78 #define WITH_FRAGMENT(p) (((p) & FRAGMENT) != 0)
79 #define WITH_SELF_CONTAINED(p) (((p) & SELF_CONTAINED) != 0)
81 #define SET_ALIGNMENT(p, align_const) ((p) = (p) | align_const)
82 #define SET_COMPRESSION(p) ((p) = (p) | COMPRESSION)
83 #define SET_STRICT(p) ((p) = (p) | STRICT)
84 #define SET_FRAGMENT(p) ((p) = (p) | FRAGMENT)
85 #define SET_SELF_CONTAINED(p) ((p) = (p) | SELF_CONTAINED)
126 #define PRESERVE_COMMENTS 0x01 // 0b00000001
127 #define PRESERVE_PIS 0x02 // 0b00000010
128 #define PRESERVE_DTD 0x04 // 0b00000100
129 #define PRESERVE_PREFIXES 0x08 // 0b00001000
130 #define PRESERVE_LEXVALUES 0x10 // 0b00010000
132 #define IS_PRESERVED(p, mask) (((p) & (mask)) != 0)
133 #define SET_PRESERVED(p, preserve_const) ((p) = (p) | (preserve_const))
201 #define TZONE_PRESENCE 0x01 // 0b00000001
202 #define FRACT_PRESENCE 0x02 // 0b00000010
204 #define IS_PRESENT(p, mask) (((p) & (mask)) != 0)
207 #ifndef EXIP_UNSIGNED_INTEGER
208 # define EXIP_UNSIGNED_INTEGER uint64_t
214 # define EXIP_INTEGER int64_t
234 # define EXIP_FLOAT struct EXIFloat
253 # define EXIP_DECIMAL Float
259 # define EXIP_INDEX size_t
264 #ifndef EXIP_INDEX_MAX
265 # define EXIP_INDEX_MAX SIZE_MAX
268 #define INDEX_MAX EXIP_INDEX_MAX
270 #ifndef EXIP_SMALL_INDEX
271 # define EXIP_SMALL_INDEX size_t
276 #ifndef EXIP_SMALL_INDEX_MAX
277 # define EXIP_SMALL_INDEX_MAX SIZE_MAX
280 #define SMALL_INDEX_MAX EXIP_SMALL_INDEX_MAX
282 #ifndef EXIP_IMPLICIT_DATA_TYPE_CONVERSION
283 # define EXIP_IMPLICIT_DATA_TYPE_CONVERSION ON
292 # define CHAR_TYPE char
300 # define EXIP_STRTOLL strtoll
336 #define URI_MAX SMALL_INDEX_MAX
337 #define LN_MAX INDEX_MAX
355 #define ALLOCATION_ARRAY_SIZE 100
522 #define GET_EVENT_CLASS(evnt) (evnt/10)
574 #define GET_VALUE_TYPE_CLASS(value_type) (value_type/10)
576 #define PROD_CONTENT_MASK 0xFFFFFF // 0b00000000111111111111111111111111
578 #define GET_PROD_EXI_EVENT(content) (content>>24)
579 #define GET_PROD_EXI_EVENT_CLASS(content) GET_EVENT_CLASS((content>>24))
580 #define SET_PROD_EXI_EVENT(content, eventType) (content = (content & PROD_CONTENT_MASK) | (((uint32_t) eventType)<<24))
581 #define GET_PROD_NON_TERM(content) (content & PROD_CONTENT_MASK)
582 #define SET_PROD_NON_TERM(content, nt) (content = (content & ~PROD_CONTENT_MASK) | (nt & PROD_CONTENT_MASK))
632 #ifndef GR_VOID_NON_TERMINAL
633 # define GR_VOID_NON_TERMINAL SMALL_INDEX_MAX
636 #define GR_DOC_CONTENT 0
639 #define GR_START_TAG_CONTENT 0
640 #define GR_ELEMENT_CONTENT 1
641 #define GR_CONTENT_2 (GR_VOID_NON_TERMINAL-1)
643 #define GR_FRAGMENT_CONTENT 0
667 #define RULE_CONTAIN_EE_OR_XSI_TYPE_MASK 0x01 // 0b0000000000000001
669 #define RULE_CONTAIN_EE(meta) ((meta & RULE_CONTAIN_EE_OR_XSI_TYPE_MASK) != 0)
670 #define RULE_SET_CONTAIN_EE(meta) (meta = meta | RULE_CONTAIN_EE_OR_XSI_TYPE_MASK)
671 #define RULE_CONTAIN_XSI_TYPE(meta) ((meta & RULE_CONTAIN_EE_OR_XSI_TYPE_MASK) != 0)
672 #define RULE_SET_CONTAIN_XSI_TYPE(meta) (meta = meta | RULE_CONTAIN_EE_OR_XSI_TYPE_MASK)
674 #define RULE_SET_AT_COUNT(meta, ac) (meta = meta | (ac<<1))
675 #define RULE_GET_AT_COUNT(meta) (meta>>1)
677 #if BUILD_IN_GRAMMARS_USE
705 #define IS_NILLABLE(p) ((p & GR_PROP_NILLABLE) != 0)
706 #define IS_BUILT_IN_ELEM(p) ((p & GR_PROP_BUILT_IN_ELEMENT) != 0)
707 #define IS_SCHEMA(p) ((p & GR_PROP_SCHEMA_INFORMED) != 0)
708 #define IS_DOCUMENT(p) ((p & GR_PROP_DOCUMENT) != 0)
709 #define IS_FRAGMENT(p) ((p & GR_PROP_FRAGMENT) != 0)
710 #define HAS_NAMED_SUB_TYPE_OR_UNION(p) ((p & GR_PROP_NAMED_SUB_TYPE_OR_UNION) != 0)
711 #define HAS_CONTENT2(p) ((p & GR_PROP_HAS_CONTENT2) != 0)
713 #define SET_NILLABLE_GR(p) ((p) = (p) | GR_PROP_NILLABLE)
714 #define SET_BUILT_IN_ELEM_GR(p) ((p) = (p) | GR_PROP_BUILT_IN_ELEMENT)
715 #define SET_SCHEMA_GR(p) ((p) = (p) | GR_PROP_SCHEMA_INFORMED)
716 #define SET_DOCUMENT_GR(p) ((p) = (p) | GR_PROP_DOCUMENT)
717 #define SET_FRAGMENT_GR(p) ((p) = (p) | GR_PROP_FRAGMENT)
718 #define SET_NAMED_SUB_TYPE_OR_UNION(p) ((p) = (p) | GR_PROP_NAMED_SUB_TYPE_OR_UNION)
719 #define SET_HAS_CONTENT2(p) ((p) = (p) | GR_PROP_HAS_CONTENT2)
721 #define GR_PROP_BUILT_IN_ELEMENT 0x1000000 // 0b00000001000000000000000000000000
722 #define GR_PROP_SCHEMA_INFORMED 0x2000000 // 0b00000010000000000000000000000000
723 #define GR_PROP_DOCUMENT 0x4000000 // 0b00000100000000000000000000000000
724 #define GR_PROP_FRAGMENT 0x8000000 // 0b00001000000000000000000000000000
725 #define GR_PROP_NILLABLE 0x10000000 // 0b00010000000000000000000000000000
726 #define GR_PROP_NAMED_SUB_TYPE_OR_UNION 0x20000000 // 0b00100000000000000000000000000000
729 #define GR_PROP_HAS_CONTENT2 0x40000000 // 0b01000000000000000000000000000000
731 #define GR_CONTENT_INDEX_MASK 0xFFFFFF // 0b00000000111111111111111111111111
733 #define SET_CONTENT_INDEX(props, indx) (props = (props & ~GR_CONTENT_INDEX_MASK) | (indx & GR_CONTENT_INDEX_MASK))
734 #define GET_CONTENT_INDEX(props) (props & GR_CONTENT_INDEX_MASK)
794 #if VALUE_CROSSTABLE_USE
807 #if DYN_ARRAY_USE == ON
829 #if VALUE_CROSSTABLE_USE
837 #if DYN_ARRAY_USE == ON
848 #if DYN_ARRAY_USE == ON
858 #if VALUE_CROSSTABLE_USE
877 #if DYN_ARRAY_USE == ON
895 #if DYN_ARRAY_USE == ON
909 #define TYPE_FACET_LENGTH 0x0001 // 0b0000000000000001
910 #define TYPE_FACET_MIN_LENGTH 0x0002 // 0b0000000000000010
911 #define TYPE_FACET_MAX_LENGTH 0x0004 // 0b0000000000000100
912 #define TYPE_FACET_PATTERN 0x0008 // 0b0000000000001000
913 #define TYPE_FACET_ENUMERATION 0x0010 // 0b0000000000010000
914 #define TYPE_FACET_WHITE_SPACE 0x0020 // 0b0000000000100000
915 #define TYPE_FACET_MAX_INCLUSIVE 0x0040 // 0b0000000001000000
916 #define TYPE_FACET_MAX_EXCLUSIVE 0x0080 // 0b0000000010000000
917 #define TYPE_FACET_MIN_EXCLUSIVE 0x0100 // 0b0000000100000000
918 #define TYPE_FACET_MIN_INCLUSIVE 0x0200 // 0b0000001000000000
919 #define TYPE_FACET_TOTAL_DIGITS 0x0400 // 0b0000010000000000
920 #define TYPE_FACET_FRACTION_DIGITS 0x0800 // 0b0000100000000000
921 #define TYPE_FACET_NAMED_SUBTYPE_UNION 0x1000 // 0b0001000000000000
924 #define ST_CONTENT_MASK 0xFFFFFF // 0b00000000111111111111111111111111
926 #define GET_EXI_TYPE(content) (content>>24)
927 #define SET_EXI_TYPE(content, et) (content = (content & ST_CONTENT_MASK) | (((uint32_t) et)<<24))
928 #define HAS_TYPE_FACET(content, facet) ((content & facet) != 0)
929 #define SET_TYPE_FACET(content, facet) (content = (content | facet))
930 #define REMOVE_TYPE_FACET(content, facet) (content = (content & ~facet))
963 #if DYN_ARRAY_USE == ON
974 #define SIMPLE_TYPE_ENTITIES 0
975 #define SIMPLE_TYPE_ENTITY 1
976 #define SIMPLE_TYPE_ID 2
977 #define SIMPLE_TYPE_IDREF 3
978 #define SIMPLE_TYPE_IDREFS 4
979 #define SIMPLE_TYPE_NCNAME 5
980 #define SIMPLE_TYPE_NMTOKEN 6
981 #define SIMPLE_TYPE_NMTOKENS 7
982 #define SIMPLE_TYPE_NOTATION 8
983 #define SIMPLE_TYPE_NAME 9
984 #define SIMPLE_TYPE_QNAME 10
985 #define SIMPLE_TYPE_ANY_SIMPLE_TYPE 11
986 #define SIMPLE_TYPE_ANY_TYPE 12
987 #define SIMPLE_TYPE_ANY_URI 13
988 #define SIMPLE_TYPE_BASE64_BINARY 14
989 #define SIMPLE_TYPE_BOOLEAN 15
990 #define SIMPLE_TYPE_BYTE 16
991 #define SIMPLE_TYPE_DATE 17
992 #define SIMPLE_TYPE_DATE_TIME 18
993 #define SIMPLE_TYPE_DECIMAL 19
994 #define SIMPLE_TYPE_DOUBLE 20
995 #define SIMPLE_TYPE_DURATION 21
996 #define SIMPLE_TYPE_FLOAT 22
997 #define SIMPLE_TYPE_GDAY 23
998 #define SIMPLE_TYPE_GMONTH 24
999 #define SIMPLE_TYPE_GMONTH_DAY 25
1000 #define SIMPLE_TYPE_GYEAR 26
1001 #define SIMPLE_TYPE_GYEAR_MONTH 27
1002 #define SIMPLE_TYPE_HEX_BINARY 28
1003 #define SIMPLE_TYPE_INT 29
1004 #define SIMPLE_TYPE_INTEGER 30
1005 #define SIMPLE_TYPE_LANGUAGE 31
1006 #define SIMPLE_TYPE_LONG 32
1007 #define SIMPLE_TYPE_NEGATIVE_INTEGER 33
1008 #define SIMPLE_TYPE_NON_NEGATIVE_INTEGER 34
1009 #define SIMPLE_TYPE_NON_POSITIVE_INTEGER 35
1010 #define SIMPLE_TYPE_NORMALIZED_STRING 36
1011 #define SIMPLE_TYPE_POSITIVE_INTEGER 37
1012 #define SIMPLE_TYPE_SHORT 38
1013 #define SIMPLE_TYPE_STRING 39
1014 #define SIMPLE_TYPE_TIME 40
1015 #define SIMPLE_TYPE_TOKEN 41
1016 #define SIMPLE_TYPE_UNSIGNED_BYTE 42
1017 #define SIMPLE_TYPE_UNSIGNED_INT 43
1018 #define SIMPLE_TYPE_UNSIGNED_LONG 44
1019 #define SIMPLE_TYPE_UNSIGNED_SHORT 45
1021 #define SIMPLE_TYPE_COUNT 46
1024 #define XML_NAMESPACE_ID 1
1026 #define XML_SCHEMA_INSTANCE_ID 2
1027 #define XML_SCHEMA_INSTANCE_NIL_ID 0
1028 #define XML_SCHEMA_INSTANCE_TYPE_ID 1
1030 #define XML_SCHEMA_NAMESPACE_ID 3
1034 #if DYN_ARRAY_USE == ON
1043 #if EXI_PROFILE_DEFAULT
1045 # define EXI_PROFILE_STUB_GRAMMAR_INDX (INDEX_MAX-1)
1065 #if DYN_ARRAY_USE == ON