Tiny single-header C/++ libs
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
tests
.gitignore
README.md
rf.h
rf_darray.h
rf_string_hash_table.h
rf_utils.h
test.bat

README.md

rf_header_libs

Tiny single-header C/++ libs

rf_darray

Dependent on the CRT by default (can be changed)

rf_darray provides functionality for managing dynamically-sizing arrays. Arrays allocated by rf_darray resize as they need to and function just like normal arrays (subscript operator still works, random-access in O(1) time, etc.). Accessing the size/capacity of the array can be done in O(1) time as well (it is stored, not calculated).

rf_string_hash_table

Dependent on the CRT by default (can be changed)

rf_string_hash_table provides functionality for creating and managing a simple string-to-object hash table. It works in a fixed-region of memory (that you pass to it) with fixed-size keys for simplicity. It will not allocate any memory, and does not require any cleaning-up. You initialize a hash table object with some buffer of memory (and the size of that memory), the size of a given key, and the type that is to be used with the hash table as values. You can then add/remove/get at will.

rf_utils

Dependent on the CRT

rf_utils is a file that just contains some macros/typedefs that I find useful when programming in almost every case. There are some nice macros for foreach loops, forrng ("for range") loops, memory allocation, and some general number/math operations. There's also typedefs for fixed-length types, like i8 for int8_t, i16 for int16_t, u32 for uint32_t, r32 for float, etc.