4coder»Forums
xel
18 posts
presses plastic buttons for fun
Question: How can I read the contents of a buffer entirely?
I'd like to get the entire contents of a buffer.

In the docs, I see the function app->buffer_read_range(app, &buffer, start, end, buffer_out), however, I'm having trouble coming up with a way to get the length of a buffer (in order to set the end parameter).

Thanks for any help.
Allen Webster
476 posts / 6 projects
Heyo
Question: How can I read the contents of a buffer entirely?
The Buffer_Summary struct acts both as a handle to a buffer, as well as a chunk of memory containing lots of information about the buffer. If you have the Buffer_Summary that refers to the buffer you want, then buffer.size is the length of the entire buffer.
xel
18 posts
presses plastic buttons for fun
Question: How can I read the contents of a buffer entirely?
Awesome, thanks.