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

rework of buffer dumping api. #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions clunk_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,10 @@ CLUNKCAPI void *clunk_buffer_reserve(clunk_buffer *buffer, int more)
return buffer->reserve(more);
}

CLUNKCAPI const char *clunk_buffer_dump(clunk_buffer *buffer)
CLUNKCAPI void clunk_buffer_dump(clunk_buffer *buffer, char *out, const size_t len)
{
return buffer->dump().c_str();
size_t r = buffer->dump().copy(out, len, 0);
out[r] = 0;
}

CLUNKCAPI void clunk_buffer_pop(clunk_buffer *buffer, size_t n)
Expand Down
2 changes: 1 addition & 1 deletion clunk_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ CLUNKCAPI void clunk_buffer_fill(clunk_buffer *buffer, int b);
CLUNKCAPI void clunk_buffer_append(clunk_buffer *buffer, const clunk_buffer *other);
CLUNKCAPI void clunk_buffer_append_data(clunk_buffer *buffer, const void *data, const size_t size);
CLUNKCAPI void *clunk_buffer_reserve(clunk_buffer *buffer, int more);
CLUNKCAPI const char *clunk_buffer_dump(clunk_buffer *buffer);
CLUNKCAPI void clunk_buffer_dump(clunk_buffer *buffer, char *out, const size_t size);
CLUNKCAPI void clunk_buffer_pop(clunk_buffer *buffer, size_t n);
CLUNKCAPI void clunk_audio_lock(void);
CLUNKCAPI void clunk_audio_unlock(void);
Expand Down