14 typedef struct _Stack {
20 int32_t (*push) (
struct _Stack*, Item);
24 int32_t (*top) (
struct _Stack*, Item*);
28 int32_t (*pop) (
struct _Stack*);
32 int32_t (*size) (
struct _Stack*);
36 int32_t (*set_destroy) (
struct _Stack*, void (*) (Item));
int32_t StackSize(Stack *self)
Return the number of stored items.
struct _StackData StackData
StackData is the data type for the container private information.
int32_t StackInit(Stack **ppObj)
The constructor for Stack.
int32_t StackPop(Stack *self)
Delete item from top of the stack.
int32_t StackPush(Stack *self, Item item)
Insert an item to the top of the stack.
StackData * pData
The container private information.
int32_t StackSetDestroy(Stack *self, void(*pFunc)(Item))
Set the custom item resource clean method.
int32_t StackTop(Stack *self, Item *pItem)
Retrieve item from top of the stack.
The implementation for stack.
void StackDeinit(Stack **ppObj)
The destructor for Stack.