XBinder  Version 2.6.x
rtxIntStack.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2003-2018 Objective Systems, Inc.
3  *
4  * This software is furnished under a license and may be used and copied
5  * only in accordance with the terms of such license and with the
6  * inclusion of the above copyright notice. This software or any other
7  * copies thereof may not be provided or otherwise made available to any
8  * other person. No title to and ownership of the software is hereby
9  * transferred.
10  *
11  * The information in this software is subject to change without notice
12  * and should not be construed as a commitment by Objective Systems, Inc.
13  *
14  * PROPRIETARY NOTICE
15  *
16  * This software is an unpublished work subject to a confidentiality agreement
17  * and is protected by copyright and trade secret law. Unauthorized copying,
18  * redistribution or other use of this work is prohibited.
19  *
20  * The above notice of copyright on this source code product does not indicate
21  * any actual or intended publication of such source code.
22  *
23  *****************************************************************************/
28 #ifndef _RTXINTSTACK_
29 #define _RTXINTSTACK_
30 
31 #include "rtxsrc/rtxContext.h"
32 
45 #define OSRTISTK_DEFAULT_CAPACITY 100
46 
52 typedef struct _OSRTIntStack {
53  OSCTXT* pctxt; /* context pointer */
54  OSINT32* pdata; /* stack data */
55  size_t index; /* index to top element */
56  size_t size; /* current size of the stack */
57 } OSRTIntStack;
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
79 EXTERNRT int rtxIntStackInit
80 (OSCTXT* pctxt, OSRTIntStack* pstack, size_t capacity);
81 
91 EXTERNRT int rtxIntStackPush (OSRTIntStack* pstack, OSINT32 value);
92 
103 EXTERNRT int rtxIntStackPeek (OSRTIntStack* pstack, OSINT32* pvalue);
104 
115 EXTERNRT int rtxIntStackPop (OSRTIntStack* pstack, OSINT32* pvalue);
116 
122 #define rtxIntStackIsEmpty(stack) (OSBOOL)((stack).index == 0)
123 
127 #ifdef __cplusplus
128 }
129 #endif
130 
131 #endif
EXTERNRT int rtxIntStackPeek(OSRTIntStack *pstack, OSINT32 *pvalue)
This functions returns the data item on the top of the stack.
EXTERNRT int rtxIntStackPop(OSRTIntStack *pstack, OSINT32 *pvalue)
This functions pops the data item on the top of the stack.
EXTERNRT int rtxIntStackPush(OSRTIntStack *pstack, OSINT32 value)
This function pushes an item onto the stack.
EXTERNRT int rtxIntStackInit(OSCTXT *pctxt, OSRTIntStack *pstack, size_t capacity)
This function initializes a stack structure.
Common run-time context definitions.
This is the main stack structure.
Definition: rtxIntStack.h:52
Run-time context structure.
Definition: rtxContext.h:185