xfree(buffer->buf);
}
-/* Clears any data from the buffer, making it empty. This does not actually
- zero the memory. */
+/*
+ * Clears any data from the buffer, making it empty. This does not actually
+ * zero the memory.
+ */
void
buffer_clear(Buffer *buffer)
memcpy(cp, data, len);
}
-/* Appends space to the buffer, expanding the buffer if necessary.
- This does not actually copy the data into the buffer, but instead
- returns a pointer to the allocated region. */
+/*
+ * Appends space to the buffer, expanding the buffer if necessary. This does
+ * not actually copy the data into the buffer, but instead returns a pointer
+ * to the allocated region.
+ */
void
buffer_append_space(Buffer *buffer, char **datap, unsigned int len)
buffer->end += len;
return;
}
- /* If the buffer is quite empty, but all data is at the end, move
- the data to the beginning and retry. */
+ /*
+ * If the buffer is quite empty, but all data is at the end, move the
+ * data to the beginning and retry.
+ */
if (buffer->offset > buffer->alloc / 2) {
memmove(buffer->buf, buffer->buf + buffer->offset,
buffer->end - buffer->offset);