2 * Copyright (c) 2003-2017 Lev Walkin <vlm@lionet.info>. All rights reserved.
\r
3 * Redistribution and modifications are permitted subject to BSD license.
\r
5 #ifndef ASN_SEQUENCE_OF_H
\r
6 #define ASN_SEQUENCE_OF_H
\r
8 #include <asn_SET_OF.h>
\r
15 * SEQUENCE OF is the same as SET OF with a tiny difference:
\r
16 * the delete operation preserves the initial order of elements
\r
17 * and thus MAY operate in non-constant time.
\r
19 #define A_SEQUENCE_OF(type) A_SET_OF(type)
\r
21 #define ASN_SEQUENCE_ADD(headptr, ptr) \
\r
22 asn_sequence_add((headptr), (ptr))
\r
24 /***********************************************
\r
25 * Implementation of the SEQUENCE OF structure.
\r
28 #define asn_sequence_add asn_set_add
\r
29 #define asn_sequence_empty asn_set_empty
\r
32 * Delete the element from the set by its number (base 0).
\r
33 * This is NOT a constant-time operation.
\r
34 * The order of elements is preserved.
\r
35 * If _do_free is given AND the (*free) is initialized, the element
\r
36 * will be freed using the custom (*free) function as well.
\r
38 void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free);
\r
41 * Cope with different conversions requirements to/from void in C and C++.
\r
42 * This is mostly useful for support library.
\r
44 typedef A_SEQUENCE_OF(void) asn_anonymous_sequence_;
\r
45 #define _A_SEQUENCE_FROM_VOID(ptr) ((asn_anonymous_sequence_ *)(ptr))
\r
46 #define _A_CSEQUENCE_FROM_VOID(ptr) ((const asn_anonymous_sequence_ *)(ptr))
\r
52 #endif /* ASN_SEQUENCE_OF_H */
\r