Commit 5247f12f authored by Andrew Walton's avatar Andrew Walton

Bumps documentation to 93% symbol coverage, touching most

	of the public files. Fixes broken function documentation prototypes. 
	Fixes GCancellable inaccuracies. Removes unnecessary incomplete 
	gtk-doc headers in private files.

svn path=/trunk/; revision=5953
parent 6d071b4a
2007-11-27 Andrew Walton <awalton@svn.gnome.org>
* gappinfo.c:
* gappinfo.h:
* gasynchelper.c:
* gasyncresult.c:
* gasyncresult.h:
* gbufferedinputstream.c:
* gbufferedinputstream.h:
* gbufferedoutputstream.c:
* gbufferedoutputstream.h:
* gcancellable.c:
* gcancellable.h:
* gcontenttype.c:
* gdatainputstream.c:
* gdatainputstream.h:
* gdataoutputstream.c:
* gdataoutputstream.h:
* gdirectorymonitor.c:
* gdirectorymonitor.h:
* gdrive.c:
* gdrive.h:
* gfile.c:
* gfile.h:
* gfileattribute.c:
* gfileattribute.h:
* gfileenumerator.c:
* gfileenumerator.h:
* gfileicon.c:
* gfileicon.h:
* gfileinfo.c:
* gfileinfo.h:
* gfileinputstream.c:
* gfileinputstream.h:
* gfilemonitor.c:
* gfilemonitor.h:
* gfilenamecompleter.c:
* gfilenamecompleter.h:
* gfileoutputstream.c:
* gfileoutputstream.h:
* gfilterinputstream.c:
* gfilterinputstream.h:
* gfilteroutputstream.c:
* gfilteroutputstream.h:
* gicon.c:
* gicon.h:
* ginputstream.c:
* ginputstream.h:
* gioerror.c:
* gioerror.h:
* giomodule.c:
* giomodule.h:
* gioscheduler.c:
* gioscheduler.h:
* gloadableicon.c:
* gloadableicon.h:
* glocalfileoutputstream.c:
* gmemoryinputstream.c:
* gmemoryinputstream.h:
* gmemoryoutputstream.c:
* gmemoryoutputstream.h:
* gmountoperation.c:
* gmountoperation.h:
* goutputstream.c:
* goutputstream.h:
* gpollfilemonitor.c:
* gseekable.c:
* gseekable.h:
* gsimpleasyncresult.c:
* gsimpleasyncresult.h:
* gsocketinputstream.c:
* gsocketinputstream.h:
* gsocketoutputstream.c:
* gsocketoutputstream.h:
* gthemedicon.c:
* gthemedicon.h:
* gunixdrive.c:
* gunixmounts.c:
* gunixmounts.h:
* gunixvolume.c:
* gunixvolumemonitor.c:
* gurifuncs.c:
* gurifuncs.h:
* gvfs.c:
* gvfs.h:
* gvolume.c:
* gvolume.h:
* gvolumemonitor.c:
* gvolumemonitor.h:
Bumps documentation to 93% symbol coverage, touching most
of the public files. Fixes broken function documentation prototypes.
Fixes GCancellable inaccuracies. Removes unnecessary incomplete
gtk-doc headers in private files.
2007-11-27 Jürg Billeter <j@bitron.ch>
* gbufferedinputstream.c: (g_buffered_input_stream_peek_buffer),
......
......@@ -25,6 +25,17 @@
#include "glibintl.h"
#include <gioerror.h>
/**
* SECTION:gappinfo
* @short_description: Application information and launch contexts.
* @stability: Unstable
*
* #GAppInfo and #GAppLaunchContext are used for describing and launching
* installed system applications.
*
* @Note: These may/will be moved to Gtk+ in the future.
*
**/
static void g_app_info_base_init (gpointer g_class);
static void g_app_info_class_init (gpointer g_class,
......@@ -76,6 +87,8 @@ g_app_info_base_init (gpointer g_class)
/**
* g_app_info_dup:
* @appinfo: a #GAppInfo.
*
* Creates a duplicate of a #GAppInfo.
*
* Returns: a duplicate of @appinfo.
**/
......@@ -95,9 +108,10 @@ g_app_info_dup (GAppInfo *appinfo)
* g_app_info_equal:
* @appinfo1: the first #GAppInfo.
* @appinfo2: the second #GAppInfo.
*
* Checks if two #GAppInfos are equal.
*
* Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
*
**/
gboolean
g_app_info_equal (GAppInfo *appinfo1,
......@@ -119,8 +133,10 @@ g_app_info_equal (GAppInfo *appinfo1,
/**
* g_app_info_get_id:
* @appinfo: a #GAppInfo.
*
* Gets the ID of an application.
*
* Returns:
* Returns: a string containing the application's ID.
**/
const char *
g_app_info_get_id (GAppInfo *appinfo)
......@@ -137,6 +153,8 @@ g_app_info_get_id (GAppInfo *appinfo)
/**
* g_app_info_get_name:
* @appinfo: a #GAppInfo.
*
* Gets the installed name of the application.
*
* Returns: the name of the application for @appinfo.
**/
......@@ -155,10 +173,12 @@ g_app_info_get_name (GAppInfo *appinfo)
/**
* g_app_info_get_description:
* @appinfo: a #GAppInfo.
*
* Gets a human-readable description of an installed application.
*
* Returns: a string containing a description of the
* application @appinfo.
* The returned string should be not freed when no longer needed.
* application @appinfo. The returned string should be not freed
* when no longer needed.
**/
const char *
g_app_info_get_description (GAppInfo *appinfo)
......@@ -175,6 +195,8 @@ g_app_info_get_description (GAppInfo *appinfo)
/**
* g_app_info_get_executable:
* @appinfo: a #GAppInfo.
*
* Gets the executable's name for the installed application.
*
* Returns: a string containing the @appinfo's application
* binary's name.
......@@ -197,6 +219,8 @@ g_app_info_get_executable (GAppInfo *appinfo)
* @appinfo: a #GAppInfo.
* @content_type: the content type.
* @error: a #GError.
*
* Sets an application as the default handler for a given type.
*
* Returns: %TRUE if the given @appinfo is the default
* for the given @content_type. %FALSE if not,
......@@ -223,6 +247,8 @@ g_app_info_set_as_default_for_type (GAppInfo *appinfo,
* @appinfo: a #GAppInfo.
* @extension: a string containing the file extension.
* @error: a #GError.
*
* Sets an application as the default handler for the given file extention.
*
* Returns: %TRUE if the given @appinfo is the default
* for the given @extension. %FALSE if not,
......@@ -253,6 +279,9 @@ g_app_info_set_as_default_for_extension (GAppInfo *appinfo,
* @appinfo: a #GAppInfo.
* @content_type: a string.
* @error: a #GError.
*
* Adds a content type to the application information to indicate the
* application is capable of opening files with the given content type.
*
* Returns: %TRUE if @appinfo supports @content_type.
* %FALSE if not, or in case of an error.
......@@ -280,6 +309,8 @@ g_app_info_add_supports_type (GAppInfo *appinfo,
/**
* g_app_info_can_remove_support_type:
* @appinfo: a #GAppInfo.
*
* Checks if a supported content type can be removed from an application.
*
* Returns: %TRUE if it is possible to remove supported
* content types from a given @appinfo, %FALSE if not.
......@@ -306,6 +337,8 @@ g_app_info_can_remove_supports_type (GAppInfo *appinfo)
* @content_type: a string.
* @error: a #GError.
*
* Removes a supported type from an application, if possible.
*
* Returns: %TRUE if @content_type support was removed
* from @appinfo. %FALSE if not.
**/
......@@ -332,6 +365,8 @@ g_app_info_remove_supports_type (GAppInfo *appinfo,
/**
* g_app_info_get_icon:
* @appinfo: a #GAppInfo.
*
* Gets the default icon for the application.
*
* Returns: the default #GIcon for @appinfo.
**/
......@@ -354,8 +389,12 @@ g_app_info_get_icon (GAppInfo *appinfo)
* @files: a #GList of #GFile objects.
* @launch_context: a #GAppLaunchContext.
* @error: a #GError.
*
* Launches the application. Passes @files to the launched application
* as arguments, and loads the @launch_context for managing the application
* once it has been launched. On error, @error will be set accordingly.
*
* Returns: %TRUE on successful launch.
* Returns: %TRUE on successful launch, %FALSE otherwise.
**/
gboolean
g_app_info_launch (GAppInfo *appinfo,
......@@ -376,6 +415,8 @@ g_app_info_launch (GAppInfo *appinfo,
/**
* g_app_info_supports_uris:
* @appinfo: a #GAppInfo.
*
* Checks if the application supports reading files and directories from URIs.
*
* Returns: %TRUE if the @appinfo supports URIs.
**/
......@@ -398,9 +439,12 @@ g_app_info_supports_uris (GAppInfo *appinfo)
* @uris: a #GList containing URIs to launch.
* @launch_context: a #GAppLaunchContext.
* @error: a #GError.
*
* Launches the application. Passes @uris to the launched application
* as arguments, and loads the @launch_context for managing the application
* once it has been launched. On error, @error will be set accordingly.
*
* Returns: %TRUE if the @appinfo was launched
* with the given @uris.
* Returns: %TRUE if the @appinfo was launched successfully, %FALSE otherwise.
**/
gboolean
g_app_info_launch_uris (GAppInfo *appinfo,
......@@ -423,8 +467,10 @@ g_app_info_launch_uris (GAppInfo *appinfo,
* @appinfo: a #GAppInfo.
* @desktop_env: a string.
*
* Returns: %TRUE if the @GAppInfo should be shown,
* %FALSE otherwise.
* Checks if the application info should be shown when listing
* applications available.
*
* Returns: %TRUE if the @appinfo should be shown, %FALSE otherwise.
**/
gboolean
g_app_info_should_show (GAppInfo *appinfo,
......@@ -443,8 +489,10 @@ G_DEFINE_TYPE (GAppLaunchContext, g_app_launch_context, G_TYPE_OBJECT);
/**
* g_app_launch_context_new:
*
* Creates a new application launch context.
*
* Returns: A new #GAppLaunchContext.
* Returns: a #GAppLaunchContext.
**/
GAppLaunchContext *
g_app_launch_context_new (void)
......@@ -468,6 +516,11 @@ g_app_launch_context_init (GAppLaunchContext *launch_context)
* @info: a #GAppInfo.
* @files: a #GList of files.
*
* Gets the DISPLAY for a launched application.
* TODO: can't find an implementation. DISPLAY as in X atom "DISPLAY"?
* Environmental variable "DISPLAY"?
*
* Returns: a display string.
**/
char *
g_app_launch_context_get_display (GAppLaunchContext *context,
......@@ -487,12 +540,18 @@ g_app_launch_context_get_display (GAppLaunchContext *context,
return class->get_display (context, info, files);
}
/* should this be moved to the g_desktop_app_ implementation? */
/**
* g_app_launch_context_get_startup_notify_id:
* @context: a #GAppLaunchContext.
* @info: a #GAppInfo.
* @files: a #GList of files.
*
* Gets the DESKTOP_STARTUP_ID for the launched application, if supported.
* Startup notification IDs are defined in the FreeDesktop.Org Startup Notifications standard,
* at <ulink url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt"/>.
*
* Returns: a startup notifaction ID for the application, or %NULL if not supported.
**/
char *
g_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
......@@ -514,10 +573,12 @@ g_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
/**
* g_app_launch_context_get_startup_notify_id:
* g_app_launch_context_launch_failed:
* @context: a #GAppLaunchContext.
* @startup_notify_id: a string containing the startup ID of the application.
* @startup_notify_id: a string containing the DESKTOP_STARTUP_ID of the launched application.
*
* TODO: what does this do? Can't find it implemented anywhere.
*
**/
void
g_app_launch_context_launch_failed (GAppLaunchContext *context,
......
......@@ -40,6 +40,13 @@ G_BEGIN_DECLS
#define G_IS_APP_LAUNCH_CONTEXT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_APP_LAUNCH_CONTEXT))
#define G_APP_LAUNCH_CONTEXT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_APP_LAUNCH_CONTEXT, GAppLaunchContextClass))
/**
* GAppInfoCreateFlags:
* @G_APP_INFO_CREATE_FLAGS_NONE: No flags.
* @G_APP_INFO_CREATE_NEEDS_TERMINAL: Application opens with a terminal window.
*
* Flags used when creating a #GAppInfo.
*/
typedef enum {
G_APP_INFO_CREATE_FLAGS_NONE = 0,
G_APP_INFO_CREATE_NEEDS_TERMINAL = (1<<0)
......@@ -49,7 +56,38 @@ typedef struct _GAppLaunchContext GAppLaunchContext;
typedef struct _GAppLaunchContextClass GAppLaunchContextClass;
typedef struct _GAppLaunchContextPrivate GAppLaunchContextPrivate;
/**
* GAppInfo:
*
* Information about an installed application.
*/
typedef struct _GAppInfo GAppInfo; /* Dummy typedef */
/**
* GAppInfoIface:
* @g_iface: The parent interface.
* @dup: Copies a #GAppInfo.
* @equal: Checks two #GAppInfo<!-- -->s for equality.
* @get_id: Gets a string identifier for a #GAppInfo.
* @get_name: Gets the name of the application for a #GAppInfo.
* @get_description: Gets a short description for the application described by the #GAppInfo.
* @get_executable: Gets the execuable name for the #GAppInfo.
* @get_icon: Gets the #GIcon for the #GAppInfo.
* @launch: Launches an application specified by the #GAppInfo.
* @supports_uris: Indicates whether the application specified supports launching URIs.
* @launch_uris: Launches an application with a list of URIs.
* @should_show: Returns whether an application should be shown (e.g. when getting a list of installed applications).
* @supports_xdg_startup_notify: Indicates whether the application supports the
* <ulink url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt">
* <citetitle>FreeDesktop.Org Startup Notification Specification</citetitle></ulink>.
* @set_as_default_for_type: Sets an application as default for a given content type.
* @set_as_default_for_extension: Sets an application as default for a given file extention.
* @add_supports_type: Adds to the #GAppInfo information about supported file types.
* @can_remove_supports_type: Checks for support for removing supported file types from a #GAppInfo.
* @remove_supports_type: Removes a supported application type from a #GAppInfo.
*
* Application Information interface, for operating system portability.
*/
typedef struct _GAppInfoIface GAppInfoIface;
struct _GAppInfoIface
......@@ -94,7 +132,7 @@ struct _GAppInfoIface
gboolean (*remove_supports_type) (GAppInfo *appinfo,
const char *content_type,
GError **error);
/*< private >*/
/* Padding for future expansion */
void (*_g_reserved1) (void);
void (*_g_reserved2) (void);
......@@ -162,11 +200,17 @@ GAppInfo *g_app_info_get_default_for_uri_scheme (const char *uri_scheme);
can_remove, remove (as in, don't support a specific mimetype)
*/
/**
* GAppLaunchContext:
* @parent_instance: The parent instance.
*
* Gets feedback from the system when launching an application.
*/
struct _GAppLaunchContext
{
GObject parent_instance;
/*< private >*/
GAppLaunchContextPrivate *priv;
};
......
......@@ -24,6 +24,15 @@
#include "gasynchelper.h"
/**
* SECTION:gasynchelper
* @short_description: Asynchronous Helper Functions
* @see_also: #GAsyncReady.
*
* Provides helper functions for asynchronous operations.
*
**/
static void
async_result_free (gpointer data)
{
......
......@@ -24,6 +24,65 @@
#include "gasyncresult.h"
#include "glibintl.h"
/**
* SECTION:gasyncresult
* @short_description: Asynchronous Function Results
* @see_also: #GSimpleAsyncResult
*
* Provides a base class for implementing asynchronous function results.
*
* Asynchronous operations are broken up into two separate operations
* which are chained together by a #GAsyncReadyCallback. To begin
* an asynchronous operation, provide a #GAsyncReadyCallback to the asynchronous
* function. This callback will be triggered when the operation has completed,
* and will be passed a #GAsyncReady instance filled with the details of the operation's
* success or failure, the object the asynchronous function was
* started for and any error codes returned. The asynchronous callback function
* is then expected to call the corresponding "_finish()" operation with the
* object the function was called for, and the #GAsyncReady instance, and optionally,
* an @error to grab any error conditions that may have occurred.
*
* Example of a typical asynchronous operation flow:
* <informalexample>
* <programlisting>
* void _theoretical_frobnitz_async (Theoretical *t,
* GCancellable *c,
* GAsyncReadyCallback *cb,
* gpointer u);
*
* gboolean _theoretical_frobnitz_finish (Theoretical *t,
* GAsyncResult *res,
* GError **e);
*
* static void
* frobnitz_result_func (GObject *source_object,
* GAsyncResult *res,
* gpointer user_data)
* {
* gboolean success = FALSE;
* success = _theoretical_frobnitz_finish( source_object, res, NULL );
* if (success)
* g_printf("Hurray!/n");
* else
* g_printf("Uh oh!/n");
* /<!-- -->* ... *<!-- -->/
* g_free(res);
* }
*
* int main (int argc, void *argv[])
* {
* /<!-- -->* ... *<!-- -->/
* _theoretical_frobnitz_async (theoretical_data, NULL, frobnitz_result_func, NULL);
*
* /<!-- -->* ... *<!-- -->/
* </programlisting>
* </informalexample>
*
* Asynchronous jobs are threaded if #GThread is available, but also may
* be sent to the Main Event Loop and processed in an idle function.
*
**/
static void g_async_result_base_init (gpointer g_class);
static void g_async_result_class_init (gpointer g_class,
gpointer class_data);
......@@ -73,8 +132,9 @@ g_async_result_base_init (gpointer g_class)
* g_async_result_get_user_data:
* @res: a #GAsyncResult.
*
* Returns: the user data for the given @res, or
* %NULL on failure.
* Gets the user data from a #GAsyncResult.
*
* Returns: the user data for @res.
**/
gpointer
g_async_result_get_user_data (GAsyncResult *res)
......@@ -92,6 +152,8 @@ g_async_result_get_user_data (GAsyncResult *res)
* g_async_result_get_source_object:
* @res: a #GAsyncResult.
*
* Gets the source object from a #GAsyncResult.
*
* Returns: the source object for the @res.
**/
GObject *
......
......@@ -32,13 +32,36 @@ G_BEGIN_DECLS
#define G_IS_ASYNC_RESULT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_TYPE_ASYNC_RESULT))
#define G_ASYNC_RESULT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), G_TYPE_ASYNC_RESULT, GAsyncResultIface))
/**
* GAsyncResult:
*
* Holds results information for an asynchronous operation,
* usually passed directly to a asynchronous _finish() operation.
**/
typedef struct _GAsyncResult GAsyncResult; /* Dummy typedef */
typedef struct _GAsyncResultIface GAsyncResultIface;
/**
* GAsyncReadyCallback:
* @source_object: the object the asynchronous operation was started with.
* @res: a #GAsyncResult.
* @user_data: user data passed to the callback.
*
* Type definition for a function that will be called back when an asynchronous
* operation within GIO has been completed.
**/
typedef void (*GAsyncReadyCallback) (GObject *source_object,
GAsyncResult *res,
gpointer user_data);
/**
* GAsyncResultIface:
* @g_iface: The parent interface.
* @get_user_data: Gets the user data passed to the callback.
* @get_source_object: Gets the source object that issued the asynchronous operation.
*
* Interface definition for #GAsyncResult.
**/
struct _GAsyncResultIface
{
GTypeInterface g_iface;
......
......@@ -22,14 +22,35 @@
*/
#include <config.h>
#include "gbufferedinputstream.h"
#include "ginputstream.h"
#include "gsimpleasyncresult.h"
#include <string.h>
#include "glibintl.h"
/**
* SECTION:gbufferedinputstream
* @short_description: Buffered Input Stream
* @see_also: #GFilterInputStream, #GInputStream.
*
* Buffered input stream implements #GFilterInputStream and provides
* for buffered reads.
*
* By default, #GBufferedInputStream's buffer size is set at 4 kilobytes.
*
* To create a buffered input stream, use g_buffered_input_stream_new(), or
* g_buffered_input_stream_new_sized() to specify the buffer's size at construction.
*
* To get the size of a buffer within a buffered input stream, use
* g_buffered_input_stream_get_buffer_size(). To change the size of a
* buffered input stream's buffer, use g_buffered_input_stream_set_buffer_size().
* Note: the buffer's size cannot be reduced below the size of the data within the
* buffer.
*
**/
#define DEFAULT_BUFFER_SIZE 4096
struct _GBufferedInputStreamPrivate {
......@@ -151,7 +172,9 @@ g_buffered_input_stream_class_init (GBufferedInputStreamClass *klass)
* g_buffered_input_stream_get_buffer_size:
* @stream: #GBufferedInputStream.
*
* Returns: the current buffer size, or -1 on error.
* Gets the size of the input buffer.
*
* Returns: the current buffer size, or %-1 on error.
**/
gsize
g_buffered_input_stream_get_buffer_size (GBufferedInputStream *stream)
......@@ -496,14 +519,14 @@ g_buffered_input_stream_fill_async (GBufferedInputStream *stream,
}
/**
* g_buffered_input_stream_fill_finished:
* g_buffered_input_stream_fill_finish:
* @stream: a #GBufferedInputStream.
* @result: a #GAsyncResult.
* @error: a #GError.
*
* Finishes an asynchronous read.
*
* Returns: a #gssize of the read stream, or -1 on an error.
* Returns: a #gssize of the read stream, or %-1 on an error.
**/
gssize
g_buffered_input_stream_fill_finish (GBufferedInputStream *stream,
......@@ -535,6 +558,8 @@ g_buffered_input_stream_fill_finish (GBufferedInputStream *stream,
* g_buffered_input_stream_get_available:
* @stream: #GBufferedInputStream.
*
* Gets the size of the available data within the stream.
*
* Returns: size of the available stream.
**/
gsize
......@@ -552,7 +577,10 @@ g_buffered_input_stream_get_available (GBufferedInputStream *stream)
* @offset: a #gsize.
* @count: a #gsize.
*
* Returns:
* Peeks in the buffer, copying data of size @count into @buffer, offset
* @offset bytes.
*
* Returns: a #gsize of the number of bytes peeked, or %-1 on error.
**/
gsize
g_buffered_input_stream_peek (GBufferedInputStream *stream,
......
......@@ -35,6 +35,11 @@ G_BEGIN_DECLS
#define G_IS_BUFFERED_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_BUFFERED_INPUT_STREAM))
#define G_BUFFERED_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_BUFFERED_INPUT_STREAM, GBufferedInputStreamClass))
/**
* GBufferedInputStream:
*
* Implements #GFilterInputStream with a sized input buffer.
**/
typedef struct _GBufferedInputStream GBufferedInputStream;
typedef struct _GBufferedInputStreamClass GBufferedInputStreamClass;
typedef struct _GBufferedInputStreamPrivate GBufferedInputStreamPrivate;
......@@ -67,6 +72,7 @@ struct _GBufferedInputStreamClass
GAsyncResult *result,
GError **error);
/*< private >*/
/* Padding for future expansion */
void (*_g_reserved1) (void);
void (*_g_reserved2) (void);
......
......@@ -21,14 +21,35 @@
*/
#include <config.h>
#include "gbufferedoutputstream.h"
#include "goutputstream.h"
#include "gsimpleasyncresult.h"
#include "string.h"
#include "glibintl.h"
/**
* SECTION:gbufferedoutputstream
* @short_description: Buffered Output Stream
* @see_also: #GFilterOutputStream, #GOutputStream.
*
* Buffered output stream implements #GFilterOutputStream and provides
* for buffered writes.
*
* By default, #GBufferedOutputStream's buffer size is set at 4 kilobytes.
*
* To create a buffered output stream, use g_buffered_output_stream_new(), or
* g_buffered_output_stream_new_sized() to specify the buffer's size at construction.
*
* To get the size of a buffer within a buffered input stream, use
* g_buffered_output_stream_get_buffer_size(). To change the size of a
* buffered output stream's buffer, use g_buffered_output_stream_set_buffer_size().
* Note: the buffer's size cannot be reduced below the size of the data within the
* buffer.
*
**/
#define DEFAULT_BUFFER_SIZE 4096
struct _GBufferedOutputStreamPrivate {
......@@ -140,6 +161,8 @@ g_buffered_output_stream_class_init (GBufferedOutputStreamClass *klass)
* g_buffered_output_stream_get_buffer_size:
* @stream: a #GBufferedOutputStream.
*
* Gets the size of the buffer in the @stream.
*
* Returns: the current size of the buffer.
**/
gsize
......@@ -156,7 +179,6 @@ g_buffered_output_stream_get_buffer_size (GBufferedOutputStream *stream)
* @size: a #gsize.
*
* Sets the size of the internal buffer to @size.
*
**/
void
g_buffered_output_stream_set_buffer_size (GBufferedOutputStream *stream,
......@@ -192,6 +214,8 @@ g_buffered_output_stream_set_buffer_size (GBufferedOutputStream *stream,
* g_buffered_output_stream_get_auto_grow:
* @stream: a #GBufferedOutputStream.
*
* Checks if the buffer automatically grows as data is added.
*
* Returns: %TRUE if the @stream's buffer automatically grows,
* %FALSE otherwise.
**/
......@@ -206,10 +230,9 @@ g_buffered_output_stream_get_auto_grow (GBufferedOutputStream *stream)
/**
* g_buffered_output_stream_set_auto_grow:
* @stream: a #GBufferedOutputStream.
* @auto_grow: a boolean.
* @auto_grow: a #gboolean.
*
* Sets whether or not the @stream's buffer should automatically grow.
*
**/
void
g_buffered_output_stream_set_auto_grow (GBufferedOutputStream *stream,
......@@ -300,6 +323,8 @@ g_buffered_output_stream_init (GBufferedOutputStream *stream)
* g_buffered_output_stream_new:
* @base_stream: a #GOutputStream.
*
* Creates a new buffered output stream for a base stream.
*
* Returns: a #GOutputStream for the given @base_stream.
**/
GOutputStream *
......@@ -321,6 +346,8 @@ g_buffered_output_stream_new (GOutputStream *base_stream)
* @base_stream: a #GOutputStream.
* @size: a #gsize.
*
* Creates a new buffered output stream with a given buffer size.
*
* Returns: a #GOutputStream with an internal buffer set to @size.
**/
GOutputStream *
......
......@@ -35,6 +35,12 @@ G_BEGIN_DECLS
#define G_IS_BUFFERED_OUTPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_BUFFERED_OUTPUT_STREAM))
#define G_BUFFERED_OUTPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_BUFFERED_OUTPUT_STREAM, GBufferedOutputStreamClass))