Liste des Groupes | Revenir à co vms |
On Mon, 19 Aug 2024 16:05:59 -0400, Stephen Hoffman wrote:For work here, all functions that return data have a parameter that limits the byte count. Usually pass a pointer to a buffer, with the size parameter equal to or less than the buffer size. Some C library
strings and character encoding are more "fun":If a system/library call is going to return a dynamic amount of data, it
is good if it can give some indication of how much data it is going to
return first.
The best calls are the ones that, if you pass NULL for the buffer, they
will return the number of bytes they would have put in the buffer. So you
allocate that size of buffer and do a second call, and get back the actual
buffer data.
I did a Python wrapper for Fribidi, and unfortunately its text-encoding
conversion calls didn’t work that way. But then, they probably
couldn’t ...
Les messages affichés proviennent d'usenet.