3 * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
4 * Redistribution and modifications are permitted subject to BSD license.
6 #include <asn_internal.h>
7 #include <asn_SEQUENCE_OF.h>
9 typedef A_SEQUENCE_OF(void) asn_sequence;
12 asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free) {
13 asn_sequence *as = (asn_sequence *)asn_sequence_of_x;
19 if(number < 0 || number >= as->count)
20 return; /* Nothing to delete */
22 if(_do_free && as->free) {
23 ptr = as->array[number];
29 * Shift all elements to the left to hide the gap.
32 for(n = number; n < as->count; n++)
33 as->array[n] = as->array[n+1];
36 * Invoke the third-party function only when the state
37 * of the parent structure is consistent.
39 if(ptr) as->free(ptr);