Sha256: cab726cd491ff943a91fab5717a562dcd722a23dc779d169f2929532f96d4ae8
Contents?: true
Size: 1.71 KB
Versions: 8
Compression:
Stored size: 1.71 KB
Contents
zchunk(3) ========= NAME ---- zchunk - work with memory chunks SYNOPSIS -------- ---- // Create new chunk CZMQ_EXPORT zchunk_t * zchunk_new (const void *data, size_t size); // Destroy a chunk CZMQ_EXPORT void zchunk_destroy (zchunk_t **self_p); // Resizes chunk max_size as requested; chunk_cur size is set to zero CZMQ_EXPORT void zchunk_resize (zchunk_t *self, size_t size); // Return chunk cur size CZMQ_EXPORT size_t zchunk_size (zchunk_t *self); // Return chunk max size CZMQ_EXPORT size_t zchunk_max_size (zchunk_t *self); // Return chunk data CZMQ_EXPORT byte * zchunk_data (zchunk_t *self); // Set chunk data from user-supplied data; truncate if too large CZMQ_EXPORT size_t zchunk_set (zchunk_t *self, const void *data, size_t size); // Fill chunk data from user-supplied octet CZMQ_EXPORT size_t zchunk_fill (zchunk_t *self, byte filler, size_t size); // Read chunk from an open file descriptor CZMQ_EXPORT zchunk_t * zchunk_read (FILE *handle, size_t bytes); // Write chunk to an open file descriptor CZMQ_EXPORT int zchunk_write (zchunk_t *self, FILE *handle); // Self test of this class CZMQ_EXPORT int zchunk_test (bool verbose); ---- DESCRIPTION ----------- The zchunk class works with variable sized blobs. Not as efficient as ØMQ's messages but they do less weirdness and so are easier to understand. The chunk class has methods to read and write chunks from disk. EXAMPLE ------- .From zchunk_test method ---- zchunk_t *chunk = zchunk_new ("1234567890", 10); assert (chunk); assert (zchunk_size (chunk) == 10); assert (memcmp (zchunk_data (chunk), "1234567890", 10) == 0); zchunk_destroy (&chunk); ---- SEE ALSO -------- linkczmq:czmq[7]
Version data entries
8 entries across 8 versions & 1 rubygems