1 /*****************************************************************************
3 # Copyright 2019 AT&T Intellectual Property *
5 # Licensed under the Apache License, Version 2.0 (the "License"); *
6 # you may not use this file except in compliance with the License. *
7 # You may obtain a copy of the License at *
9 # http://www.apache.org/licenses/LICENSE-2.0 *
11 # Unless required by applicable law or agreed to in writing, software *
12 # distributed under the License is distributed on an "AS IS" BASIS, *
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
14 # See the License for the specific language governing permissions and *
15 # limitations under the License. *
17 ******************************************************************************/
20 * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
21 * Redistribution and modifications are permitted subject to BSD license.
23 #ifndef ASN_SEQUENCE_OF_H
24 #define ASN_SEQUENCE_OF_H
26 #include <asn_SET_OF.h>
33 * SEQUENCE OF is the same as SET OF with a tiny difference:
34 * the delete operation preserves the initial order of elements
35 * and thus MAY operate in non-constant time.
37 #define A_SEQUENCE_OF(type) A_SET_OF(type)
39 #define ASN_SEQUENCE_ADD(headptr, ptr) \
40 asn_sequence_add((headptr), (ptr))
42 /***********************************************
43 * Implementation of the SEQUENCE OF structure.
46 #define asn_sequence_add asn_set_add
47 #define asn_sequence_empty asn_set_empty
50 * Delete the element from the set by its number (base 0).
51 * This is NOT a constant-time operation.
52 * The order of elements is preserved.
53 * If _do_free is given AND the (*free) is initialized, the element
54 * will be freed using the custom (*free) function as well.
56 void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free);
59 * Cope with different conversions requirements to/from void in C and C++.
60 * This is mostly useful for support library.
62 typedef A_SEQUENCE_OF(void) asn_anonymous_sequence_;
63 #define _A_SEQUENCE_FROM_VOID(ptr) ((asn_anonymous_sequence_ *)(ptr))
64 #define _A_CSEQUENCE_FROM_VOID(ptr) ((const asn_anonymous_sequence_ *)(ptr))
70 #endif /* ASN_SEQUENCE_OF_H */