Header-Only GIF Decoder Library in Pure C with No Malloc Usage
By
FerkiHN
Pure flour-power. Hearty enough to carry you through lunch.
Summary
The article discusses a header-only GIF decoder library implemented in pure C that doesn't use malloc and is designed to be easy to use. The content focuses on technical discussions about the implementation approach, particularly the header-only design pattern popularized by stb libraries. Commenters discuss the benefits of this approach, including flexibility in build configurations and avoiding traditional linker issues. The discussion centers on programming patterns, library design, and practical implementation considerations for C developers.
Key quotes
· 4 pulledThere are multiple comments remarking on the header-only implementation, confused regarding linker errors and why this is desirable.
Look into stb lib, which in my opinion popularized this idea
In particular, you can define the implementation flag and include the header in a .c file with no other contents to recover the more 'traditional' build set up where you have a separate TU dedicated to the library.
I quite like the flexibility it provides in terms of making 'u
You might also wanna read
Cscript Style Guide: A Python-Inspired Approach to C Programming
Cscript is presented as a style guide for writing C code that aims to make C development faster and more Python-like while maintaining C's p
Pigeon's Device: An Independent Loop Optimization Technique in C Programming
The article introduces Pigeon's device, a loop optimization technique in C programming that was independently developed from Duff's device.
Implementing Closures in C Using JIT-Compiled Wrappers for Win32 Window Procedures
The article discusses an advanced programming technique for creating closures in C using JIT-compiled wrappers, specifically applied to Win3
Guidelines for Writing Fully Encapsulated C Programs: Pure vs Performance Approaches
This article presents a comprehensive set of rules and guidelines for writing fully encapsulated C programs, developed by the author over ye
Checked-size Array Parameters in C: Addressing Safety Issues with Array Size Validation
The article discusses a recent attempt to add safety checks for array parameters in the C programming language, specifically within the cryp
Creating a Leak-Free, Thread-Safe Grep Utility in C23 with Safe Programming Practices
The article details the author's experience creating a leak-free, thread-safe grep utility in C23 using a custom header file called safe_c.h
