2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
22 * "ASN-USEFUL" ASN.1 module encode/decode/print/free C src.
24 * This file was generated by snacc on Mon Mar 3 11:08:41 1997
26 * UBC snacc written by Mike Sample
28 * NOTE: This is a machine generated file - editing not recommended
34 #include "asn-useful.h"
37 AsnLen BEncNumericString
PARAMS ((b
, v
),
42 l
= BEncNumericStringContent (b
, v
);
43 l
+= BEncDefLen (b
, l
);
44 l
+= BEncTag1 (b
, UNIV
, PRIM
, NUMERICSTRING_TAG_CODE
);
46 } /* BEncNumericString */
48 void BDecNumericString
PARAMS ((b
, result
, bytesDecoded
, env
),
50 NumericString
*result _AND_
51 AsnLen
*bytesDecoded _AND_
57 if (((tag
= BDecTag (b
, bytesDecoded
, env
)) !=
58 MAKE_TAG_ID (UNIV
, PRIM
, NUMERICSTRING_TAG_CODE
))&&
59 (tag
!= MAKE_TAG_ID (UNIV
, CONS
, NUMERICSTRING_TAG_CODE
)))
61 Asn1Error ("BDecNumericString: ERROR - wrong tag\n");
64 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
65 BDecNumericStringContent (b
, tag
, elmtLen1
, result
, bytesDecoded
, env
);
66 } /* BDecNumericString */
68 AsnLen BEncPrintableString
PARAMS ((b
, v
),
73 l
= BEncPrintableStringContent (b
, v
);
74 l
+= BEncDefLen (b
, l
);
75 l
+= BEncTag1 (b
, UNIV
, PRIM
, PRINTABLESTRING_TAG_CODE
);
77 } /* BEncPrintableString */
79 void BDecPrintableString
PARAMS ((b
, result
, bytesDecoded
, env
),
81 PrintableString
*result _AND_
82 AsnLen
*bytesDecoded _AND_
88 if (((tag
= BDecTag (b
, bytesDecoded
, env
)) !=
89 MAKE_TAG_ID (UNIV
, PRIM
, PRINTABLESTRING_TAG_CODE
))&&
90 (tag
!= MAKE_TAG_ID (UNIV
, CONS
, PRINTABLESTRING_TAG_CODE
)))
92 Asn1Error ("BDecPrintableString: ERROR - wrong tag\n");
95 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
96 BDecPrintableStringContent (b
, tag
, elmtLen1
, result
, bytesDecoded
, env
);
97 } /* BDecPrintableString */
99 AsnLen BEncTeletexString
PARAMS ((b
, v
),
104 l
= BEncTeletexStringContent (b
, v
);
105 l
+= BEncDefLen (b
, l
);
106 l
+= BEncTag1 (b
, UNIV
, PRIM
, TELETEXSTRING_TAG_CODE
);
108 } /* BEncTeletexString */
110 void BDecTeletexString
PARAMS ((b
, result
, bytesDecoded
, env
),
112 TeletexString
*result _AND_
113 AsnLen
*bytesDecoded _AND_
119 if (((tag
= BDecTag (b
, bytesDecoded
, env
)) !=
120 MAKE_TAG_ID (UNIV
, PRIM
, TELETEXSTRING_TAG_CODE
))&&
121 (tag
!= MAKE_TAG_ID (UNIV
, CONS
, TELETEXSTRING_TAG_CODE
)))
123 Asn1Error ("BDecTeletexString: ERROR - wrong tag\n");
126 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
127 BDecTeletexStringContent (b
, tag
, elmtLen1
, result
, bytesDecoded
, env
);
128 } /* BDecTeletexString */
130 AsnLen BEncT61String
PARAMS ((b
, v
),
135 l
= BEncT61StringContent (b
, v
);
136 l
+= BEncDefLen (b
, l
);
137 l
+= BEncTag1 (b
, UNIV
, PRIM
, TELETEXSTRING_TAG_CODE
);
139 } /* BEncT61String */
141 void BDecT61String
PARAMS ((b
, result
, bytesDecoded
, env
),
143 T61String
*result _AND_
144 AsnLen
*bytesDecoded _AND_
150 if (((tag
= BDecTag (b
, bytesDecoded
, env
)) !=
151 MAKE_TAG_ID (UNIV
, PRIM
, TELETEXSTRING_TAG_CODE
))&&
152 (tag
!= MAKE_TAG_ID (UNIV
, CONS
, TELETEXSTRING_TAG_CODE
)))
154 Asn1Error ("BDecT61String: ERROR - wrong tag\n");
157 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
158 BDecT61StringContent (b
, tag
, elmtLen1
, result
, bytesDecoded
, env
);
159 } /* BDecT61String */
161 AsnLen BEncVideotexString
PARAMS ((b
, v
),
166 l
= BEncVideotexStringContent (b
, v
);
167 l
+= BEncDefLen (b
, l
);
168 l
+= BEncTag1 (b
, UNIV
, PRIM
, VIDEOTEXSTRING_TAG_CODE
);
170 } /* BEncVideotexString */
172 void BDecVideotexString
PARAMS ((b
, result
, bytesDecoded
, env
),
174 VideotexString
*result _AND_
175 AsnLen
*bytesDecoded _AND_
181 if (((tag
= BDecTag (b
, bytesDecoded
, env
)) !=
182 MAKE_TAG_ID (UNIV
, PRIM
, VIDEOTEXSTRING_TAG_CODE
))&&
183 (tag
!= MAKE_TAG_ID (UNIV
, CONS
, VIDEOTEXSTRING_TAG_CODE
)))
185 Asn1Error ("BDecVideotexString: ERROR - wrong tag\n");
188 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
189 BDecVideotexStringContent (b
, tag
, elmtLen1
, result
, bytesDecoded
, env
);
190 } /* BDecVideotexString */
192 AsnLen BEncIA5String
PARAMS ((b
, v
),
197 l
= BEncIA5StringContent (b
, v
);
198 l
+= BEncDefLen (b
, l
);
199 l
+= BEncTag1 (b
, UNIV
, PRIM
, IA5STRING_TAG_CODE
);
201 } /* BEncIA5String */
203 void BDecIA5String
PARAMS ((b
, result
, bytesDecoded
, env
),
205 IA5String
*result _AND_
206 AsnLen
*bytesDecoded _AND_
212 if (((tag
= BDecTag (b
, bytesDecoded
, env
)) !=
213 MAKE_TAG_ID (UNIV
, PRIM
, IA5STRING_TAG_CODE
))&&
214 (tag
!= MAKE_TAG_ID (UNIV
, CONS
, IA5STRING_TAG_CODE
)))
216 Asn1Error ("BDecIA5String: ERROR - wrong tag\n");
219 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
220 BDecIA5StringContent (b
, tag
, elmtLen1
, result
, bytesDecoded
, env
);
221 } /* BDecIA5String */
223 AsnLen BEncGraphicString
PARAMS ((b
, v
),
228 l
= BEncGraphicStringContent (b
, v
);
229 l
+= BEncDefLen (b
, l
);
230 l
+= BEncTag1 (b
, UNIV
, PRIM
, GRAPHICSTRING_TAG_CODE
);
232 } /* BEncGraphicString */
234 void BDecGraphicString
PARAMS ((b
, result
, bytesDecoded
, env
),
236 GraphicString
*result _AND_
237 AsnLen
*bytesDecoded _AND_
243 if (((tag
= BDecTag (b
, bytesDecoded
, env
)) !=
244 MAKE_TAG_ID (UNIV
, PRIM
, GRAPHICSTRING_TAG_CODE
))&&
245 (tag
!= MAKE_TAG_ID (UNIV
, CONS
, GRAPHICSTRING_TAG_CODE
)))
247 Asn1Error ("BDecGraphicString: ERROR - wrong tag\n");
250 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
251 BDecGraphicStringContent (b
, tag
, elmtLen1
, result
, bytesDecoded
, env
);
252 } /* BDecGraphicString */
254 AsnLen BEncVisibleString
PARAMS ((b
, v
),
259 l
= BEncVisibleStringContent (b
, v
);
260 l
+= BEncDefLen (b
, l
);
261 l
+= BEncTag1 (b
, UNIV
, PRIM
, VISIBLESTRING_TAG_CODE
);
263 } /* BEncVisibleString */
265 void BDecVisibleString
PARAMS ((b
, result
, bytesDecoded
, env
),
267 VisibleString
*result _AND_
268 AsnLen
*bytesDecoded _AND_
274 if (((tag
= BDecTag (b
, bytesDecoded
, env
)) !=
275 MAKE_TAG_ID (UNIV
, PRIM
, VISIBLESTRING_TAG_CODE
))&&
276 (tag
!= MAKE_TAG_ID (UNIV
, CONS
, VISIBLESTRING_TAG_CODE
)))
278 Asn1Error ("BDecVisibleString: ERROR - wrong tag\n");
281 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
282 BDecVisibleStringContent (b
, tag
, elmtLen1
, result
, bytesDecoded
, env
);
283 } /* BDecVisibleString */
285 AsnLen BEncISO646String
PARAMS ((b
, v
),
290 l
= BEncISO646StringContent (b
, v
);
291 l
+= BEncDefLen (b
, l
);
292 l
+= BEncTag1 (b
, UNIV
, PRIM
, VISIBLESTRING_TAG_CODE
);
294 } /* BEncISO646String */
296 void BDecISO646String
PARAMS ((b
, result
, bytesDecoded
, env
),
298 ISO646String
*result _AND_
299 AsnLen
*bytesDecoded _AND_
305 if (((tag
= BDecTag (b
, bytesDecoded
, env
)) !=
306 MAKE_TAG_ID (UNIV
, PRIM
, VISIBLESTRING_TAG_CODE
))&&
307 (tag
!= MAKE_TAG_ID (UNIV
, CONS
, VISIBLESTRING_TAG_CODE
)))
309 Asn1Error ("BDecISO646String: ERROR - wrong tag\n");
312 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
313 BDecISO646StringContent (b
, tag
, elmtLen1
, result
, bytesDecoded
, env
);
314 } /* BDecISO646String */
316 AsnLen BEncGeneralString
PARAMS ((b
, v
),
321 l
= BEncGeneralStringContent (b
, v
);
322 l
+= BEncDefLen (b
, l
);
323 l
+= BEncTag1 (b
, UNIV
, PRIM
, GENERALSTRING_TAG_CODE
);
325 } /* BEncGeneralString */
327 void BDecGeneralString
PARAMS ((b
, result
, bytesDecoded
, env
),
329 GeneralString
*result _AND_
330 AsnLen
*bytesDecoded _AND_
336 if (((tag
= BDecTag (b
, bytesDecoded
, env
)) !=
337 MAKE_TAG_ID (UNIV
, PRIM
, GENERALSTRING_TAG_CODE
))&&
338 (tag
!= MAKE_TAG_ID (UNIV
, CONS
, GENERALSTRING_TAG_CODE
)))
340 Asn1Error ("BDecGeneralString: ERROR - wrong tag\n");
343 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
344 BDecGeneralStringContent (b
, tag
, elmtLen1
, result
, bytesDecoded
, env
);
345 } /* BDecGeneralString */
347 AsnLen BEncUTCTime
PARAMS ((b
, v
),
352 l
= BEncUTCTimeContent (b
, v
);
353 l
+= BEncDefLen (b
, l
);
354 l
+= BEncTag1 (b
, UNIV
, PRIM
, UTCTIME_TAG_CODE
);
358 void BDecUTCTime
PARAMS ((b
, result
, bytesDecoded
, env
),
360 UTCTime
*result _AND_
361 AsnLen
*bytesDecoded _AND_
367 if (((tag
= BDecTag (b
, bytesDecoded
, env
)) !=
368 MAKE_TAG_ID (UNIV
, PRIM
, UTCTIME_TAG_CODE
))&&
369 (tag
!= MAKE_TAG_ID (UNIV
, CONS
, UTCTIME_TAG_CODE
)))
371 Asn1Error ("BDecUTCTime: ERROR - wrong tag\n");
374 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
375 BDecUTCTimeContent (b
, tag
, elmtLen1
, result
, bytesDecoded
, env
);
378 AsnLen BEncGeneralizedTime
PARAMS ((b
, v
),
383 l
= BEncGeneralizedTimeContent (b
, v
);
384 l
+= BEncDefLen (b
, l
);
385 l
+= BEncTag1 (b
, UNIV
, PRIM
, GENERALIZEDTIME_TAG_CODE
);
387 } /* BEncGeneralizedTime */
389 void BDecGeneralizedTime
PARAMS ((b
, result
, bytesDecoded
, env
),
391 GeneralizedTime
*result _AND_
392 AsnLen
*bytesDecoded _AND_
398 if (((tag
= BDecTag (b
, bytesDecoded
, env
)) !=
399 MAKE_TAG_ID (UNIV
, PRIM
, GENERALIZEDTIME_TAG_CODE
))&&
400 (tag
!= MAKE_TAG_ID (UNIV
, CONS
, GENERALIZEDTIME_TAG_CODE
)))
402 Asn1Error ("BDecGeneralizedTime: ERROR - wrong tag\n");
405 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
406 BDecGeneralizedTimeContent (b
, tag
, elmtLen1
, result
, bytesDecoded
, env
);
407 } /* BDecGeneralizedTime */
410 BEncEXTERNALChoiceContent
PARAMS ((b
, v
),
421 case EXTERNALCHOICE_SINGLE_ASN1_TYPE
:
423 itemLen
= BEncAsnOctsContent (b
, (v
->a
.single_ASN1_type
));
424 itemLen
+= BEncDefLen (b
, itemLen
);
425 itemLen
+= BEncTag1 (b
, UNIV
, PRIM
, 4);
426 itemLen
+= BEncConsLen (b
, itemLen
);
427 itemLen
+= BEncTag1 (b
, CNTX
, CONS
, 0);
433 case EXTERNALCHOICE_OCTET_ALIGNED
:
434 itemLen
= BEncAsnOctsContent (b
, (v
->a
.octet_aligned
));
435 itemLen
+= BEncDefLen (b
, itemLen
);
436 itemLen
+= BEncTag1 (b
, CNTX
, PRIM
, 1);
442 case EXTERNALCHOICE_ARBITRARY
:
443 itemLen
= BEncAsnBitsContent (b
, (v
->a
.arbitrary
));
444 itemLen
+= BEncDefLen (b
, itemLen
);
445 itemLen
+= BEncTag1 (b
, CNTX
, PRIM
, 2);
454 } /* BEncEXTERNALChoiceContent */
457 BDecEXTERNALChoiceContent
PARAMS ((b
, tagId0
, elmtLen0
, v
, bytesDecoded
, env
),
460 AsnLen elmtLen0 _AND_
461 EXTERNALChoice
*v _AND_
462 AsnLen
*bytesDecoded _AND_
466 AsnLen totalElmtsLen1
= 0;
469 int mandatoryElmtCount1
= 0;
470 AsnLen totalElmtsLen2
= 0;
477 case MAKE_TAG_ID (CNTX
, CONS
, 0):
478 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
479 if ((tagId1
!= MAKE_TAG_ID (UNIV
, PRIM
, OCTETSTRING_TAG_CODE
)) &&
480 (tagId1
!= MAKE_TAG_ID (UNIV
, CONS
, OCTETSTRING_TAG_CODE
)))
482 Asn1Error ("Unexpected Tag\n");
486 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
487 (v
->choiceId
) = EXTERNALCHOICE_SINGLE_ASN1_TYPE
;
488 (v
->a
.single_ASN1_type
) = (AsnOcts
*) Asn1Alloc (sizeof (AsnOcts
));
489 CheckAsn1Alloc ((v
->a
.single_ASN1_type
), env
);
490 BDecAsnOctsContent (b
, tagId1
, elmtLen1
, (v
->a
.single_ASN1_type
), &totalElmtsLen1
, env
);
491 if (elmtLen0
== INDEFINITE_LEN
)
492 BDecEoc (b
, &totalElmtsLen1
, env
);
495 case MAKE_TAG_ID (CNTX
, PRIM
, 1):
496 case MAKE_TAG_ID (CNTX
, CONS
, 1):
497 (v
->choiceId
) = EXTERNALCHOICE_OCTET_ALIGNED
;
498 (v
->a
.octet_aligned
) = (AsnOcts
*) Asn1Alloc (sizeof (AsnOcts
));
499 CheckAsn1Alloc ((v
->a
.octet_aligned
), env
);
500 BDecAsnOctsContent (b
, tagId0
, elmtLen0
, (v
->a
.octet_aligned
), &totalElmtsLen1
, env
);
503 case MAKE_TAG_ID (CNTX
, PRIM
, 2):
504 case MAKE_TAG_ID (CNTX
, CONS
, 2):
505 (v
->choiceId
) = EXTERNALCHOICE_ARBITRARY
;
506 (v
->a
.arbitrary
) = (AsnBits
*) Asn1Alloc (sizeof (AsnBits
));
507 CheckAsn1Alloc ((v
->a
.arbitrary
), env
);
508 BDecAsnBitsContent (b
, tagId0
, elmtLen0
, (v
->a
.arbitrary
), &totalElmtsLen1
, env
);
512 Asn1Error ("ERROR - unexpected tag in CHOICE\n");
516 (*bytesDecoded
) += totalElmtsLen1
;
517 } /* BDecEXTERNALChoiceContent */
520 PrintEXTERNALChoice
PARAMS ((f
, v
, indent
),
522 EXTERNALChoice
*v _AND_
523 unsigned short int indent
)
527 case EXTERNALCHOICE_SINGLE_ASN1_TYPE
:
528 fprintf (f
,"single-ASN1-type ");
529 PrintAsnOcts (f
, (v
->a
.single_ASN1_type
), indent
+ stdIndentG
);
532 case EXTERNALCHOICE_OCTET_ALIGNED
:
533 fprintf (f
,"octet-aligned ");
534 PrintAsnOcts (f
, (v
->a
.octet_aligned
), indent
+ stdIndentG
);
537 case EXTERNALCHOICE_ARBITRARY
:
538 fprintf (f
,"arbitrary ");
539 PrintAsnBits (f
, (v
->a
.arbitrary
), indent
+ stdIndentG
);
543 } /* PrintEXTERNALChoice */
546 FreeEXTERNALChoice
PARAMS ((v
),
554 case EXTERNALCHOICE_SINGLE_ASN1_TYPE
:
555 FreeAsnOcts ((v
->a
.single_ASN1_type
));
556 Asn1Free ((v
->a
.single_ASN1_type
));
560 case EXTERNALCHOICE_OCTET_ALIGNED
:
561 FreeAsnOcts ((v
->a
.octet_aligned
));
562 Asn1Free ((v
->a
.octet_aligned
));
566 case EXTERNALCHOICE_ARBITRARY
:
567 FreeAsnBits ((v
->a
.arbitrary
));
568 Asn1Free ((v
->a
.arbitrary
));
573 } /* FreeEXTERNALChoice */
578 AsnLen BEncEXTERNAL
PARAMS ((b
, v
),
584 l
= BEncEXTERNALContent (b
, v
);
585 l
+= BEncConsLen (b
, l
);
586 l
+= BEncTag1 (b
, UNIV
, CONS
, EXTERNAL_TAG_CODE
);
590 void BDecEXTERNAL
PARAMS ((b
, result
, bytesDecoded
, env
),
592 EXTERNAL
*result _AND_
593 AsnLen
*bytesDecoded _AND_
599 if (((tag
= BDecTag (b
, bytesDecoded
, env
)) !=
600 MAKE_TAG_ID (UNIV
, CONS
, EXTERNAL_TAG_CODE
)))
602 Asn1Error ("BDecEXTERNAL: ERROR - wrong tag\n");
605 elmtLen1
= BDecLen (b
, bytesDecoded
, env
);
606 BDecEXTERNALContent (b
, tag
, elmtLen1
, result
, bytesDecoded
, env
);
610 BEncEXTERNALContent
PARAMS ((b
, v
),
619 itemLen
= BEncEXTERNALChoiceContent (b
, (v
->encoding
));
623 if (ASNOCTS_PRESENT ((&v
->data_value_descriptor
)))
625 itemLen
= BEncObjectDescriptorContent (b
, (&v
->data_value_descriptor
));
626 itemLen
+= BEncDefLen (b
, itemLen
);
627 itemLen
+= BEncTag1 (b
, UNIV
, PRIM
, 7);
632 if (NOT_NULL ((v
->indirect_reference
)))
634 itemLen
= BEncAsnIntContent (b
, (v
->indirect_reference
));
635 BEncDefLenTo127 (b
, itemLen
);
637 itemLen
+= BEncTag1 (b
, UNIV
, PRIM
, 2);
642 if (ASNOID_PRESENT ((&v
->direct_reference
)))
644 itemLen
= BEncAsnOidContent (b
, (&v
->direct_reference
));
645 itemLen
+= BEncDefLen (b
, itemLen
);
646 itemLen
+= BEncTag1 (b
, UNIV
, PRIM
, 6);
653 } /* BEncEXTERNALContent */
656 BDecEXTERNALContent
PARAMS ((b
, tagId0
, elmtLen0
, v
, bytesDecoded
, env
),
659 AsnLen elmtLen0 _AND_
661 AsnLen
*bytesDecoded _AND_
665 AsnLen totalElmtsLen1
= 0;
668 int mandatoryElmtCount1
= 0;
669 AsnLen totalElmtsLen2
= 0;
674 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
676 if (((tagId1
== MAKE_TAG_ID (UNIV
, PRIM
, OID_TAG_CODE
))))
678 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
679 BDecAsnOidContent (b
, tagId1
, elmtLen1
, (&v
->direct_reference
), &totalElmtsLen1
, env
);
680 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
684 if (((tagId1
== MAKE_TAG_ID (UNIV
, PRIM
, INTEGER_TAG_CODE
))))
686 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
687 (v
->indirect_reference
) = (AsnInt
*) Asn1Alloc (sizeof (AsnInt
));
688 CheckAsn1Alloc ((v
->indirect_reference
), env
);
689 BDecAsnIntContent (b
, tagId1
, elmtLen1
, (v
->indirect_reference
), &totalElmtsLen1
, env
);
690 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
694 if (((tagId1
== MAKE_TAG_ID (UNIV
, PRIM
, OD_TAG_CODE
)) ||
695 (tagId1
== MAKE_TAG_ID (UNIV
, CONS
, OD_TAG_CODE
))))
697 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
698 BDecObjectDescriptorContent (b
, tagId1
, elmtLen1
, (&v
->data_value_descriptor
), &totalElmtsLen1
, env
);
699 tagId1
= BDecTag (b
, &totalElmtsLen1
, env
);
703 if (((tagId1
== MAKE_TAG_ID (CNTX
, CONS
, 0)) ||
704 (tagId1
== MAKE_TAG_ID (CNTX
, PRIM
, 1))||
705 (tagId1
== MAKE_TAG_ID (CNTX
, CONS
, 1)) ||
706 (tagId1
== MAKE_TAG_ID (CNTX
, PRIM
, 2))||
707 (tagId1
== MAKE_TAG_ID (CNTX
, CONS
, 2))))
709 elmtLen1
= BDecLen (b
, &totalElmtsLen1
, env
);
710 (v
->encoding
) = (EXTERNALChoice
*) Asn1Alloc (sizeof (EXTERNALChoice
));
711 CheckAsn1Alloc ((v
->encoding
), env
);
712 BDecEXTERNALChoiceContent (b
, tagId1
, elmtLen1
, (v
->encoding
), &totalElmtsLen1
, env
);
714 if (elmtLen0
== INDEFINITE_LEN
)
715 BDecEoc (b
, &totalElmtsLen1
, env
);
716 else if (totalElmtsLen1
!= elmtLen0
)
726 (*bytesDecoded
) += totalElmtsLen1
;
727 } /* BDecEXTERNALContent */
730 PrintEXTERNAL
PARAMS ((f
, v
, indent
),
733 unsigned short int indent
)
738 fprintf (f
,"{ -- SEQUENCE --\n");
740 if (ASNOID_PRESENT ((&v
->direct_reference
)))
742 Indent (f
, indent
+ stdIndentG
);
743 fprintf (f
,"direct-reference ");
744 PrintAsnOid (f
, (&v
->direct_reference
), indent
+ stdIndentG
);
747 if (NOT_NULL ((v
->indirect_reference
)))
749 Indent (f
, indent
+ stdIndentG
);
750 fprintf (f
,"indirect-reference ");
751 PrintAsnInt (f
, (v
->indirect_reference
), indent
+ stdIndentG
);
754 if (ASNOCTS_PRESENT ((&v
->data_value_descriptor
)))
756 Indent (f
, indent
+ stdIndentG
);
757 fprintf (f
,"data-value-descriptor ");
758 PrintObjectDescriptor (f
, (&v
->data_value_descriptor
), indent
+ stdIndentG
);
761 Indent (f
, indent
+ stdIndentG
);
762 fprintf (f
,"encoding ");
763 PrintEXTERNALChoice (f
, (v
->encoding
), indent
+ stdIndentG
);
767 } /* PrintEXTERNAL */
770 FreeEXTERNAL
PARAMS ((v
),
776 if (ASNOID_PRESENT ((&v
->direct_reference
)))
778 FreeAsnOid ((&v
->direct_reference
));
781 if (NOT_NULL ((v
->indirect_reference
)))
783 FreeAsnInt ((v
->indirect_reference
));
784 Asn1Free ((v
->indirect_reference
));
787 if (ASNOCTS_PRESENT ((&v
->data_value_descriptor
)))
789 FreeObjectDescriptor ((&v
->data_value_descriptor
));
792 FreeEXTERNALChoice ((v
->encoding
));
793 Asn1Free ((v
->encoding
));