Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Examples  

stack.c File Reference

Go to the source code of this file.

Functions

int stack_push (Stack *pile, const void *donnee)
 Stack up data at the top of the stack.

int stack_pop (Stack *pile, void **donnee)
 Extract data from the top of the stack.


Detailed Description

This file implements a basic stack API.

Definition in file stack.c.


Function Documentation

int stack_pop Stack   pile,
void **    donnee
 

Extract data from the top of the stack.

Parameters:
pile Pointer to a stack data structure.
donnee Pointer to a pointer the will point to the extracted data.
Returns:
Upon successful completion the function return the value 0. Otherwise the function returns -1.
Warning:
This function does NOT free the element's data (it only frees the element's structure). Therefore you should use donnee to free the element's data yourself.
Examples:
test_stack.c.

Definition at line 33 of file stack.c.

References list_rem_next().

int stack_push Stack   pile,
const void *    donnee
 

Stack up data at the top of the stack.

Parameters:
pile Pointer to a stack data structure.
donnee Pointer to the data to stack up.
Returns:
Upon successful completion the function return the value 0. Otherwise the function returns -1.
Warning:
The inserted data is NOT copied into the linked list! Therefore you should not free it unless you know exactly what you are doing.
Examples:
test_stack.c.

Definition at line 19 of file stack.c.

References list_ins_next().


Generated on Thu Apr 3 16:23:47 2003 for Common_C_libraries by doxygen1.3-rc1