Skip to content

Feature Request: Consider adding CSV_NO_ALLOC option #32

@bharatvaj

Description

@bharatvaj

Hey @rgamble,

Currently I am trying to read an export of a government website, which contains fixed size fields such as DOB, mobile number, etc and where names and country specific ID numbers have a hard limit.

For reading contents of known size, it be would be great to get pointer and size of the csv fields of the given buffer when receiving callback instead of the internally allocated one.

Since void *, size_t combo is already provisioned in void cb1(void *s, size_t len, void *data), it would be possible to implement this without breaking the ABI and I hope it could be introduced as an option via int csv_set_opts(struct csv_parser *p, unsigned char options). CSV_NO_ALLOC perhaps?

This feature would be extremely useful when the file we are reading is large, but well within the limits of the total memory. Say 15-100 mb, which could be easily mmaped for a better performance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions