| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#include <asn_internal.h> |
| 6 |
#include <asn_SEQUENCE_OF.h> |
| 7 |
|
| 8 |
typedef A_SEQUENCE_OF(void) asn_sequence; |
| 9 |
|
| 10 |
void |
| 11 |
asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free) { |
| 12 |
asn_sequence *as = (asn_sequence *)asn_sequence_of_x; |
| 13 |
|
| 14 |
if(as) { |
| 15 |
void *ptr; |
| 16 |
int n; |
| 17 |
|
| 18 |
if(number < 0 || number >= as->count) |
| 19 |
return; |
| 20 |
|
| 21 |
if(_do_free && as->free) { |
| 22 |
ptr = as->array[number]; |
| 23 |
} else { |
| 24 |
ptr = 0; |
| 25 |
} |
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
--as->count; |
| 31 |
for(n = number; n < as->count; n++) |
| 32 |
as->array[n] = as->array[n+1]; |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
if(ptr) as->free(ptr); |
| 39 |
} |
| 40 |
} |
| 41 |
|