Lines Matching defs:buffer
121 * \c fflush. If the underlying destination is a memory buffer, the write
122 * position is reset to the beginning of the buffer. \c =:-o
242 snd_output_buffer_t *buffer = output->private_data;
243 free(buffer->buf);
244 free(buffer);
250 snd_output_buffer_t *buffer = output->private_data;
251 size_t _free = buffer->alloc - buffer->size;
260 if (buffer->alloc == 0)
263 alloc = buffer->alloc;
264 while (alloc < buffer->size + size)
266 buf = realloc(buffer->buf, alloc);
269 buffer->buf = buf;
270 buffer->alloc = alloc;
271 return buffer->alloc - buffer->size;
276 snd_output_buffer_t *buffer = output->private_data;
282 result = vsnprintf((char *)buffer->buf + buffer->size, size, format, args);
285 buffer->size += result;
292 result = vsnprintf((char *)buffer->buf + buffer->size, result, format, args);
294 buffer->size += result;
300 snd_output_buffer_t *buffer = output->private_data;
306 memcpy(buffer->buf + buffer->size, str, size);
307 buffer->size += size;
313 snd_output_buffer_t *buffer = output->private_data;
318 buffer->buf[buffer->size++] = c;
324 snd_output_buffer_t *buffer = output->private_data;
325 buffer->size = 0;
339 * \brief Returns the address of the buffer of a #SND_OUTPUT_BUFFER output handle.
341 * \param buf The functions puts the current address of the buffer at the
343 * \return The current size of valid data in the buffer.
345 * The address of the buffer may become invalid when output functions or
350 snd_output_buffer_t *buffer = output->private_data;
351 *buf = (char *)buffer->buf;
352 return buffer->size;
356 * \brief Returns the address of the buffer of a #SND_OUTPUT_BUFFER output handle.
358 * \param buf The functions puts the current address of the buffer at the
360 * \return The current size of valid data in the buffer.
362 * The internal buffer is empty after this call. The caller has the responsibility
363 * to clean the buffer using the free() call.
367 snd_output_buffer_t *buffer = output->private_data;
369 *buf = (char *)buffer->buf;
370 size = buffer->size;
371 buffer->buf = NULL;
372 buffer->alloc = 0;
373 buffer->size = 0;
378 * \brief Creates a new output object with an auto-extending memory buffer.
386 snd_output_buffer_t *buffer;
388 buffer = calloc(1, sizeof(*buffer));
389 if (!buffer)
393 free(buffer);
396 buffer->buf = NULL;
397 buffer->alloc = 0;
398 buffer->size = 0;
401 output->private_data = buffer;