441 size_t nitems, |
441 size_t nitems, |
442 CxBuffer *buffer |
442 CxBuffer *buffer |
443 ); |
443 ); |
444 |
444 |
445 /** |
445 /** |
|
446 * Appends data to a CxBuffer. |
|
447 * |
|
448 * The data is always appended to current data within the buffer, |
|
449 * regardless of the current position. |
|
450 * This is especially useful when the buffer is primarily meant for reading |
|
451 * while additional data is added to the buffer occasionally. |
|
452 * Consequently, the position of the buffer is unchanged after this operation. |
|
453 * |
|
454 * \note The signature is compatible with the fwrite() family of functions. |
|
455 * |
|
456 * @param ptr a pointer to the memory area containing the bytes to be written |
|
457 * @param size the length of one element |
|
458 * @param nitems the element count |
|
459 * @param buffer the CxBuffer to write to |
|
460 * @return the total count of elements written |
|
461 * @see cxBufferWrite() |
|
462 */ |
|
463 cx_attr_nonnull |
|
464 size_t cxBufferAppend( |
|
465 const void *ptr, |
|
466 size_t size, |
|
467 size_t nitems, |
|
468 CxBuffer *buffer |
|
469 ); |
|
470 |
|
471 /** |
446 * Reads data from a CxBuffer. |
472 * Reads data from a CxBuffer. |
447 * |
473 * |
448 * The position of the buffer is increased by the number of bytes read. |
474 * The position of the buffer is increased by the number of bytes read. |
449 * |
475 * |
450 * \note The signature is compatible with the fread() family of functions. |
476 * \note The signature is compatible with the fread() family of functions. |