C_dictionary: A simple dynamically typed and sized hashmap in C - feedback welcome

This page summarizes the projects mentioned and recommended in the original post on /r/C_Programming

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • stb

    stb single-file public domain libraries for C/C++

    The advantage of the STB approach is that it allows API macros to return correctly typed pointers (or lvalues) to elements (either by using the common extension typeof, which will become standard in C23, or by making sure that container pointer points to the beginning of the element store and then returning container_pointer[ index_to_desired_element ] to the user) without requiring the user to pre-define a container type using some macro or #include directive (e.g. DEFINE_DYNAMIC_ARRAY( int_array, int ), which would essentially manually instantiate a template). This works well for containers with one element type (e.g. a dynamic array or a hash table with a fixed key type). But for containers that have two element types (e.g. a hash table with a user-specified key type and user-specified element type), this benefit is mostly negated because the user ends up having to declare a struct containing the two types (essentially the hash table's bucket) anyway. That's how stb_ds works. There is a way around this problem that involves creating pointers that carry multiple types, but it's very complicated a not a good place for someone just learning to implement hash tables to begin (for more information see CC, but I must disclose that this is a shameless plug because I'm the author of that library).

  • C_dictionary

    A simple dynamically typed and sized hashmap in C

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

  • SDS

    Simple Dynamic Strings library for C

    d) everything being a macro seems overkill for me (and possibly dangerous, see b)). Maybe implement more as static inline functions, see the sds header: https://github.com/antirez/sds/blob/master/sds.h (which does a similar thing with the header struct).

  • CC

    A small, usability-oriented generic container library.

    The advantage of the STB approach is that it allows API macros to return correctly typed pointers (or lvalues) to elements (either by using the common extension typeof, which will become standard in C23, or by making sure that container pointer points to the beginning of the element store and then returning container_pointer[ index_to_desired_element ] to the user) without requiring the user to pre-define a container type using some macro or #include directive (e.g. DEFINE_DYNAMIC_ARRAY( int_array, int ), which would essentially manually instantiate a template). This works well for containers with one element type (e.g. a dynamic array or a hash table with a fixed key type). But for containers that have two element types (e.g. a hash table with a user-specified key type and user-specified element type), this benefit is mostly negated because the user ends up having to declare a struct containing the two types (essentially the hash table's bucket) anyway. That's how stb_ds works. There is a way around this problem that involves creating pointers that carry multiple types, but it's very complicated a not a good place for someone just learning to implement hash tables to begin (for more information see CC, but I must disclose that this is a shameless plug because I'm the author of that library).

  • Klib

    A standalone and lightweight C library

  • ctl

    My variant of the C Template Library (by rurban)

  • pottery

    Pottery - A container and algorithm template library in C (by ludocode)

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • libchaste

    C-haste Library. A collection of utilities to make developing C programs fast and easy.

  • evec

    Easy to use header only vector data type for C programs.

    There's a few ways to address this. This library has a good explanation of one of them here.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts