happyfish100/libfastcommon
Freec common functions library extracted from my open source project FastDFS. this library is very simple and stable. functions including: string, logger, chain, hash, socket, ini file reader, base64 encode / decode, url encode / decode, fast timer, skiplist, object pool etc. detail info please see the
About happyfish100/libfastcommon
libfastcommon is a C common functions library extracted from the open source projects FastDFS and FastDHT. It provides a stable and simple set of core utilities for building high-performance C applications. The library includes an asynchronous logging system with thread safety, log rotation, and compression; an INI file reader that supports sections, multiple values, include directives, and control statements (if/else/for); a unique 64-bit ID generator for multi-process environments; string operations; base64 and URL encoding/decoding; MD5 hashing; hash tables; singly linked lists; blocked queues; AVL trees; skiplists (flat and multi); socket wrappers with IPv6 support; an ioevent abstraction (like epoll) supporting Linux, FreeBSD, and SunOS; I/O buffer management; memory pools; object allocators; connection pools; a time-wheel-based timer for network timeout management; local IP address functions; system information retrieval (CPU, memory, load, filesystems, processes); process control for start/stop/restart; task scheduling for repeated tasks; and character conversion utilities. Detailed usage information is available in the C header files and the project's forum at bbs.chinaunix.net.
Key Features
Pros & Cons
- Stable and simple library with a proven track record in FastDFS
- High-performance asynchronous logging with automatic compression and deletion
- Thread-safe components (logger, ID generator)
- Rich set of data structures (AVL trees, skiplists, hash tables, etc.)
- IPv6 support in socket functions
- Flexible INI file reader supporting advanced control statements
- Only available in C; no direct bindings for other languages (except PHP partial wraps)
- Documentation is primarily in the C header files with limited English comments and a Chinese-language forum
- Some advanced features (INI control statements) have a learning curve
- Less actively maintained compared to larger ecosystem libraries