AM263Px MCU+ SDK  10.01.00
ub_esarray.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023 Texas Instruments Incorporated
3  * Copyright (c) 2023 Excelfore Corporation (https://excelfore.com)
4  *
5  * All rights reserved not granted herein.
6  * Limited License.
7  *
8  * Texas Instruments Incorporated grants a world-wide, royalty-free,
9  * non-exclusive license under copyrights and patents it now or hereafter
10  * owns or controls to make, have made, use, import, offer to sell and sell ("Utilize")
11  * this software subject to the terms herein. With respect to the foregoing patent
12  * license, such license is granted solely to the extent that any such patent is necessary
13  * to Utilize the software alone. The patent license shall not apply to any combinations which
14  * include this software, other than combinations with devices manufactured by or for TI ("TI Devices").
15  * No hardware patent is licensed hereunder.
16  *
17  * Redistributions must preserve existing copyright notices and reproduce this license (including the
18  * above copyright notice and the disclaimer and (if applicable) source code license limitations below)
19  * in the documentation and/or other materials provided with the distribution
20  *
21  * Redistribution and use in binary form, without modification, are permitted provided that the following
22  * conditions are met:
23  *
24  * * No reverse engineering, decompilation, or disassembly of this software is permitted with respect to any
25  * software provided in binary form.
26  * * any redistribution and use are licensed by TI for use only with TI Devices.
27  * * Nothing shall obligate TI to provide you with source code for the software licensed and provided to you in object code.
28  *
29  * If software source code is provided to you, modification and redistribution of the source code are permitted
30  * provided that the following conditions are met:
31  *
32  * * any redistribution and use of the source code, including any resulting derivative works, are licensed by
33  * TI for use only with TI Devices.
34  * * any redistribution and use of any object code compiled from the source code and any resulting derivative
35  * works, are licensed by TI for use only with TI Devices.
36  *
37  * Neither the name of Texas Instruments Incorporated nor the names of its suppliers may be used to endorse or
38  * promote products derived from this software without specific prior written permission.
39  *
40  * DISCLAIMER.
41  *
42  * THIS SOFTWARE IS PROVIDED BY TI AND TI"S LICENSORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
43  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
44  * IN NO EVENT SHALL TI AND TI"S LICENSORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
45  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
46  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
47  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
48  * POSSIBILITY OF SUCH DAMAGE.
49 */
74 #ifndef UB_ESARRAY_ARRAY_H_
75 #define UB_ESARRAY_ARRAY_H_
76 
77 #ifdef __cplusplus
78 extern "C" {
79 #endif
80 
84 typedef struct ub_esarray_cstd ub_esarray_cstd_t;
85 
91 typedef void ub_esarray_element_t;
92 
100 ub_esarray_cstd_t *ub_esarray_init(int esunit, int elesize, int maxeles);
101 
107 
116 
125 
134 
143 
144 
153 
158 
164 
174 
185 
195 
205 
206 #ifdef __cplusplus
207 }
208 #endif
209 
210 #endif
211 
ub_esarray_add_ele
int ub_esarray_add_ele(ub_esarray_cstd_t *eah, ub_esarray_element_t *ed)
add one element
ub_esarray_cstd_t
struct ub_esarray_cstd ub_esarray_cstd_t
the data handle of ub_esarray object, the inside of it is private
Definition: ub_esarray.h:84
ub_esarray_del_ele
int ub_esarray_del_ele(ub_esarray_cstd_t *eah, ub_esarray_element_t *ed)
delete one element *ed
ub_esarray_init
ub_esarray_cstd_t * ub_esarray_init(int esunit, int elesize, int maxeles)
initialize ub_esarray object.
ub_esarray_close
void ub_esarray_close(ub_esarray_cstd_t *eah)
close ub_esarray
ub_esarray_ele_nums
int ub_esarray_ele_nums(ub_esarray_cstd_t *eah)
returns the number of elements
ub_esarray_pop_last_ele
int ub_esarray_pop_last_ele(ub_esarray_cstd_t *eah, ub_esarray_element_t *ed)
pop in stack mode(get from the last index, and delete it)
ub_esarray_pop_ele
int ub_esarray_pop_ele(ub_esarray_cstd_t *eah, ub_esarray_element_t *ed)
pop in fifo mode(get from index=0, and delete index=0)
ub_esarray_del_pointer
int ub_esarray_del_pointer(ub_esarray_cstd_t *eah, ub_esarray_element_t *ed)
delete one element with element pointer
ub_esarray_del_index
int ub_esarray_del_index(ub_esarray_cstd_t *eah, int index)
delete one element with index
ub_esarray_data_lock
int ub_esarray_data_lock(ub_esarray_cstd_t *eah)
lock data to preserve checked out data by ub_esarray_get_newele or ub_esarray_get_ele
ub_esarray_get_newele
ub_esarray_element_t * ub_esarray_get_newele(ub_esarray_cstd_t *eah)
get a new element from the ub_esarray_array
ub_esarray_data_unlock
int ub_esarray_data_unlock(ub_esarray_cstd_t *eah)
unlock data to return to the default status
ub_esarray_get_ele
ub_esarray_element_t * ub_esarray_get_ele(ub_esarray_cstd_t *eah, int index)
get the indexed element from the ub_esarray_array
ub_esarray_element_t
void ub_esarray_element_t
data type of the element
Definition: ub_esarray.h:91