IvanoBilenchi / uvec

A type-safe, generic C vector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

uVec - a type-safe, generic C vector.

⚠️ Important note ⚠️

uVec is now part of the uLib library. All further development has moved there.

Author

Ivano Bilenchi

Description

Implementation of a type-safe, generic vector data structure written in C. Macro-heavy, not for the faint of heart. Inspired by klib.

Features

  • Vector primitives (uvec_get, uvec_set, uvec_push, uvec_pop, uvec_append, ...)
  • Iteration macros (uvec_iterate, uvec_foreach, ...)
  • Support for element equality and related features (uvec_contains, uvec_index_of, ...)
  • Support for element comparison and related features (uvec_index_of_max, uvec_index_of_min, uvec_sort, ...)
  • Higher order macros (uvec_first_index_where, uvec_remove_where, ...)

Usage

If you are using CMake as your build system, you can add uVec as a subproject, then link against the uvec target. Otherwise, in general you just need the uvec.h header.

Documentation

Documentation for the project is provided in form of docstrings in the Public API section of uvec.h. You can also generate HTML docs via CMake, though you will also need Doxygen. For usage examples, see test.c.

CMake targets

  • uvec: interface library target, which you can link against.
  • uvec-docs: generates documentation via Doxygen.
  • uvec-test: generates the test suite.

License

uVec is available under the MIT license. See the LICENSE file for more info.

About

A type-safe, generic C vector

License:MIT License


Languages

Language:C 99.0%Language:CMake 1.0%