GSeekable: improve g_seekable_[can_]truncate docs

I was not born next to a PDP-11, either, but I think this is marginally more informative!

https://bugzilla.gnome.org/show_bug.cgi?id=573251
This commit is contained in:
Will Thompson 2017-11-01 14:41:00 +00:00 committed by Philip Withnall
parent 663a5cc95f
commit 41112ef00d

View File

@ -141,7 +141,8 @@ g_seekable_seek (GSeekable *seekable,
* g_seekable_can_truncate:
* @seekable: a #GSeekable.
*
* Tests if the stream can be truncated.
* Tests if the length of the stream can be adjusted with
* g_seekable_truncate().
*
* Returns: %TRUE if the stream can be truncated, %FALSE otherwise.
**/
@ -160,12 +161,14 @@ g_seekable_can_truncate (GSeekable *seekable)
/**
* g_seekable_truncate:
* @seekable: a #GSeekable.
* @offset: a #goffset.
* @offset: new length for @seekable, in bytes.
* @cancellable: (nullable): optional #GCancellable object, %NULL to ignore.
* @error: a #GError location to store the error occurring, or %NULL to
* ignore.
*
* Truncates a stream with a given #offset.
* Sets the length of the stream to @offset. If the stream was previously
* larger than @offset, the extra data is discarded. If the stream was
* previouly shorter than @offset, it is extended with NUL ('\0') bytes.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
@ -173,7 +176,6 @@ g_seekable_can_truncate (GSeekable *seekable)
* operation was partially finished when the operation was cancelled the
* partial result will be returned, without an error.
*
* Virtual: truncate_fn
* Returns: %TRUE if successful. If an error
* has occurred, this function will return %FALSE and set @error
* appropriately if present.