buffer\datum questions

Olya olyasib12 at gmail.com
Thu Jul 26 23:00:43 CEST 2012


I've been struggling with data buffering - seems like what I've guessed from source
code is not entirely true: buffer content is not what I've put in there, segfaults etc.

Could you help me to figure out how to use gnutls_str properly?
Code snippets would be most awesome. (Yepp, I'm aware that it's used throughout
GnuTLS - but thousands of lines of undocumented code is hardly a good illustration :)
I'll try to add some documentation to gnutls_str.c once I figure out how stuff in
there actually works.

1) I've got gnutls_buffer_st with some content and void * data of size len - how do I
replace the buffer content? Who\when does memory allocation\free?

2) I'd like to get hex representation of buffer content to char * (for printing) -
how do I do that?

3) What's the difference between datum and buffer - when I should use one?

4) What's with memory management? Is it completely automated? When and why do I need

5) What does various _prefix() functions do?

This is so trivially obvious that it wasn't even documented - but it's really hard
for newcomers to figure out. That's why I'd like to produce at least something to
doxygen gnutls_str.c

best regards,

More information about the Gnutls-devel mailing list