Skip to content

DisonGo/c_stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 

Repository files navigation

C_stack

Github top language Github top language Github language count Repository size

About   |   Features   |   Requirements   |   Starting   |   Build   |   Author


About

Implementation of stack container in C.

Features

Type support:

Type Supported
int Yes
double Yes
char Yes

Separate headers for each type:

#include "c_stack_int.h"
#include "c_stack_double.h"
#include "c_stack_char.h"

Macros of dynamic type functions call:

// Requiers c_stack header
#include "c_stack.h"
Macros Description
st_init(type, size, stack_ptr) Initialize stack
st_empty(type, stack_ptr) Check if stack length = 0
st_pop(type, stack_ptr) Remove last value of stack
st_push(type, stack_ptr, value) Add new value on the end of stack
st_remove(type, stack_ptr) Free memory allocated to stack
st_size(type, stack_ptr) Get stack length
st_top(type, stack_ptr) Get pointer of last value of stack
st_valid(type, stack_ptr) Check if stack fields is valid

Requirements

Before starting, you need to have Git and Brew installed.

Starting

# Clone this project
$ git clone https://github.com/DisonGo/c_stack

# Access
$ cd c_stack

# Move to source folder
$ cd src

Build

# Build static lib c_stack.a in ../build dir
$ make

# Or
$ make all

# Or
$ make c_stack.a

# Build lib with debug
$ make clean debug c_stack.a

# Build and run tests
$ make test

# Create and open code coverage report
$ make gcov_report

# (Optional)
# Create your own main.c in src dir
# Build main.c in ./src (exe name ./c_stack)
$ make main

Made by Godison

 

Back to top

About

Implementation of stack container in C.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published