PDK API Guide for J721E
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
QueueP.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017-present, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
50 #ifndef ti_osal_QueueP__include
51 #define ti_osal_QueueP__include
52 
53 #include <stdbool.h>
54 #include <stdint.h>
55 #include <stddef.h>
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
70 typedef int32_t QueueP_Status;
72 #define QueueP_OK (int32_t)(0)
73 
74 #define QueueP_FAILURE (int32_t)(-1)
75 /* @} */
76 
86 typedef bool QueueP_State;
88 #define QueueP_NOTEMPTY ((bool)false)
89 
90 #define QueueP_EMPTY ((bool)true)
91 /* @} */
92 
99 typedef void *QueueP_Handle;
100 
108 typedef struct QueueP_Elem_s{
110  struct QueueP_Elem_s *next;
111 
113  struct QueueP_Elem_s *prev;
114 } QueueP_Elem;
115 
122 typedef struct QueueP_Params_s
123 {
124  void *pErrBlk;
125 } QueueP_Params;
126 
132 extern void QueueP_Params_init(QueueP_Params *params);
133 
141 extern QueueP_Handle QueueP_create(const QueueP_Params *params);
142 
153 
163 extern void * QueueP_get(QueueP_Handle handle);
164 
177  void *elem);
178 
189 
197 extern void * QueueP_getQPtr(QueueP_Handle handle);
198 
199 #ifdef __cplusplus
200 }
201 #endif
202 
203 #endif /* ti_osal_QueueP__include */
204 /* @} */
bool QueueP_State
State codes for current queue state.
Definition: QueueP.h:86
int32_t QueueP_Status
Status codes for QueueP APIs.
Definition: QueueP.h:70
void QueueP_Params_init(QueueP_Params *params)
Initialize params structure to default values.
Basic QueueP Parameters.
Definition: QueueP.h:122
QueueP_Handle QueueP_create(const QueueP_Params *params)
Function to create a queue.
QueueP_Status QueueP_put(QueueP_Handle handle, void *elem)
Function to Put an element at end of queue.
void * QueueP_Handle
Opaque client reference to an instance of a QueueP.
Definition: QueueP.h:99
void * QueueP_getQPtr(QueueP_Handle handle)
Function to get pointer to the queue.
Opaque QueueP element.
Definition: QueueP.h:108
struct QueueP_Elem_s * next
Definition: QueueP.h:110
void * QueueP_get(QueueP_Handle handle)
Function to Get the element at the front of the queue. This function removes an element from the fron...
struct QueueP_Elem_s * prev
Definition: QueueP.h:113
QueueP_Status QueueP_delete(QueueP_Handle handle)
Function to delete a queue.
QueueP_State QueueP_isEmpty(QueueP_Handle handle)
Function to perform queue empty check.
void * pErrBlk
Definition: QueueP.h:124