blob: e99673403cf7a01afbdd44bedc865a7003616e82 [file] [log] [blame]
vlmfa67ddc2004-06-03 03:38:44 +00001/*-
2 * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
3 * Redistribution and modifications are permitted subject to BSD license.
4 */
5#ifndef ASN_SEQUENCE_OF_H
6#define ASN_SEQUENCE_OF_H
7
8#include <asn_SET_OF.h>
9
10/*
11 * SEQUENCE OF is the same as SET OF with a tiny difference:
12 * the delete operation preserves the initial order of elements
13 * and thus MAY operate in non-constant time.
14 */
15#define A_SEQUENCE_OF(type) A_SET_OF(type)
16
17#define ASN_SEQUENCE_ADD(headptr, ptr) \
18 asn_sequence_add((headptr), (ptr))
19
20/***********************************************
21 * Implementation of the SEQUENCE OF structure.
22 */
23
24#define asn_sequence_add asn_set_add
25#define asn_sequence_empty asn_set_empty
26
27/*
28 * Delete the element from the set by its number (base 0).
29 * This is NOT a constant-time operation.
30 * The order of elements is preserved.
31 * If _do_free is given AND the (*free) is initialized, the element
32 * will be freed using the custom (*free) function as well.
33 */
34void asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free);
35
36#endif /* ASN_SEQUENCE_OF_H */