{"id":23508774,"url":"https://github.com/lovasko/libcsv","last_synced_at":"2025-10-11T20:32:33.068Z","repository":{"id":78820971,"uuid":"44639241","full_name":"lovasko/libcsv","owner":"lovasko","description":"C89 Comma Separated Values Implementation","archived":false,"fork":false,"pushed_at":"2016-02-05T06:03:31.000Z","size":16,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-17T02:48:52.013Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lovasko.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}},"created_at":"2015-10-20T22:47:02.000Z","updated_at":"2023-12-01T06:21:58.000Z","dependencies_parsed_at":"2023-04-27T13:16:47.896Z","dependency_job_id":null,"html_url":"https://github.com/lovasko/libcsv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lovasko/libcsv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasko%2Flibcsv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasko%2Flibcsv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasko%2Flibcsv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasko%2Flibcsv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lovasko","download_url":"https://codeload.github.com/lovasko/libcsv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasko%2Flibcsv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279008618,"owners_count":26084480,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-12-25T11:32:06.338Z","updated_at":"2025-10-11T20:32:33.053Z","avatar_url":"https://github.com/lovasko.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libcsv\nComma Separated Values implementation for the C89 language.\n\n## Goals\n * ability to read arbitrary huge files\n * focus on speed by omitting unnecessary operations such as memory allocation\n * simplest possible API with proper error handling\n\n## Documentation\n### Opening a data file\nIn order to open a file, use the `csv_open` function. It expects four\narguments:\n * pointer to a `struct csv`\n * `path` of the CSV data file\n * the field `separator` (record separator is always `\\n`)\n * `field_count` of every record\n\n### Reading records\nThis is the main operation that has to be called separately for every record in\nthe data, essentially functioning as a stream of data. It only provides\npointers to a NULL-terminated array of strings (`char***`). None of these\nstrings are allocated, therefore all strings that need to preserved and not\nonly parsed (and acted upon) need to be `strdup`-ed. The function\n`csv_read_record` expects a pointer to the `struct csv` and, as previously\nmentioned`, it returns all field strings via the second argument.\n\nMoreover, this function can be used to skip the optional headers.\n\n### Finalisation\nAfter reading all necessary records from the data set, use the `csv_close`\nfunction to close the file descriptor and to deallocate all internal data\nstructures.\n\n### Return codes\nIt may happen that one or more of the previously mentioned function will return\na value different from `CSV_OK`. In case you want to inform your user what kind\nof error it is, use the `csv_error_string` that converts the `int` return code\ninto a meaningful English message.\n\n## Example\nThe file [people.c](examples/people.c) provides a basic source code to a read a\ndata set stored in the [people.csv](examples/people.csv).\n\n## Supported platforms\n * FreeBSD 10.0 with Clang 3.3\n * OS X 10.9 with Clang 3.5\n * Linux Gentoo 2.2 with Clang 3.6\n\nIf a platform does not appear to be in the previous list, it does not mean that\n`libcsv` will not work in such environment. It only means that nobody tested\nit - you are encouraged to do so and report either success or failure.\n\n## Build \u0026 install\n```\n$ ninja\n$ sudo ./install.sh\n```\n\n## License\n2-clause BSD license. For more information please consult the\n[LICENSE](LICENSE) file. In the case that you need a different license, feel\nfree to contact me.\n\n## Author\nDaniel Lovasko (daniel.lovasko@gmail.com)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovasko%2Flibcsv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flovasko%2Flibcsv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovasko%2Flibcsv/lists"}