2 * Copyright (c) 2003, 2005 Lev Walkin <vlm@lionet.info>. All rights reserved.
3 * Redistribution and modifications are permitted subject to BSD license.
5 #include <asn_internal.h>
9 * BOOLEAN basic type description.
11 static const ber_tlv_tag_t asn_DEF_BOOLEAN_tags[] = {
12 (ASN_TAG_CLASS_UNIVERSAL | (1 << 2))
14 asn_TYPE_operation_t asn_OP_BOOLEAN = {
16 #if !defined(ASN_DISABLE_PRINT_SUPPORT)
20 #endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
22 #if !defined(ASN_DISABLE_BER_SUPPORT)
28 #endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
29 #if !defined(ASN_DISABLE_XER_SUPPORT)
35 #endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
36 #if !defined(ASN_DISABLE_JER_SUPPORT)
40 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
41 #if !defined(ASN_DISABLE_OER_SUPPORT)
47 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
48 #if !defined(ASN_DISABLE_UPER_SUPPORT)
49 BOOLEAN_decode_uper, /* Unaligned PER decoder */
50 BOOLEAN_encode_uper, /* Unaligned PER encoder */
54 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
55 #if !defined(ASN_DISABLE_APER_SUPPORT)
56 BOOLEAN_decode_aper, /* Aligned PER decoder */
57 BOOLEAN_encode_aper, /* Aligned PER encoder */
61 #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
62 #if !defined(ASN_DISABLE_RFILL_SUPPORT)
66 #endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
67 0 /* Use generic outmost tag fetcher */
69 asn_TYPE_descriptor_t asn_DEF_BOOLEAN = {
74 sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]),
75 asn_DEF_BOOLEAN_tags, /* Same as above */
76 sizeof(asn_DEF_BOOLEAN_tags) / sizeof(asn_DEF_BOOLEAN_tags[0]),
78 #if !defined(ASN_DISABLE_OER_SUPPORT)
80 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
81 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
83 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
84 asn_generic_no_constraint
86 0, 0, /* No members */
91 BOOLEAN_free(const asn_TYPE_descriptor_t *td, void *ptr,
92 enum asn_struct_free_method method) {
95 case ASFM_FREE_EVERYTHING:
98 case ASFM_FREE_UNDERLYING:
100 case ASFM_FREE_UNDERLYING_AND_RESET:
101 memset(ptr, 0, sizeof(BOOLEAN_t));
108 BOOLEAN_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
110 const BOOLEAN_t *a = aptr;
111 const BOOLEAN_t *b = bptr;
116 if(!*a == !*b) { /* TRUE can be encoded by any non-zero byte. */