--- /dev/null
+/*-\r
+ * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.\r
+ * Redistribution and modifications are permitted subject to BSD license.\r
+ */\r
+#include <asn_internal.h>\r
+#include <asn_SEQUENCE_OF.h>\r
+\r
+typedef A_SEQUENCE_OF(void) asn_sequence;\r
+\r
+void\r
+asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free) {\r
+ asn_sequence *as = (asn_sequence *)asn_sequence_of_x;\r
+\r
+ if(as) {\r
+ void *ptr;\r
+ int n;\r
+\r
+ if(number < 0 || number >= as->count)\r
+ return; /* Nothing to delete */\r
+\r
+ if(_do_free && as->free) {\r
+ ptr = as->array[number];\r
+ } else {\r
+ ptr = 0;\r
+ }\r
+\r
+ /*\r
+ * Shift all elements to the left to hide the gap.\r
+ */\r
+ --as->count;\r
+ for(n = number; n < as->count; n++)\r
+ as->array[n] = as->array[n+1];\r
+\r
+ /*\r
+ * Invoke the third-party function only when the state\r
+ * of the parent structure is consistent.\r
+ */\r
+ if(ptr) as->free(ptr);\r
+ }\r
+}\r
+\r