Skip to content

Jacob-C-Smith/stack

Repository files navigation

stack

CMake

Dependencies:
sync

A minimal, thread-safe stack implementation written in C.

1 Download

2 Build

3 Example

3.1 Example output

4 Tester

5 Definitions

5.1 Type definitions

5.2 Function definitions

Download

To download stack, execute the following command

$ git clone https://github.com/Jacob-C-Smith/stack

Build

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)

Example

To run the example program, execute this command

$ ./stack_example

Example output

Source

Tester

To run the tester program, execute this command after building

$ ./stack_test

Source

Tester output

Definitions

Type definitions

typedef struct stack_s stack;

Function definitions

// 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 );

Releases

No releases published

Packages

No packages published