C-Common-Data-Structures icon indicating copy to clipboard operation
C-Common-Data-Structures copied to clipboard

Refinement for Stack

Open ZSShen opened this issue 8 years ago • 0 comments

Hey TienLung,

Please refer to this API draft and try to refine the implementation.

// The constructor
Stack* StackInit();

// The destructor  
void StackDeinit(Stack*);

// Push an item to the top of the stack.
bool StackPush(Stack*, void*);

// Pop an item from the top of the stack.
void StackPop(Stack*);

// Retrieve an item from the top of the stack.
void* StackTop(Stack*);

// Get the number of stored items.
int StackSize(Stack*);

// Set the custom stack element clean method.
void StackSetClean(Stack*);

Regards, ZongXian.

ZSShen avatar Jul 05 '16 09:07 ZSShen