Merge branch 'port-gbufferedinputstream.c-comments' into 'main'

gbufferedinputstream: Port all doc comments to gi-docgen

See merge request GNOME/glib!4146
This commit is contained in:
Philip Withnall 2024-07-09 19:36:55 +00:00
commit ef57fa8a29

View File

@ -36,7 +36,7 @@
/** /**
* GBufferedInputStream: * GBufferedInputStream:
* *
* Buffered input stream implements #GFilterInputStream and provides * Buffered input stream implements [class@Gio.FilterInputStream] and provides
* for buffered reads. * for buffered reads.
* *
* By default, `GBufferedInputStream`'s buffer size is set at 4 kilobytes. * By default, `GBufferedInputStream`'s buffer size is set at 4 kilobytes.
@ -176,7 +176,7 @@ g_buffered_input_stream_class_init (GBufferedInputStreamClass *klass)
/** /**
* g_buffered_input_stream_get_buffer_size: * g_buffered_input_stream_get_buffer_size:
* @stream: a #GBufferedInputStream * @stream: a [class@Gio.BufferedInputStream]
* *
* Gets the size of the input buffer. * Gets the size of the input buffer.
* *
@ -192,7 +192,7 @@ g_buffered_input_stream_get_buffer_size (GBufferedInputStream *stream)
/** /**
* g_buffered_input_stream_set_buffer_size: * g_buffered_input_stream_set_buffer_size:
* @stream: a #GBufferedInputStream * @stream: a [class@Gio.BufferedInputStream]
* @size: a #gsize * @size: a #gsize
* *
* Sets the size of the internal buffer of @stream to @size, or to the * Sets the size of the internal buffer of @stream to @size, or to the
@ -319,12 +319,12 @@ g_buffered_input_stream_init (GBufferedInputStream *stream)
/** /**
* g_buffered_input_stream_new: * g_buffered_input_stream_new:
* @base_stream: a #GInputStream * @base_stream: a [class@Gio.InputStream]
* *
* Creates a new #GInputStream from the given @base_stream, with * Creates a new [class@Gio.InputStream] from the given @base_stream, with
* a buffer set to the default size (4 kilobytes). * a buffer set to the default size (4 kilobytes).
* *
* Returns: a #GInputStream for the given @base_stream. * Returns: a [class@Gio.InputStream] for the given @base_stream.
*/ */
GInputStream * GInputStream *
g_buffered_input_stream_new (GInputStream *base_stream) g_buffered_input_stream_new (GInputStream *base_stream)
@ -342,13 +342,13 @@ g_buffered_input_stream_new (GInputStream *base_stream)
/** /**
* g_buffered_input_stream_new_sized: * g_buffered_input_stream_new_sized:
* @base_stream: a #GInputStream * @base_stream: a [class@Gio.InputStream]
* @size: a #gsize * @size: a #gsize
* *
* Creates a new #GBufferedInputStream from the given @base_stream, * Creates a new [class@Gio.BufferedInputStream] from the given @base_stream,
* with a buffer set to @size. * with a buffer set to @size.
* *
* Returns: a #GInputStream. * Returns: a [class@Gio.InputStream].
*/ */
GInputStream * GInputStream *
g_buffered_input_stream_new_sized (GInputStream *base_stream, g_buffered_input_stream_new_sized (GInputStream *base_stream,
@ -368,16 +368,17 @@ g_buffered_input_stream_new_sized (GInputStream *base_stream,
/** /**
* g_buffered_input_stream_fill: * g_buffered_input_stream_fill:
* @stream: a #GBufferedInputStream * @stream: a [class@Gio.BufferedInputStream]
* @count: the number of bytes that will be read from the stream * @count: the number of bytes that will be read from the stream
* @cancellable: (nullable): optional #GCancellable object, %NULL to ignore * @cancellable: (nullable): optional [class@Gio.Cancellable] object, `NULL` to ignore
* @error: location to store the error occurring, or %NULL to ignore * @error: location to store the error occurring, or `NULL` to ignore
* *
* Tries to read @count bytes from the stream into the buffer. * Tries to read @count bytes from the stream into the buffer.
* Will block during this read. * Will block during this read.
* *
* If @count is zero, returns zero and does nothing. A value of @count * If @count is zero, returns zero and does nothing. A value of @count
* larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error. * larger than `G_MAXSSIZE` will cause a
* [error@Gio.IOErrorEnum.INVALID_ARGUMENT] error.
* *
* On success, the number of bytes read into the buffer is returned. * On success, the number of bytes read into the buffer is returned.
* It is not an error if this is not the same as the requested size, as it * It is not an error if this is not the same as the requested size, as it
@ -387,19 +388,19 @@ g_buffered_input_stream_new_sized (GInputStream *base_stream,
* If @count is -1 then the attempted read size is equal to the number of * If @count is -1 then the attempted read size is equal to the number of
* bytes that are required to fill the buffer. * bytes that are required to fill the buffer.
* *
* If @cancellable is not %NULL, then the operation can be cancelled by * If @cancellable is not `NULL`, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation * triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an * was cancelled, the error [error@Gio.IOErrorEnum.CANCELLED] will be returned.
* operation was partially finished when the operation was cancelled the * If an operation was partially finished when the operation was cancelled the
* partial result will be returned, without an error. * partial result will be returned, without an error.
* *
* On error -1 is returned and @error is set accordingly. * On error `-1` is returned and @error is set accordingly.
* *
* For the asynchronous, non-blocking, version of this function, see * For the asynchronous, non-blocking, version of this function, see
* g_buffered_input_stream_fill_async(). * [method@Gio.BufferedInputStream.fill_async].
* *
* Returns: the number of bytes read into @stream's buffer, up to @count, * Returns: the number of bytes read into @stream's buffer, up to @count,
* or -1 on error. * or `-1` on error.
*/ */
gssize gssize
g_buffered_input_stream_fill (GBufferedInputStream *stream, g_buffered_input_stream_fill (GBufferedInputStream *stream,
@ -453,18 +454,18 @@ async_fill_callback_wrapper (GObject *source_object,
/** /**
* g_buffered_input_stream_fill_async: * g_buffered_input_stream_fill_async:
* @stream: a #GBufferedInputStream * @stream: a [class@Gio.BufferedInputStream]
* @count: the number of bytes that will be read from the stream * @count: the number of bytes that will be read from the stream
* @io_priority: the [I/O priority](iface.AsyncResult.html#io-priority) of the request * @io_priority: the [I/O priority](iface.AsyncResult.html#io-priority) of the request
* @cancellable: (nullable): optional #GCancellable object * @cancellable: (nullable): optional [class@Gio.Cancellable] object
* @callback: (scope async) (closure user_data): a #GAsyncReadyCallback * @callback: (scope async) (closure user_data): a [callback@Gio.AsyncReadyCallback]
* @user_data: a #gpointer * @user_data: a #gpointer
* *
* Reads data into @stream's buffer asynchronously, up to @count size. * Reads data into @stream's buffer asynchronously, up to @count size.
* @io_priority can be used to prioritize reads. For the synchronous * @io_priority can be used to prioritize reads. For the synchronous
* version of this function, see g_buffered_input_stream_fill(). * version of this function, see [method@Gio.BufferedInputStream.fill].
* *
* If @count is -1 then the attempted read size is equal to the number * If @count is `-1` then the attempted read size is equal to the number
* of bytes that are required to fill the buffer. * of bytes that are required to fill the buffer.
*/ */
void void
@ -519,9 +520,9 @@ g_buffered_input_stream_fill_async (GBufferedInputStream *stream,
/** /**
* g_buffered_input_stream_fill_finish: * g_buffered_input_stream_fill_finish:
* @stream: a #GBufferedInputStream * @stream: a [class@Gio.BufferedInputStream]
* @result: a #GAsyncResult * @result: a [iface@Gio.AsyncResult]
* @error: a #GError * @error: a [type@GLib.Error]
* *
* Finishes an asynchronous read. * Finishes an asynchronous read.
* *
@ -548,7 +549,7 @@ g_buffered_input_stream_fill_finish (GBufferedInputStream *stream,
/** /**
* g_buffered_input_stream_get_available: * g_buffered_input_stream_get_available:
* @stream: #GBufferedInputStream * @stream: [class@Gio.BufferedInputStream]
* *
* Gets the size of the available data within the stream. * Gets the size of the available data within the stream.
* *
@ -564,7 +565,7 @@ g_buffered_input_stream_get_available (GBufferedInputStream *stream)
/** /**
* g_buffered_input_stream_peek: * g_buffered_input_stream_peek:
* @stream: a #GBufferedInputStream * @stream: a [class@Gio.BufferedInputStream]
* @buffer: (array length=count) (element-type guint8): a pointer to * @buffer: (array length=count) (element-type guint8): a pointer to
* an allocated chunk of memory * an allocated chunk of memory
* @offset: a #gsize * @offset: a #gsize
@ -573,7 +574,7 @@ g_buffered_input_stream_get_available (GBufferedInputStream *stream)
* Peeks in the buffer, copying data of size @count into @buffer, * Peeks in the buffer, copying data of size @count into @buffer,
* offset @offset bytes. * offset @offset bytes.
* *
* Returns: a #gsize of the number of bytes peeked, or -1 on error. * Returns: a #gsize of the number of bytes peeked, or `-1` on error.
*/ */
gsize gsize
g_buffered_input_stream_peek (GBufferedInputStream *stream, g_buffered_input_stream_peek (GBufferedInputStream *stream,
@ -601,7 +602,7 @@ g_buffered_input_stream_peek (GBufferedInputStream *stream,
/** /**
* g_buffered_input_stream_peek_buffer: * g_buffered_input_stream_peek_buffer:
* @stream: a #GBufferedInputStream * @stream: a [class@Gio.BufferedInputStream]
* @count: (out): a #gsize to get the number of bytes available in the buffer * @count: (out): a #gsize to get the number of bytes available in the buffer
* *
* Returns the buffer with the currently available bytes. The returned * Returns the buffer with the currently available bytes. The returned
@ -942,25 +943,25 @@ g_buffered_input_stream_truncate (GSeekable *seekable,
/** /**
* g_buffered_input_stream_read_byte: * g_buffered_input_stream_read_byte:
* @stream: a #GBufferedInputStream * @stream: a [class@Gio.BufferedInputStream]
* @cancellable: (nullable): optional #GCancellable object, %NULL to ignore * @cancellable: (nullable): optional [class@Gio.Cancellable] object, `NULL` to ignore
* @error: location to store the error occurring, or %NULL to ignore * @error: location to store the error occurring, or `NULL` to ignore
* *
* Tries to read a single byte from the stream or the buffer. Will block * Tries to read a single byte from the stream or the buffer. Will block
* during this read. * during this read.
* *
* On success, the byte read from the stream is returned. On end of stream * On success, the byte read from the stream is returned. On end of stream
* -1 is returned but it's not an exceptional error and @error is not set. * `-1` is returned but it's not an exceptional error and @error is not set.
* *
* If @cancellable is not %NULL, then the operation can be cancelled by * If @cancellable is not `NULL`, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation * triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an * was cancelled, the error [error@Gio.IOErrorEnum.CANCELLED] will be returned.
* operation was partially finished when the operation was cancelled the * If an operation was partially finished when the operation was cancelled the
* partial result will be returned, without an error. * partial result will be returned, without an error.
* *
* On error -1 is returned and @error is set accordingly. * On error `-1` is returned and @error is set accordingly.
* *
* Returns: the byte read from the @stream, or -1 on end of stream or error. * Returns: the byte read from the @stream, or `-1` on end of stream or error.
*/ */
int int
g_buffered_input_stream_read_byte (GBufferedInputStream *stream, g_buffered_input_stream_read_byte (GBufferedInputStream *stream,