Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TODO] Support reading line larger than 8192 bytes #20

Closed
syoyo opened this issue Jan 12, 2019 · 3 comments
Closed

[TODO] Support reading line larger than 8192 bytes #20

syoyo opened this issue Jan 12, 2019 · 3 comments

Comments

@syoyo
Copy link
Owner

syoyo commented Jan 12, 2019

Currently max bytes per line are limited to 8192.

Support arbitrary bytes per line.

@mandyedi
Copy link
Contributor

Hi @syoyo
I'd like to contribute to your obj loader. How would you like to extend the buffer for reading lines? I was thinking reallocating the buffer if it exceeds the 8192 limit. Or maybe getline could be used instead of fgets, but I'm not sure of its compatibility with C98.

@syoyo
Copy link
Owner Author

syoyo commented Feb 26, 2019

@mandyedi Awesome!

One possible solution is dynamically grow buffer while reading data using fgets

https://ossguy.com/?p=284

Another and more robust solutions is first read whole data from a file, then find line endings as done in multi-threaded .obj parser: https://github.com/syoyo/tinyobjloader/tree/master/experimental

@mandyedi
Copy link
Contributor

Thanks for the suggestions! To keep it simple and C compatible I choose the dynamic buffer solution.

@syoyo syoyo closed this as completed in e369baa Mar 2, 2019
syoyo added a commit that referenced this issue Mar 2, 2019
Add dynamic fgets for supporting long lines in mtl files. Fixes #20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants