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