X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/8c6fa3fbaccc22127280bf77a48fab5a3ee0716e..46b0747592074017ff0ea4b33d4a7194235886e5:/stglibs/smux.lib/asn_SEQUENCE_OF.c diff --git a/stglibs/smux.lib/asn_SEQUENCE_OF.c b/stglibs/smux.lib/asn_SEQUENCE_OF.c deleted file mode 100644 index ec952fc9..00000000 --- a/stglibs/smux.lib/asn_SEQUENCE_OF.c +++ /dev/null @@ -1,41 +0,0 @@ -/*- - * Copyright (c) 2003, 2004 Lev Walkin . All rights reserved. - * Redistribution and modifications are permitted subject to BSD license. - */ -#include -#include - -typedef A_SEQUENCE_OF(void) asn_sequence; - -void -asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free) { - asn_sequence *as = (asn_sequence *)asn_sequence_of_x; - - if(as) { - void *ptr; - int n; - - if(number < 0 || number >= as->count) - return; /* Nothing to delete */ - - if(_do_free && as->free) { - ptr = as->array[number]; - } else { - ptr = 0; - } - - /* - * Shift all elements to the left to hide the gap. - */ - --as->count; - for(n = number; n < as->count; n++) - as->array[n] = as->array[n+1]; - - /* - * Invoke the third-party function only when the state - * of the parent structure is consistent. - */ - if(ptr) as->free(ptr); - } -} -