wolkykim/qlibc logo

wolkykim/qlibc

Free

qLibc is a simple and yet powerful C library providing generic data structures and algorithms.

FreeFree tier
Type
Open Source

About wolkykim/qlibc

qLibc is a comprehensive, open-source C/C++ library that provides a wide range of generic data structures and utility functions, distributed under the 2-clause BSD license. It offers containers for key/value pairs (tree table, hash table, static hash table, list table) and objects (doubly linked list, growable vector, FIFO queue, LIFO stack), all with a consistent API. Additionally, it includes general utilities for string manipulation, I/O, file handling, IPC, encoders/decoders (URL, Base64, Hex), hashing (Murmur, FNV, MD5), and time conversion. Extension APIs cover Apache-style and INI-style configuration parsing, HTTP client, rotating file logger, MySQL interface, and token-bucket rate limiting. qLibc is designed to provide a ready-made set of common containers and routines with thread-safe options and support for shared memory in static hash tables.

Key Features

Comprehensive set of container data structures: Tree Table (left-leaning red-black tree), Hash Table, Static Hash Table (supports shared memory), List Table, Doubly Linked List, Vector, Queue, and Stack
Consistent API across all containers, with both function pointer and direct-access interfaces
General utility functions: string manipulation (trimming, modifying, replacing, case conversion, pattern detection), I/O (non-blocking, stream reader/writer), file locking and directory handling, IPC and semaphores, shared memory
Encoders/decoders: URL, Base64, Hex
Hash functions: Murmur, FNV, MD5
Time functions: time diff and format conversion
Extension APIs: Apache-style and INI-style configuration file parsers, HTTP client, rotating file logger, MySQL database interface, token-bucket rate limiter
Thread-safe option available for most containers
Simple and powerful design with minimal dependencies

Pros & Cons

Pros
  • One of the most functionally-complete publicly-licensed C/C++ libraries with a wide variety of containers and utilities
  • Consistent API design makes it easy to switch between different container types
  • Thread-safe options allow safe concurrent access
  • Static hash table supports shared memory and pre-allocation, useful for inter-process communication
  • Well-documented with API reference (qlibc Core API Reference and Extension API Reference)
  • Open source under permissive 2-clause BSD license, allowing free use in both open-source and proprietary projects
Cons
  • Limited to C/C++ projects; not usable in other programming languages
  • Requires manual memory management typical of C libraries, which can be error-prone for inexperienced developers
  • Not as widely adopted as some other C libraries (e.g., GLib), so community support and third-party resources may be smaller
  • Some advanced features (e.g., database interface) may require additional dependencies

Best For

Building systems software or embedded applications in C/C++ requiring efficient data structuresAdding common algorithm utilities (hashing, encoding, string processing) to C/C++ projectsImplementing configuration file parsing (Apache-style or INI-style) in C/C++ applicationsCreating HTTP clients or rotating loggers with minimal overheadRate limiting using token-bucket algorithm in C/C++ programsEducational purposes to study and use various data structures and algorithms

FAQ

What is qLibc?
qLibc is a simple and yet powerful general-purpose C/C++ library that provides generic data structures (containers) and common utility routines, all with a consistent API.
What license does qLibc use?
qLibc is published under the 2-clause BSD license (also known as the Simplified BSD License).
What container data structures does qLibc provide?
qLibc provides containers for key/value pairs: Tree Table (binary tree), Hash Table, Static Hash Table (fixed-size memory, supports shared memory), and List Table (doubly linked-list). It also provides object containers: List (doubly linked list), Vector (growable array), Queue (FIFO), and Stack (LIFO).
What utility functions are included?
Utilities include string manipulation (trim, modify, replace, case conversion, pattern detection), I/O (non-blocking, stream reader/writer), file locking and directory handling, IPC and semaphores, shared memory, encoders/decoders (URL, Base64, Hex), hash functions (Murmur, FNV, MD5), and time conversion.
Does qLibc support thread safety?
Yes, most containers offer a thread-safe option, and the hash table and static hash table have user-defined or built-in thread-safety support.