2 * Copyright (c) 2003, 2004, 2006 Lev Walkin <vlm@lionet.info>.
4 * Redistribution and modifications are permitted subject to BSD license.
6 #include <asn_internal.h>
7 #include <constr_SEQUENCE_OF.h>
8 #include <asn_SEQUENCE_OF.h>
10 asn_TYPE_operation_t asn_OP_SEQUENCE_OF = {
12 #if !defined(ASN_DISABLE_PRINT_SUPPORT)
16 #endif /* !defined(ASN_DISABLE_PRINT_SUPPORT) */
18 #if !defined(ASN_DISABLE_BER_SUPPORT)
19 SEQUENCE_OF_decode_ber,
20 SEQUENCE_OF_encode_der,
24 #endif /* !defined(ASN_DISABLE_BER_SUPPORT) */
25 #if !defined(ASN_DISABLE_XER_SUPPORT)
26 SEQUENCE_OF_decode_xer,
27 SEQUENCE_OF_encode_xer,
31 #endif /* !defined(ASN_DISABLE_XER_SUPPORT) */
32 #if !defined(ASN_DISABLE_JER_SUPPORT)
33 SEQUENCE_OF_encode_jer,
36 #endif /* !defined(ASN_DISABLE_JER_SUPPORT) */
37 #if !defined(ASN_DISABLE_OER_SUPPORT)
38 SEQUENCE_OF_decode_oer, /* Same as SET OF decoder. */
39 SEQUENCE_OF_encode_oer, /* Same as SET OF encoder */
43 #endif /* !defined(ASN_DISABLE_OER_SUPPORT) */
44 #if !defined(ASN_DISABLE_UPER_SUPPORT)
45 SEQUENCE_OF_decode_uper, /* Same as SET OF decoder */
46 SEQUENCE_OF_encode_uper,
50 #endif /* !defined(ASN_DISABLE_UPER_SUPPORT) */
51 #if !defined(ASN_DISABLE_APER_SUPPORT)
52 SEQUENCE_OF_decode_aper,
53 SEQUENCE_OF_encode_aper,
57 #endif /* !defined(ASN_DISABLE_APER_SUPPORT) */
58 #if !defined(ASN_DISABLE_RFILL_SUPPORT)
59 SEQUENCE_OF_random_fill,
62 #endif /* !defined(ASN_DISABLE_RFILL_SUPPORT) */
63 0 /* Use generic outmost tag fetcher */
67 SEQUENCE_OF_compare(const asn_TYPE_descriptor_t *td, const void *aptr,
69 const asn_anonymous_sequence_ *a = _A_CSEQUENCE_FROM_VOID(aptr);
70 const asn_anonymous_sequence_ *b = _A_CSEQUENCE_FROM_VOID(bptr);
74 ssize_t common_length = (a->count < b->count ? a->count : b->count);
75 for(idx = 0; idx < common_length; idx++) {
76 int ret = td->elements->type->op->compare_struct(
77 td->elements->type, a->array[idx], b->array[idx]);
81 if(idx < b->count) /* more elements in b */
82 return -1; /* a is shorter, so put it first */
83 if(idx < a->count) return 1;