A minimal, thread-safe stack implementation written in C.
1 Download
2 Build
3 Example
3.1 Example output
4 Tester
5.1 Type definitions
To download stack, execute the following command
$ git clone https://github.com/Jacob-C-Smith/stack
To build on UNIX like machines, execute the following commands in the same directory
$ cd stack
$ cmake .
$ make
This will build the example program, the tester program, and dynamic / shared libraries
To build stack for Windows machines, open the base directory in Visual Studio, and build your desired target(s)
To run the example program, execute this command
$ ./stack_example
To run the tester program, execute this command after building
$ ./stack_test
typedef struct stack_s stack;
// Allocators
int stack_create ( const stack **const pp_stack );
// Constructors
int stack_construct ( const stack **const pp_stack, size_t size );
// Mutators
int stack_push ( stack *const p_stack, const void *const p_value );
int stack_pop ( stack *const p_stack, const void * *const ret );
// Accessors
int stack_peek ( const stack *const p_stack, const void **const ret );
// Destructors
int stack_destroy ( stack **const pp_stack );