Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. C/C++
  3. inih

inih

NOASSERTIONC++r62

A simple, lightweight .INI file parser written in C, designed for embedded systems.

GitHubGitHub
3.0k stars569 forks0 contributors

What is inih?

inih is a lightweight .INI file parser written in C, designed to parse configuration files efficiently with minimal resource usage. It solves the problem of reading INI-formatted settings in embedded systems and other memory-constrained applications where larger parsing libraries are impractical. The library uses a SAX-style callback mechanism, processing entries without loading the entire file into memory.

Target Audience

Developers working on embedded systems, IoT devices, or any C/C++ project requiring a simple, low-overhead configuration parser. It's also suitable for applications where minimal dependencies and small binary size are critical.

Value Proposition

Developers choose inih for its tiny code footprint, configurability, and reliability in resource-limited environments. Unlike heavier parsing libraries, it offers essential INI parsing features without bloat, making it ideal for systems where every byte counts.

Overview

Simple .INI file parser in C, good for embedded systems

Use Cases

Best For

  • Parsing configuration files in embedded systems with limited RAM
  • Adding simple settings management to C/C++ applications without external dependencies
  • Projects requiring a minimal, auditable codebase for security-critical environments
  • Cross-platform tools that need consistent INI handling across Windows, Linux, and embedded OSes
  • Educational purposes to understand simple file parsing techniques in C
  • Lightweight middleware components that read INI files without allocating large buffers

Not Ideal For

  • Projects needing full in-memory configuration trees for random access or modification
  • Applications requiring support for modern formats like JSON, YAML, or TOML natively
  • Teams prioritizing a feature-rich, drop-in C++ API without external dependencies or forks

Pros & Cons

Pros

Minimal Code Footprint

The entire parser is only a few pages of C code, making it easy to audit and integrate into security-critical or resource-constrained projects, as highlighted in the README.

Memory-Efficient SAX Parsing

Uses a callback-based approach that processes name=value pairs without loading the entire file into memory, ideal for embedded systems with limited RAM, per the project's design philosophy.

Highly Configurable Syntax

Offers compile-time options to enable or disable features like multi-line entries, BOM handling, and inline comments, allowing fine-tuned control over parsing behavior.

Flexible Input Sources

Supports parsing from files, strings, or custom streams via dedicated functions (e.g., ini_parse_file, ini_parse_string), providing versatility for different I/O scenarios.

Cons

Basic C++ API Limitations

The included INIReader class is minimal and not actively maintained by the author, who recommends forks for advanced features like GetSections(), adding friction for C++ users.

Incompatible with Full ConfigParser

Has key differences from Python's ConfigParser, such as allowing no-section items and handling line continuations as separate values, which can break cross-compatibility for some use cases.

Compile-Time Configuration Overhead

Requires preprocessor defines to adjust features, adding setup complexity compared to parsers with runtime options, and may involve rebuilding for different environments.

Frequently Asked Questions

Quick Stats

Stars3,022
Forks569
Contributors0
Open Issues4
Last commit5 months ago
CreatedSince 2015

Tags

#c-library#embedded-systems#low-memory#lightweight#ini#c#c-plus-plus#ini-parser#configuration#file-parsing#configparser#cross-platform#meson-build#parser

Built With

M
Meson
C
C++

Included in

C/C++70.6k
Auto-fetched 5 hours ago

Related Projects

toml++toml++

Header-only TOML config file parser and serializer for C++17.

Stars2,108
Forks207
Last commit2 days ago
simpleinisimpleini

Cross-platform C++ library providing a simple API to read and write INI-style configuration files

Stars1,315
Forks359
Last commit1 month ago
toml11toml11

TOML for Modern C++

Stars1,285
Forks184
Last commit7 months ago
libconfiglibconfig

C/C++ Library for Processing Structured Configuration Files

Stars1,220
Forks383
Last commit5 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub