AStruct is a library of data structures for C. It includes:
- AList
- AVector
- AStack
- AQueue
- AHashtable
All data structures are used as pointers and are created using AStruct->ANew()
. They all share the same interface of being operated via function pointers within the data structure which are passed a pointer to the data structure as their first argument. All of the data structures should be destroyed when you're done with them using the ->destroy()
function they provide.
All the values the data structures refer to are generic pointers (void *
). It's up to the user to provide useful functions to operate on the actual values dereferenced by the pointers.
AStruct can to be built using GCC or MSVC (tested on Linux and Windows). After the build, the library file (.so, .dll) will be in the folder build
.
-
Linux/GCC, Windows/MinGW-MSYS, Windows/Cygwin
Use the Makefile. Run the regular
make
command from the root directory of the project.
-
Windows/MSVC
Import
AStruct.vcxproj
to Visual Studio and build the project from the Build menu.
-
Linux
Run
sudo make install
After
make
to install the shared library and headers to standard system locations. -
Windows
No installation. Just copy the .dll file the and headers to the new project.
Either of the following tools can be used for development:
-
Make
Run
make debug
To build a debug build of the library. This will run the required unit tests from
tests
folder as well. -
Eclipse CDT
AStruct can be imported to Eclipse CDT. Import the root folder (containing the Eclipse project files
.project
and.cproject
) as an existing project. The Eclipse CDT project uses the Makefile for builds, and by default uses the Debug configuration. -
Visual Studio
AStruct can be imported to Visual Studio. Open the project file (
AStruct.vcxproj
) to import the project to Visual Studio. Visual Studio builds in Debug mode by default.
Documentation for AStruct is generated using Doxygen (1.8.3 at least). Run doxygen
from the root folder, which will generate HTML documentation in the folder doc
. If you're runnning Linux, run
make doc
sudo make install-doc
to generate the documentation and install it to the standard location.
AStruct is distributed under the BSD-2 License. See LICENSE.md
for details.
- Project home: https://github.com/Avidanborisov/AStruct
- Online documentation: http://Avidanborisov.github.com/AStruct