# sini **Repository Path**: kenvins/sini ## Basic Information - **Project Name**: sini - **Description**: simple ini file parsing, for readable configs. forked from https://github.com/benhoyt/inih - **Primary Language**: Unknown - **License**: BSD-3-Clause - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-04-27 - **Last Updated**: 2024-10-16 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # SINI > inspired by c version of [inih](https://github.com/benhoyt/inih) simple ini parser for pure c. the first version of sini is completely copied from inih. the main purpose of sini fork is to avoid build inih everywhere yeah, i have many machines. it is terrible to build inih on every machine, so i put it inside and eliminate cpp part to make it more simple. ## Usage ```c // use sini just like inih.h #include "sini/sini.h" static int handler(void *user, const char *section, const char *name, const char *cur_value) { printf("Section: %s, Name: %s, Value: %s\n", section, name, cur_value); return 1; } int main() { const char *ini_string = "[section_list]\n" "section0\n" "section1\n\n" "[section0]\n" "key0=val0\n\n" "[section1]\n" "key1=val1\n\n"; if (ini_parse_string(ini_string, handler, NULL) < 0) { fprintf(stderr, "Failed to parse INI String.\n"); return 1; } return 0; } ```