static cairo_status_t cairo_truetype_font_allocate_write_buffer (cairo_truetype_font_t *font, size_t length, unsigned char **buffer) { cairo_status_t status; status = _cairo_array_allocate (&font->output, length, (void **) buffer); if (status) return status; return CAIRO_STATUS_SUCCESS; }
/** * _cairo_array_append_multiple: * @array: a #cairo_array_t * * Append one or more items onto the array by growing the array by * @num_elements, then copying @num_elements * element_size bytes from * @elements into the array. * * Return value: %CAIRO_STATUS_SUCCESS if successful or * %CAIRO_STATUS_NO_MEMORY if insufficient memory is available for the * operation. **/ cairo_status_t _cairo_array_append_multiple (cairo_array_t *array, const void *elements, unsigned int num_elements) { cairo_status_t status; void *dest; status = _cairo_array_allocate (array, num_elements, &dest); if (unlikely (status)) return status; memcpy (dest, elements, num_elements * array->element_size); return CAIRO_STATUS_SUCCESS; }
/** * _cairo_array_append: * * Append one or more items onto the array by growing the array by * @num_elements, then copying @num_elements * element_size bytes from * @elements into the array. * * Return value: %CAIRO_STATUS_SUCCESS if successful or * %CAIRO_STATUS_NO_MEMORY if insufficient memory is available for the * operation. **/ cairo_status_t _cairo_array_append_multiple (cairo_array_t *array, const void *elements, int num_elements) { cairo_status_t status; void *dest; assert (! array->is_snapshot); status = _cairo_array_allocate (array, num_elements, &dest); if (status) return status; memcpy (dest, elements, num_elements * array->element_size); return CAIRO_STATUS_SUCCESS; }