This is a custom stack data structure implementation written in C (with some convinient C++ adjustments) that includes advanced security and debug features like head structure & data canaries, data hashing, constant state validation and expanded html logs with current state dump triggered by encountered error codes. User types for data are supported as well as user dump functions for user types.
stack
automatically validates its state and writes stack_log.html
(by default). Green OK
lines indicate, that everything goes normally, and red ERROR
lines appear when a problem occurs (in this case all values of struct Stack are dumped).
Download this repository with
git clone https://github.com/nerett/stack.git
Install required packages automatically with
make install-dependencies-pkg PACKAGEMANAGER=<your-package-manager-name> #apt is used if PACKAGEMANAGER is not defined
...or install them manually with your distro package manager (check list here).
Build stack
as a standalone program with
make MODE=DEBUG #or MODE=RELEASE; MODE=RELEASE if not defined
You can also include stack
in your project with the help of stack.h
as a source code or as linkable library object files (note: object files libstack.o
and libstack_config.o
are created during the build process in any mode).
You can run builded release/debug version of standalone stack
with
make run MODE=DEBUG #MODE=RELEASE if MODE is not defined
Use rund
instead of run
to run with valgrind
...or run this binary with manually from project directory.
To totally rebuild the project run
make clean
make MODE=<modename>
This project actually depends on libc
and building requires make
, g++
and git
(it can also require valgrind
installed to use rund
target).
This section isn't done yet.
This programm was written during MIPT Ded's cource.