{"id":13578942,"url":"https://github.com/rxi/ini","last_synced_at":"2025-04-06T07:11:29.178Z","repository":{"id":38311198,"uuid":"42608086","full_name":"rxi/ini","owner":"rxi","description":"A tiny ANSI C library for loading .ini config files","archived":false,"fork":false,"pushed_at":"2023-12-03T23:44:46.000Z","size":10,"stargazers_count":345,"open_issues_count":6,"forks_count":81,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-30T05:08:30.172Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rxi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-09-16T19:16:07.000Z","updated_at":"2025-03-03T12:50:49.000Z","dependencies_parsed_at":"2024-08-01T15:30:01.159Z","dependency_job_id":"d22afb79-dfce-4cc7-ab90-7bb6e8b0537e","html_url":"https://github.com/rxi/ini","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxi%2Fini","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxi%2Fini/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxi%2Fini/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rxi%2Fini/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rxi","download_url":"https://codeload.github.com/rxi/ini/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247445669,"owners_count":20939958,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T15:01:35.222Z","updated_at":"2025-04-06T07:11:29.154Z","avatar_url":"https://github.com/rxi.png","language":"C","readme":"\n# ini\nA *tiny* ANSI C library for loading .ini config files\n\n## Usage\nThe files **[ini.c](src/ini.c?raw=1)** and **[ini.h](src/ini.h?raw=1)** should\nbe dropped into an existing project.\n\nThe library has support for sections, comment lines and quoted string values\n(with escapes). Unquoted values and keys are trimmed of whitespace when loaded.\n\n```ini\n; last modified 1 April 2001 by John Doe\n[owner]\nname = John Doe\norganization = Acme Widgets Inc.\n\n[database]\n; use IP address in case network name resolution is not working\nserver = 192.0.2.62     \nport = 143\nfile = \"payroll.dat\"\n```\n\nAn ini file can be loaded into memory by using the `ini_load()` function.\n`NULL` is returned if the file cannot be loaded.\n```c\nini_t *config = ini_load(\"config.ini\");\n```\n\nThe library provides two functions for retrieving values: the first is\n`ini_get()`. Given a section and a key the corresponding value is returned if\nit exists. If the `section` argument is `NULL` then all sections are searched.\n```c\nconst char *name = ini_get(config, \"owner\", \"name\");\nif (name) {\n  printf(\"name: %s\\n\", name);\n}\n```\n\nThe second, `ini_sget()`, takes the same arguments as `ini_get()` with the\naddition of a scanf format string and a pointer for where to store the value.\n```c\nconst char *server = \"default\";\nint port = 80;\n\nini_sget(config, \"database\", \"server\", NULL, \u0026server);\nini_sget(config, \"database\", \"port\", \"%d\", \u0026port);\n\nprintf(\"server: %s:%d\\n\", server, port);\n```\n\nThe `ini_free()` function is used to free the memory used by the `ini_t*`\nobject when we are done with it. Calling this function invalidates all string\npointers returned by the library.\n```c\nini_free(config);\n```\n\n\n## License\nThis library is free software; you can redistribute it and/or modify it under\nthe terms of the MIT license. See [LICENSE](LICENSE) for details.\n","funding_links":[],"categories":["C","C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frxi%2Fini","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frxi%2Fini","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frxi%2Fini/lists"}