src/cx/buffer.h

changeset 1575
dde0c67a449b
parent 1572
0499bf03aef3
equal deleted inserted replaced
1574:cfbf4a3a9c11 1575:dde0c67a449b
543 CX_EXPORT int cxBufferPut(CxBuffer *buffer, int c); 543 CX_EXPORT int cxBufferPut(CxBuffer *buffer, int c);
544 544
545 /** 545 /**
546 * Writes a terminating zero to a buffer at the current position. 546 * Writes a terminating zero to a buffer at the current position.
547 * 547 *
548 * If successful, sets the size to the current position and advances 548 * If successful, also sets the size to the current position and shrinks the buffer.
549 * the position by one.
550 * 549 *
551 * The purpose of this function is to have the written data ready to be used as 550 * The purpose of this function is to have the written data ready to be used as
552 * a C string with the buffer's size being the length of that string. 551 * a C string with the buffer's size being the length of that string.
553 * 552 *
554 * @param buffer the buffer to write to 553 * @param buffer the buffer to write to
555 * @return zero, if the terminator could be written, non-zero otherwise 554 * @return zero, if the terminator could be written, non-zero otherwise
555 * @see cxBufferShrink()
556 */ 556 */
557 cx_attr_nonnull 557 cx_attr_nonnull
558 CX_EXPORT int cxBufferTerminate(CxBuffer *buffer); 558 CX_EXPORT int cxBufferTerminate(CxBuffer *buffer);
559 559
560 /** 560 /**

mercurial