Buffers - support for buffer objects
struct EDNetBuf; EDNetBuf *ednet_buf_new (unsigned int len); EDNetBuf *ednet_buf_ref (EDNetBuf *buf); void ednet_buf_unref (EDNetBuf *buf);
Buffer objects are widely used within EDNet SDK internal. It's a base object of EDNetFrame object, so you can call ednet_buf_*() functions with EDNetFrame objects. But It's better to use ednet_frame_*() functions for EDNetFrame objects.
typedef struct { const char *dummy; void (*finalize) (void *object); int _ref; unsigned int len; char *data; } EDNetBuf;
A Buffer used to contain large data chunks. It supports basic reference counting mechanism for efficient memory mananament in multi-thread environment.
EDNetBuf *ednet_buf_new (unsigned int len);
Creates a new buffer, whose data space will be allocated with specified size.
|
the length of buffer data |
Returns : |
a new EDNetBuf, NULL if an error occurred. |