{"id":19340498,"url":"https://github.com/doccaico/ini-v","last_synced_at":"2026-02-28T16:32:33.682Z","repository":{"id":235759993,"uuid":"791187070","full_name":"doccaico/ini-v","owner":"doccaico","description":"INI module for V","archived":false,"fork":false,"pushed_at":"2024-04-24T12:55:04.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-17T16:27:27.481Z","etag":null,"topics":["v","vlang"],"latest_commit_sha":null,"homepage":"","language":"V","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/doccaico.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-04-24T08:51:46.000Z","updated_at":"2024-07-31T21:26:50.000Z","dependencies_parsed_at":"2024-04-24T14:25:50.730Z","dependency_job_id":"511316ac-ff9d-4012-88e7-2a181c3f1463","html_url":"https://github.com/doccaico/ini-v","commit_stats":null,"previous_names":["doccaico/ini"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/doccaico/ini-v","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doccaico%2Fini-v","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doccaico%2Fini-v/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doccaico%2Fini-v/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doccaico%2Fini-v/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/doccaico","download_url":"https://codeload.github.com/doccaico/ini-v/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/doccaico%2Fini-v/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29942864,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T13:49:17.081Z","status":"ssl_error","status_checked_at":"2026-02-28T13:48:50.396Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["v","vlang"],"created_at":"2024-11-10T03:26:42.206Z","updated_at":"2026-02-28T16:32:33.655Z","avatar_url":"https://github.com/doccaico.png","language":"V","funding_links":[],"categories":[],"sub_categories":[],"readme":"## INI\nINI module for V. It uses the [ini.h](https://github.com/mattiasgustavsson/libs/) library for parsing INI files.\n\n### Installation\n```\n$ v install --git https://github.com/doccaico/ini-v\n```\n\n### Loading an ini file and retrieving values\n```v\nmodule main\n\nimport os\nimport doccaico.ini\n\nfn main() {\n\tbytes := os.read_file('test.ini')!\n\n\tini_data := ini.load(bytes.str, unsafe { nil })\n\tdefer {\n\t\tini.destroy(ini_data)\n\t}\n\n\t// global\n\tglobal_version_index := ini.find_property(ini_data, ini.global_section, 'Version'.str,\n\t\t0)\n\tglobal_version := ini.property_value(ini_data, ini.global_section, global_version_index)\n\n\tunsafe {\n\t\tprintln('Version=${cstring_to_vstring(global_version)}')\n\t}\n\n\t// normal section\n\tnormal_section := ini.find_section(ini_data, 'Normal'.str, 0)\n\tnormal_editor_index := ini.find_property(ini_data, normal_section, 'Editor'.str, 0)\n\tnormal_editor := ini.property_value(ini_data, normal_section, normal_editor_index)\n\n\tunsafe {\n\t\tprintln('Editor=${cstring_to_vstring(normal_editor)}')\n\t}\n\t// Version=11.2401.26.0\n\t// Editor=c:/editor/vim.exe\n}\n```\n### Create a ini file\n```v\nmodule main\n\nimport os\nimport doccaico.ini\n\nfn main() {\n\tini_data := ini.create(unsafe { nil })\n\tdefer {\n\t\tini.destroy(ini_data)\n\t}\n\n\tini.property_add(ini_data, ini.global_section, 'Version'.str, 0, '11.2401.26.0'.str,\n\t\t0)\n\tini.property_add(ini_data, ini.global_section, 'NoTrayIcon'.str, 0, '0'.str, 0)\n\tini.property_add(ini_data, ini.global_section, 'Editor'.str, 0, 'c:/WINDOWS/system32/notepad.exe'.str,\n\t\t0)\n\n\tnormal_section := ini.section_add(ini_data, 'Normal'.str, 0)\n\tini.property_add(ini_data, normal_section, 'Version'.str, 0, '9.1'.str, 0)\n\tini.property_add(ini_data, normal_section, 'NoTrayIcon'.str, 0, '5'.str, 0)\n\tini.property_add(ini_data, normal_section, 'Editor'.str, 0, 'c:/editor/vim.exe'.str,\n\t\t0)\n\n\tneeded_size := ini.save(ini_data, unsafe { nil }, 0) // Find the size needed\n\tdata := unsafe { malloc(needed_size) }\n\tdefer {\n\t\tunsafe { free(data) }\n\t}\n\t_ := ini.save(ini_data, data, needed_size) // Actually save the file\n\n\tunsafe {\n\t\tprintln('${cstring_to_vstring(data)}')\n\t}\n\t// Version=11.2401.26.0\n\t// NoTrayIcon=0\n\t// Editor=c:/WINDOWS/system32/notepad.exe\n\t//\n\t// [Normal]\n\t// Version=9.1\n\t// NoTrayIcon=5\n\t// Editor=c:/editor/vim.exe\n\n\tos.write_file('new.ini', unsafe { cstring_to_vstring(data) })!\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoccaico%2Fini-v","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdoccaico%2Fini-v","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdoccaico%2Fini-v/lists"}