Updated INFO.yaml file
[ric-app/kpimon.git] / asn1c_defs / all-defs / asn_SEQUENCE_OF.c
1 /*-\r
2  * Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.\r
3  * Redistribution and modifications are permitted subject to BSD license.\r
4  */\r
5 #include <asn_internal.h>\r
6 #include <asn_SEQUENCE_OF.h>\r
7 \r
8 typedef A_SEQUENCE_OF(void) asn_sequence;\r
9 \r
10 void\r
11 asn_sequence_del(void *asn_sequence_of_x, int number, int _do_free) {\r
12         asn_sequence *as = (asn_sequence *)asn_sequence_of_x;\r
13 \r
14         if(as) {\r
15                 void *ptr;\r
16                 int n;\r
17 \r
18                 if(number < 0 || number >= as->count)\r
19                         return; /* Nothing to delete */\r
20 \r
21                 if(_do_free && as->free) {\r
22                         ptr = as->array[number];\r
23                 } else {\r
24                         ptr = 0;\r
25                 }\r
26 \r
27                 /*\r
28                  * Shift all elements to the left to hide the gap.\r
29                  */\r
30                 --as->count;\r
31                 for(n = number; n < as->count; n++)\r
32                         as->array[n] = as->array[n+1];\r
33 \r
34                 /*\r
35                  * Invoke the third-party function only when the state\r
36                  * of the parent structure is consistent.\r
37                  */\r
38                 if(ptr) as->free(ptr);\r
39         }\r
40 }\r
41 \r