Fix up GIO docs

This commit is contained in:
Matthias Clasen
2009-11-29 22:54:16 -05:00
parent 80bda52b57
commit 8907bfee86
25 changed files with 258 additions and 156 deletions

View File

@@ -588,10 +588,6 @@ process_events (gpointer udata)
return FALSE;
}
/**
* _fdata_add_event:
*
*/
void
_fdata_add_event (fdata *f, fnode_event_t *ev)
{

View File

@@ -78,6 +78,7 @@ typedef struct _GAppLaunchContextPrivate GAppLaunchContextPrivate;
* @can_delete: Checks if a #GAppInfo can be deleted. Since 2.20
* @do_delete: Deletes a #GAppInfo. Since 2.20
* @get_commandline: Gets the commandline for the #GAppInfo. Since 2.20
* @get_display_name: Gets the display name for the #GAppInfo. Since 2.24
*
* Application Information interface, for operating system portability.
*/

View File

@@ -361,9 +361,18 @@ g_charset_converter_convert (GConverter *converter,
return ret;
}
/**
* g_charset_converter_set_use_fallback:
* @converter: a #GCharsetConverter
* @use_fallback: %TRUE to use fallbacks
*
* Sets the #GCharsetConverter:use-fallback property.
*
* Since: 2.24
*/
void
g_charset_converter_set_use_fallback (GCharsetConverter *converter,
gboolean use_fallback)
gboolean use_fallback)
{
use_fallback = !!use_fallback;
@@ -374,12 +383,32 @@ g_charset_converter_set_use_fallback (GCharsetConverter *converter,
}
}
/**
* g_charset_converter_get_use_fallback:
* @converter: a #GCharsetConverter
*
* Gets the #GCharsetConverter:use-fallback property.
*
* Returns: %TRUE if fallbacks are used by @converter
*
* Since: 2.24
*/
gboolean
g_charset_converter_get_use_fallback (GCharsetConverter *converter)
{
return converter->use_fallback;
}
/**
* g_charset_converter_get_num_fallbacks:
* @converter: a #GCharsetConverter
*
* Gets the number of fallbacks that @converter has applied so far.
*
* Returns: the number of fallbacks that @converter has applied
*
* Since: 2.24
*/
guint
g_charset_converter_get_num_fallbacks (GCharsetConverter *converter)
{

View File

@@ -187,7 +187,8 @@ g_converter_input_stream_init (GConverterInputStream *stream)
/**
* g_converter_input_stream_new:
* @base_stream: a #GInputStream.
* @base_stream: a #GInputStream
* @converter: a #GConverter
*
* Creates a new converter input stream for the @base_stream.
*
@@ -534,6 +535,16 @@ g_converter_input_stream_read (GInputStream *stream,
g_assert_not_reached ();
}
/**
* g_converter_input_stream_get_converter:
* @converter_stream: a #GConverterInputStream
*
* Gets the #GConverter that is used by @converter_stream.
*
* Returns: the converter of the converter input stream
*
* Since: 2.24
*/
GConverter *
g_converter_input_stream_get_converter (GConverterInputStream *converter_stream)
{

View File

@@ -41,7 +41,7 @@ G_BEGIN_DECLS
/**
* GConverterInputStream:
* @parent: a #GFilterInputStream.
* @parent_interface: a #GFilterInputStream.
*
* An implementation of #GFilterInputStream that allows data
* conversion.

View File

@@ -204,7 +204,8 @@ g_converter_output_stream_init (GConverterOutputStream *stream)
/**
* g_converter_output_stream_new:
* @base_stream: a #GOutputStream.
* @base_stream: a #GOutputStream
* @converter: a #GConverter
*
* Creates a new converter output stream for the @base_stream.
*
@@ -585,6 +586,16 @@ g_converter_output_stream_flush (GOutputStream *stream,
return TRUE;
}
/**
* g_converter_output_stream_get_converter:
* @converter_stream: a #GConverterOutputStream
*
* Gets the #GConverter that is used by @converter_stream.
*
* Returns: the converter of the converter output stream
*
* Since: 2.24
*/
GConverter *
g_converter_output_stream_get_converter (GConverterOutputStream *converter_stream)
{

View File

@@ -41,7 +41,7 @@ G_BEGIN_DECLS
/**
* GConverterOutputStream:
* @parent: a #GFilterOutputStream.
* @parent_instance: a #GFilterOutputStream.
*
* An implementation of #GFilterOutputStream that allows data
* conversion.

View File

@@ -105,12 +105,6 @@ g_dummy_file_init (GDummyFile *dummy)
{
}
/**
* g_dummy_file_new:
* @uri: Universal Resource Identifier for the dummy file object.
*
* Returns: a new #GFile.
**/
GFile *
_g_dummy_file_new (const char *uri)
{

View File

@@ -675,9 +675,9 @@ typedef enum {
/**
* GZlibCompressorFormat:
* @G_ZLIB_COMRESSOR_FORMAT_ZLIB: deflate compression with zlib header
* @G_ZLIB_COMRESSOR_FORMAT_GZIP: gzip file format
* @G_ZLIB_COMRESSOR_FORMAT_RAW: deflate compression with no header
* @G_ZLIB_COMPRESSOR_FORMAT_ZLIB: deflate compression with zlib header
* @G_ZLIB_COMPRESSOR_FORMAT_GZIP: gzip file format
* @G_ZLIB_COMPRESSOR_FORMAT_RAW: deflate compression with no header
*
* Used to select the type of data format to use for #GZlibDecompressor
* and #GZlibCompressor.

View File

@@ -266,13 +266,6 @@ get_default_local_directory_monitor (gpointer data)
return (gpointer)G_TYPE_INVALID;
}
/**
* _g_local_directory_monitor_new:
* @dirname: filename of the directory to monitor.
* @flags: #GFileMonitorFlags.
*
* Returns: new #GFileMonitor for the given @dirname.
**/
GFileMonitor*
_g_local_directory_monitor_new (const char *dirname,
GFileMonitorFlags flags,

View File

@@ -303,12 +303,6 @@ canonicalize_filename (const char *filename)
return canon;
}
/**
* _g_local_file_new:
* @filename: filename of the file to create.
*
* Returns: new local #GFile.
**/
GFile *
_g_local_file_new (const char *filename)
{

View File

@@ -118,12 +118,6 @@ g_local_file_input_stream_init (GLocalFileInputStream *info)
info->priv->do_close = TRUE;
}
/**
* g_local_file_input_stream_new:
* @fd: File Descriptor.
*
* Returns: #GFileInputStream for the given file descriptor.
**/
GFileInputStream *
_g_local_file_input_stream_new (int fd)
{

View File

@@ -169,13 +169,6 @@ get_default_local_file_monitor (gpointer data)
return (gpointer)G_TYPE_INVALID;
}
/**
* g_local_file_monitor_new:
* @pathname: path name to monitor.
* @flags: #GFileMonitorFlags.
*
* Returns: a new #GFileMonitor for the given @pathname.
**/
GFileMonitor*
_g_local_file_monitor_new (const char *pathname,
GFileMonitorFlags flags,

View File

@@ -580,15 +580,8 @@ g_volume_monitor_get (void)
return vm;
}
/**
* _g_mount_get_for_mount_path:
* @mountpoint: a string.
* @cancellable: a #GCancellable, or %NULL
*
* Returns: a #GMount for given @mount_path or %NULL.
**/
GMount *
_g_mount_get_for_mount_path (const char *mount_path,
_g_mount_get_for_mount_path (const gchar *mount_path,
GCancellable *cancellable)
{
GNativeVolumeMonitorClass *klass;

View File

@@ -104,13 +104,6 @@ g_unix_volume_init (GUnixVolume *unix_volume)
{
}
/**
* g_unix_volume_new:
* @volume_monitor: a #GVolumeMonitor.
* @mountpoint: a #GUnixMountPoint.
*
* Returns: a #GUnixVolume for the given #GUnixMountPoint.
**/
GUnixVolume *
_g_unix_volume_new (GVolumeMonitor *volume_monitor,
GUnixMountPoint *mountpoint)
@@ -156,11 +149,6 @@ _g_unix_volume_new (GVolumeMonitor *volume_monitor,
return volume;
}
/**
* g_unix_volume_disconnected:
* @volume:
*
**/
void
_g_unix_volume_disconnected (GUnixVolume *volume)
{
@@ -171,15 +159,9 @@ _g_unix_volume_disconnected (GUnixVolume *volume)
}
}
/**
* g_unix_volume_set_mount:
* @volume:
* @mount:
*
**/
void
_g_unix_volume_set_mount (GUnixVolume *volume,
GUnixMount *mount)
_g_unix_volume_set_mount (GUnixVolume *volume,
GUnixMount *mount)
{
if (volume->mount == mount)
return;
@@ -195,12 +177,6 @@ _g_unix_volume_set_mount (GUnixVolume *volume,
g_signal_emit_by_name (volume->volume_monitor, "volume-changed", volume);
}
/**
* g_unix_volume_unset_mount:
* @volume:
* @mount:
*
**/
void
_g_unix_volume_unset_mount (GUnixVolume *volume,
GUnixMount *mount)
@@ -252,7 +228,8 @@ static gboolean
g_unix_volume_should_automount (GVolume *volume)
{
/* We automount all local volumes because we don't even
make the internal stuff visible */
* make the internal stuff visible
*/
return TRUE;
}
@@ -276,7 +253,7 @@ g_unix_volume_get_mount (GVolume *volume)
gboolean
_g_unix_volume_has_mount_path (GUnixVolume *volume,
const char *mount_path)
const char *mount_path)
{
return strcmp (volume->mount_path, mount_path) == 0;
}
@@ -293,8 +270,10 @@ typedef struct {
GString *error_string;
} EjectMountOp;
static void
eject_mount_cb (GPid pid, gint status, gpointer user_data)
static void
eject_mount_cb (GPid pid,
gint status,
gpointer user_data)
{
EjectMountOp *data = user_data;
GSimpleAsyncResult *simple;
@@ -335,9 +314,9 @@ eject_mount_cb (GPid pid, gint status, gpointer user_data)
}
static gboolean
eject_mount_read_error (GIOChannel *channel,
GIOCondition condition,
gpointer user_data)
eject_mount_read_error (GIOChannel *channel,
GIOCondition condition,
gpointer user_data)
{
EjectMountOp *data = user_data;
char buf[BUFSIZ];
@@ -405,10 +384,11 @@ eject_mount_do (GVolume *volume,
NULL, /* standard_input */
NULL, /* standard_output */
&(data->error_fd),
&error)) {
g_assert (error != NULL);
goto handle_error;
}
&error))
{
g_assert (error != NULL);
goto handle_error;
}
data->error_string = g_string_new ("");
@@ -428,29 +408,30 @@ eject_mount_do (GVolume *volume,
g_source_unref (child_watch);
handle_error:
if (error != NULL) {
GSimpleAsyncResult *simple;
simple = g_simple_async_result_new_from_error (G_OBJECT (data->unix_volume),
data->callback,
data->user_data,
error);
g_simple_async_result_complete (simple);
g_object_unref (simple);
if (error != NULL)
{
GSimpleAsyncResult *simple;
simple = g_simple_async_result_new_from_error (G_OBJECT (data->unix_volume),
data->callback,
data->user_data,
error);
g_simple_async_result_complete (simple);
g_object_unref (simple);
if (data->error_string != NULL)
g_string_free (data->error_string, TRUE);
if (data->error_string != NULL)
g_string_free (data->error_string, TRUE);
if (data->error_channel != NULL)
g_io_channel_unref (data->error_channel);
if (data->error_channel != NULL)
g_io_channel_unref (data->error_channel);
g_error_free (error);
g_free (data);
}
g_error_free (error);
g_free (data);
}
}
static void
g_unix_volume_mount (GVolume *volume,
g_unix_volume_mount (GVolume *volume,
GMountMountFlags flags,
GMountOperation *mount_operation,
GCancellable *cancellable,
@@ -458,7 +439,7 @@ g_unix_volume_mount (GVolume *volume,
gpointer user_data)
{
GUnixVolume *unix_volume = G_UNIX_VOLUME (volume);
char *argv[] = {"mount", NULL, NULL};
char *argv[] = { "mount", NULL, NULL };
if (unix_volume->mount_path != NULL)
argv[1] = unix_volume->mount_path;
@@ -470,21 +451,21 @@ g_unix_volume_mount (GVolume *volume,
static gboolean
g_unix_volume_mount_finish (GVolume *volume,
GAsyncResult *result,
GError **error)
GAsyncResult *result,
GError **error)
{
return TRUE;
}
static void
g_unix_volume_eject (GVolume *volume,
g_unix_volume_eject (GVolume *volume,
GMountUnmountFlags flags,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
GUnixVolume *unix_volume = G_UNIX_VOLUME (volume);
char *argv[] = {"eject", NULL, NULL};
char *argv[] = { "eject", NULL, NULL };
argv[1] = unix_volume->device_path;
@@ -492,40 +473,41 @@ g_unix_volume_eject (GVolume *volume,
}
static gboolean
g_unix_volume_eject_finish (GVolume *volume,
g_unix_volume_eject_finish (GVolume *volume,
GAsyncResult *result,
GError **error)
{
return TRUE;
}
static char *
g_unix_volume_get_identifier (GVolume *volume,
const char *kind)
static gchar *
g_unix_volume_get_identifier (GVolume *volume,
const gchar *kind)
{
GUnixVolume *unix_volume = G_UNIX_VOLUME (volume);
if (unix_volume->identifier_type != NULL &&
strcmp (kind, unix_volume->identifier_type) == 0)
return g_strdup (unix_volume->identifier);
return NULL;
}
static char **
static gchar **
g_unix_volume_enumerate_identifiers (GVolume *volume)
{
GUnixVolume *unix_volume = G_UNIX_VOLUME (volume);
char **res;
gchar **res;
if (unix_volume->identifier_type)
{
res = g_new (char *, 2);
res = g_new (gchar *, 2);
res[0] = g_strdup (unix_volume->identifier_type);
res[1] = NULL;
}
else
{
res = g_new (char *, 1);
res = g_new (gchar *, 1);
res[0] = NULL;
}

View File

@@ -239,11 +239,6 @@ g_unix_volume_monitor_init (GUnixVolumeMonitor *unix_monitor)
update_mounts (unix_monitor);
}
/**
* g_unix_volume_monitor_new:
*
* Returns: a new #GVolumeMonitor.
**/
GVolumeMonitor *
_g_unix_volume_monitor_new (void)
{
@@ -298,13 +293,6 @@ diff_sorted_lists (GList *list1,
}
}
/**
* _g_unix_volume_monitor_lookup_volume_for_mount_path:
* @monitor:
* @mount_path:
*
* Returns: #GUnixVolume for the given @mount_path.
**/
GUnixVolume *
_g_unix_volume_monitor_lookup_volume_for_mount_path (GUnixVolumeMonitor *monitor,
const char *mount_path)

View File

@@ -117,7 +117,7 @@ _win32_get_displayname (const char *drive)
return name ? name : g_strdup (drive);
}
/**
/*
* _g_win32_mount_new:
* @volume_monitor: a #GVolumeMonitor.
* @path: a win32 path.

View File

@@ -64,9 +64,9 @@ g_win32_volume_monitor_finalize (GObject *object)
(*G_OBJECT_CLASS (g_win32_volume_monitor_parent_class)->finalize) (object);
}
/**
/*
* get_viewable_logical_drives:
*
*
* Returns the list of logical and viewable drives as defined by
* GetLogicalDrives() and the registry keys
* Software\Microsoft\Windows\CurrentVersion\Policies\Explorer under
@@ -74,7 +74,7 @@ g_win32_volume_monitor_finalize (GObject *object)
* GetLogicalDrives() is returned.
*
* Return value: bitmask with same meaning as returned by GetLogicalDrives()
**/
*/
static guint32
get_viewable_logical_drives (void)
{

View File

@@ -79,13 +79,13 @@ g_winhttp_file_init (GWinHttpFile *winhttp)
{
}
/**
/*
* _g_winhttp_file_new:
* @vfs: GWinHttpVfs to use
* @uri: URI of the GWinHttpFile to create.
*
* Returns: new winhttp #GFile.
**/
*/
GFile *
_g_winhttp_file_new (GWinHttpVfs *vfs,
const char *uri)

View File

@@ -96,14 +96,14 @@ g_winhttp_file_input_stream_init (GWinHttpFileInputStream *info)
{
}
/**
/*
* g_winhttp_file_input_stream_new:
* @file: the GWinHttpFile being read
* @connection: handle to the HTTP connection, as from WinHttpConnect()
* @request: handle to the HTTP request, as from WinHttpOpenRequest
*
* Returns: #GFileInputStream for the given request
**/
*/
GFileInputStream *
_g_winhttp_file_input_stream_new (GWinHttpFile *file,
HINTERNET connection,

View File

@@ -85,14 +85,14 @@ g_winhttp_file_output_stream_init (GWinHttpFileOutputStream *info)
{
}
/**
/*
* g_winhttp_file_output_stream_new:
* @file: the GWinHttpFile being read
* @connection: handle to the HTTP connection, as from WinHttpConnect()
* @request: handle to the HTTP request, as from WinHttpOpenRequest
*
* Returns: #GFileOutputStream for the given request
**/
*/
GFileOutputStream *
_g_winhttp_file_output_stream_new (GWinHttpFile *file,
HINTERNET connection)

View File

@@ -130,7 +130,7 @@ g_winhttp_vfs_init (GWinHttpVfs *vfs)
0);
}
/**
/*
* g_winhttp_vfs_new:
*
* Returns a new #GVfs handle for a WinHttp vfs.