NULL.c
Go to the documentation of this file.
1 /*-
2  * Copyright (c) 2003, 2005 Lev Walkin <vlm@lionet.info>. All rights reserved.
3  * Redistribution and modifications are permitted subject to BSD license.
4  */
7 
8 /*
9  * NULL basic type description.
10  */
11 static const ber_tlv_tag_t asn_DEF_NULL_tags[] = {
12  (ASN_TAG_CLASS_UNIVERSAL | (5 << 2))
13 };
15  NULL_free,
16 #if !defined(ASN_DISABLE_PRINT_SUPPORT)
17  NULL_print,
18 #else
19  0,
20 #endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
22  NULL_copy,
23 #if !defined(ASN_DISABLE_BER_SUPPORT)
25  NULL_encode_der, /* Special handling of DER encoding */
26 #else
27  0,
28  0,
29 #endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
30 #if !defined(ASN_DISABLE_XER_SUPPORT)
33 #else
34  0,
35  0,
36 #endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
37 #if !defined(ASN_DISABLE_JER_SUPPORT)
40 #else
41  0,
42  0,
43 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
44 #if !defined(ASN_DISABLE_OER_SUPPORT)
47 #else
48  0,
49  0,
50 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
51 #if !defined(ASN_DISABLE_UPER_SUPPORT)
52  NULL_decode_uper, /* Unaligned PER decoder */
53  NULL_encode_uper, /* Unaligned PER encoder */
54 #else
55  0,
56  0,
57 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
58 #if !defined(ASN_DISABLE_APER_SUPPORT)
59  NULL_decode_aper, /* Aligned PER decoder */
60  NULL_encode_aper, /* Aligned PER encoder */
61 #else
62  0,
63  0,
64 #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
65 #if !defined(ASN_DISABLE_RFILL_SUPPORT)
67 #else
68  0,
69 #endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
70  0 /* Use generic outmost tag fetcher */
71 };
73  "NULL",
74  "NULL",
75  &asn_OP_NULL,
77  sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]),
78  asn_DEF_NULL_tags, /* Same as above */
79  sizeof(asn_DEF_NULL_tags) / sizeof(asn_DEF_NULL_tags[0]),
80  {
81 #if !defined(ASN_DISABLE_OER_SUPPORT)
82  0,
83 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
84 #if !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT)
85  0,
86 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) || !defined(ASN_DISABLE_APER_SUPPORT) */
87 #if !defined(ASN_DISABLE_JER_SUPPORT)
88  0,
89 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
91  },
92  0, 0, /* No members */
93  0 /* No specifics */
94 };
95 
96 void
97 NULL_free(const asn_TYPE_descriptor_t *td, void *ptr,
98  enum asn_struct_free_method method) {
99  if(td && ptr) {
100  switch(method) {
102  FREEMEM(ptr);
103  break;
105  break;
107  memset(ptr, 0, sizeof(NULL_t));
108  break;
109  }
110  }
111 }
112 
113 int
114 NULL_compare(const asn_TYPE_descriptor_t *td, const void *a, const void *b) {
115  (void)td;
116  (void)a;
117  (void)b;
118  return 0;
119 }
120 
121 int
122 NULL_copy(const asn_TYPE_descriptor_t *td, void **a, const void *b) {
123  (void)td;
124 
125  if(b && !*a) {
126  *a = CALLOC(1, sizeof(NULL_t));
127  if (!*a) return -1;
128  }
129 
130  return 0;
131 }
asn_OP_NULL
asn_TYPE_operation_t asn_OP_NULL
Definition: NULL.c:14
NULL_decode_jer
jer_type_decoder_f NULL_decode_jer
Definition: NULL.h:45
asn_TYPE_operation_s
Definition: constr_TYPE.h:184
NULL_encode_uper
per_type_encoder_f NULL_encode_uper
Definition: NULL.h:56
ASFM_FREE_UNDERLYING
@ ASFM_FREE_UNDERLYING
Definition: constr_TYPE.h:92
NULL_decode_ber
ber_type_decoder_f NULL_decode_ber
Definition: NULL.h:35
ber_tlv_tag_t
unsigned ber_tlv_tag_t
Definition: ber_tlv_tag.h:18
NULL_encode_der
der_type_encoder_f NULL_encode_der
Definition: NULL.h:36
NULL_random_fill
asn_random_fill_f NULL_random_fill
Definition: NULL.h:64
ASN_TAG_CLASS_UNIVERSAL
@ ASN_TAG_CLASS_UNIVERSAL
Definition: ber_tlv_tag.h:13
CALLOC
#define CALLOC(nmemb, size)
Definition: asn_internal.h:37
NULL_encode_oer
oer_type_encoder_f NULL_encode_oer
Definition: NULL.h:51
ASFM_FREE_UNDERLYING_AND_RESET
@ ASFM_FREE_UNDERLYING_AND_RESET
Definition: constr_TYPE.h:93
ASFM_FREE_EVERYTHING
@ ASFM_FREE_EVERYTHING
Definition: constr_TYPE.h:91
NULL_decode_oer
oer_type_decoder_f NULL_decode_oer
Definition: NULL.h:50
FREEMEM
#define FREEMEM(ptr)
Definition: asn_internal.h:40
NULL_encode_xer
xer_type_encoder_f NULL_encode_xer
Definition: NULL.h:41
NULL.h
asn_TYPE_descriptor_s
Definition: constr_TYPE.h:224
NULL_decode_xer
xer_type_decoder_f NULL_decode_xer
Definition: NULL.h:40
asn_DEF_NULL_tags
static const ber_tlv_tag_t asn_DEF_NULL_tags[]
Definition: NULL.c:11
NULL_encode_aper
per_type_encoder_f NULL_encode_aper
Definition: NULL.h:60
asn_generic_no_constraint
asn_constr_check_f asn_generic_no_constraint
Definition: constraints.h:51
asn_struct_free_method
asn_struct_free_method
Definition: constr_TYPE.h:90
NULL_print
asn_struct_print_f NULL_print
Definition: NULL.h:26
NULL_encode_jer
jer_type_encoder_f NULL_encode_jer
Definition: NULL.h:46
NULL_copy
int NULL_copy(const asn_TYPE_descriptor_t *td, void **a, const void *b)
Definition: NULL.c:122
NULL_decode_aper
per_type_decoder_f NULL_decode_aper
Definition: NULL.h:59
NULL_decode_uper
per_type_decoder_f NULL_decode_uper
Definition: NULL.h:55
asn_internal.h
NULL_compare
int NULL_compare(const asn_TYPE_descriptor_t *td, const void *a, const void *b)
Definition: NULL.c:114
asn_DEF_NULL
asn_TYPE_descriptor_t asn_DEF_NULL
Definition: NULL.c:72
NULL_free
void NULL_free(const asn_TYPE_descriptor_t *td, void *ptr, enum asn_struct_free_method method)
Definition: NULL.c:97
NULL_t
int NULL_t
Definition: NULL.h:18


etsi_its_vam_ts_coding
Author(s): Jean-Pierre Busch , Guido Küppers , Lennart Reiher
autogenerated on Sun May 18 2025 02:30:55