SILC_STR_ADVANCE
NAME
#define SILC_STR_ADVANCE ...
DESCRIPTION
Advance the buffer to the end of the data after the formatting is
done. In normal operation when the formatted data is written the
buffer is located at the start of the data. With SILC_STR_ADVANCE
the buffer will be located at the end of the data. This makes it
easy to add new data immediately after the previously added data.
The SILC_STR_ADVANCE may also be used in unformatting.
EXAMPLE
do {
len = read(fd, buf, sizeof(buf));
if (len > 0)
// Add read data to the buffer
silc_buffer_format(buffer,
SILC_STR_ADVANCE,
SILC_STR_DATA(buf, len),
SILC_STR_END);
} while (len > 0);
// Move to beginning of buffer
silc_buffer_start(buffer);
|