2008-07-01 08:32:35 +02:00
|
|
|
/* GIO - GLib Input, Output and Streaming Library
|
2008-09-02 21:05:58 +02:00
|
|
|
*
|
2008-07-01 08:32:35 +02:00
|
|
|
* Copyright (C) 2006-2007 Red Hat, Inc.
|
|
|
|
*
|
2022-05-18 10:12:45 +02:00
|
|
|
* SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
*
|
2008-07-01 08:32:35 +02:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2017-05-27 18:21:30 +02:00
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2008-07-01 08:32:35 +02:00
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General
|
2014-01-23 12:58:29 +01:00
|
|
|
* Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
2008-07-01 08:32:35 +02:00
|
|
|
*
|
|
|
|
* Author: Alexander Larsson <alexl@redhat.com>
|
|
|
|
*/
|
|
|
|
|
2012-12-28 05:43:14 +01:00
|
|
|
#ifndef __GIO_TYPES_H__
|
|
|
|
#define __GIO_TYPES_H__
|
|
|
|
|
2008-07-01 08:32:35 +02:00
|
|
|
#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
|
|
|
|
#error "Only <gio/gio.h> can be included directly."
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <gio/gioenums.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
typedef struct _GAppLaunchContext GAppLaunchContext;
|
|
|
|
typedef struct _GAppInfo GAppInfo; /* Dummy typedef */
|
|
|
|
typedef struct _GAsyncResult GAsyncResult; /* Dummy typedef */
|
2009-05-14 15:26:37 +02:00
|
|
|
typedef struct _GAsyncInitable GAsyncInitable;
|
2008-07-01 08:32:35 +02:00
|
|
|
typedef struct _GBufferedInputStream GBufferedInputStream;
|
|
|
|
typedef struct _GBufferedOutputStream GBufferedOutputStream;
|
|
|
|
typedef struct _GCancellable GCancellable;
|
2009-10-21 21:25:36 +02:00
|
|
|
typedef struct _GCharsetConverter GCharsetConverter;
|
2009-11-18 13:14:13 +01:00
|
|
|
typedef struct _GConverter GConverter;
|
2009-10-22 22:50:52 +02:00
|
|
|
typedef struct _GConverterInputStream GConverterInputStream;
|
2009-11-23 15:03:57 +01:00
|
|
|
typedef struct _GConverterOutputStream GConverterOutputStream;
|
2015-06-12 09:50:42 +02:00
|
|
|
typedef struct _GDatagramBased GDatagramBased;
|
2008-07-01 08:32:35 +02:00
|
|
|
typedef struct _GDataInputStream GDataInputStream;
|
2010-06-04 22:32:01 +02:00
|
|
|
typedef struct _GSimplePermission GSimplePermission;
|
2009-11-20 12:04:31 +01:00
|
|
|
typedef struct _GZlibCompressor GZlibCompressor;
|
2009-11-19 17:20:20 +01:00
|
|
|
typedef struct _GZlibDecompressor GZlibDecompressor;
|
2008-07-01 08:32:35 +02:00
|
|
|
|
2010-08-18 08:15:09 +02:00
|
|
|
typedef struct _GSimpleActionGroup GSimpleActionGroup;
|
2011-12-17 06:17:08 +01:00
|
|
|
typedef struct _GRemoteActionGroup GRemoteActionGroup;
|
2011-07-01 03:41:30 +02:00
|
|
|
typedef struct _GDBusActionGroup GDBusActionGroup;
|
2011-11-30 17:36:08 +01:00
|
|
|
typedef struct _GActionMap GActionMap;
|
2010-08-18 06:30:44 +02:00
|
|
|
typedef struct _GActionGroup GActionGroup;
|
2013-06-28 17:41:43 +02:00
|
|
|
typedef struct _GPropertyAction GPropertyAction;
|
2010-08-30 18:58:49 +02:00
|
|
|
typedef struct _GSimpleAction GSimpleAction;
|
2010-08-18 07:45:15 +02:00
|
|
|
typedef struct _GAction GAction;
|
2010-10-06 19:08:26 +02:00
|
|
|
typedef struct _GApplication GApplication;
|
|
|
|
typedef struct _GApplicationCommandLine GApplicationCommandLine;
|
2010-06-17 00:49:20 +02:00
|
|
|
typedef struct _GSettingsBackend GSettingsBackend;
|
|
|
|
typedef struct _GSettings GSettings;
|
|
|
|
typedef struct _GPermission GPermission;
|
|
|
|
|
2011-11-27 04:46:51 +01:00
|
|
|
typedef struct _GMenuModel GMenuModel;
|
2013-10-15 17:21:10 +02:00
|
|
|
typedef struct _GNotification GNotification;
|
2011-11-27 04:46:51 +01:00
|
|
|
|
2008-07-01 08:32:35 +02:00
|
|
|
typedef struct _GDrive GDrive; /* Dummy typedef */
|
|
|
|
typedef struct _GFileEnumerator GFileEnumerator;
|
|
|
|
typedef struct _GFileMonitor GFileMonitor;
|
|
|
|
typedef struct _GFilterInputStream GFilterInputStream;
|
|
|
|
typedef struct _GFilterOutputStream GFilterOutputStream;
|
|
|
|
|
|
|
|
typedef struct _GFile GFile; /* Dummy typedef */
|
|
|
|
typedef struct _GFileInfo GFileInfo;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GFileAttributeMatcher:
|
|
|
|
*
|
|
|
|
* Determines if a string matches a file attribute.
|
|
|
|
**/
|
|
|
|
typedef struct _GFileAttributeMatcher GFileAttributeMatcher;
|
|
|
|
typedef struct _GFileAttributeInfo GFileAttributeInfo;
|
|
|
|
typedef struct _GFileAttributeInfoList GFileAttributeInfoList;
|
|
|
|
typedef struct _GFileInputStream GFileInputStream;
|
|
|
|
typedef struct _GFileOutputStream GFileOutputStream;
|
2009-05-12 16:59:36 +02:00
|
|
|
typedef struct _GFileIOStream GFileIOStream;
|
2008-07-01 08:32:35 +02:00
|
|
|
typedef struct _GFileIcon GFileIcon;
|
|
|
|
typedef struct _GFilenameCompleter GFilenameCompleter;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct _GIcon GIcon; /* Dummy typedef */
|
2008-12-12 19:13:55 +01:00
|
|
|
typedef struct _GInetAddress GInetAddress;
|
2011-10-01 14:31:54 +02:00
|
|
|
typedef struct _GInetAddressMask GInetAddressMask;
|
2008-12-12 19:13:55 +01:00
|
|
|
typedef struct _GInetSocketAddress GInetSocketAddress;
|
2015-06-01 10:01:26 +02:00
|
|
|
typedef struct _GNativeSocketAddress GNativeSocketAddress;
|
2008-07-01 08:32:35 +02:00
|
|
|
typedef struct _GInputStream GInputStream;
|
2009-05-14 15:26:37 +02:00
|
|
|
typedef struct _GInitable GInitable;
|
2008-07-01 08:32:35 +02:00
|
|
|
typedef struct _GIOModule GIOModule;
|
|
|
|
typedef struct _GIOExtensionPoint GIOExtensionPoint;
|
|
|
|
typedef struct _GIOExtension GIOExtension;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GIOSchedulerJob:
|
|
|
|
*
|
2011-08-29 20:49:32 +02:00
|
|
|
* Opaque class for defining and scheduling IO jobs.
|
2023-11-15 12:21:07 +01:00
|
|
|
*
|
|
|
|
* Deprecated: 2.36: Use [struct@GLib.ThreadPool] or
|
|
|
|
* [method@Gio.Task.run_in_thread]
|
2008-07-01 08:32:35 +02:00
|
|
|
**/
|
|
|
|
typedef struct _GIOSchedulerJob GIOSchedulerJob;
|
2009-12-21 20:50:32 +01:00
|
|
|
typedef struct _GIOStreamAdapter GIOStreamAdapter;
|
2008-07-01 08:32:35 +02:00
|
|
|
typedef struct _GLoadableIcon GLoadableIcon; /* Dummy typedef */
|
2013-04-20 23:23:31 +02:00
|
|
|
typedef struct _GBytesIcon GBytesIcon;
|
2008-07-01 08:32:35 +02:00
|
|
|
typedef struct _GMemoryInputStream GMemoryInputStream;
|
|
|
|
typedef struct _GMemoryOutputStream GMemoryOutputStream;
|
|
|
|
|
|
|
|
typedef struct _GMount GMount; /* Dummy typedef */
|
|
|
|
typedef struct _GMountOperation GMountOperation;
|
2008-12-29 19:38:28 +01:00
|
|
|
typedef struct _GNetworkAddress GNetworkAddress;
|
2011-06-12 21:59:36 +02:00
|
|
|
typedef struct _GNetworkMonitor GNetworkMonitor;
|
2008-12-29 19:38:28 +01:00
|
|
|
typedef struct _GNetworkService GNetworkService;
|
2008-07-01 08:32:35 +02:00
|
|
|
typedef struct _GOutputStream GOutputStream;
|
2009-05-12 16:30:15 +02:00
|
|
|
typedef struct _GIOStream GIOStream;
|
2014-12-17 09:11:29 +01:00
|
|
|
typedef struct _GSimpleIOStream GSimpleIOStream;
|
2010-09-18 19:05:25 +02:00
|
|
|
typedef struct _GPollableInputStream GPollableInputStream; /* Dummy typedef */
|
|
|
|
typedef struct _GPollableOutputStream GPollableOutputStream; /* Dummy typedef */
|
2008-12-29 18:53:47 +01:00
|
|
|
typedef struct _GResolver GResolver;
|
2012-05-17 20:37:17 +02:00
|
|
|
|
2011-12-21 21:38:23 +01:00
|
|
|
typedef struct _GResource GResource;
|
2008-07-01 08:32:35 +02:00
|
|
|
typedef struct _GSeekable GSeekable;
|
|
|
|
typedef struct _GSimpleAsyncResult GSimpleAsyncResult;
|
2009-05-14 15:26:37 +02:00
|
|
|
|
|
|
|
typedef struct _GSocket GSocket;
|
|
|
|
|
|
|
|
typedef struct _GSocketControlMessage GSocketControlMessage;
|
2009-05-15 21:26:24 +02:00
|
|
|
typedef struct _GSocketClient GSocketClient;
|
|
|
|
typedef struct _GSocketConnection GSocketConnection;
|
|
|
|
typedef struct _GSocketListener GSocketListener;
|
|
|
|
typedef struct _GSocketService GSocketService;
|
2008-12-12 19:13:55 +01:00
|
|
|
typedef struct _GSocketAddress GSocketAddress;
|
2008-12-29 19:38:28 +01:00
|
|
|
typedef struct _GSocketAddressEnumerator GSocketAddressEnumerator;
|
|
|
|
typedef struct _GSocketConnectable GSocketConnectable;
|
2008-12-29 18:53:47 +01:00
|
|
|
typedef struct _GSrvTarget GSrvTarget;
|
2011-10-05 16:05:50 +02:00
|
|
|
typedef struct _GTask GTask;
|
2009-05-15 21:26:24 +02:00
|
|
|
typedef struct _GTcpConnection GTcpConnection;
|
make GProxyConnection public, as GTcpWrapperConnection
GProxyConnection is a class that was added for proxy support;
g_socket_client_connect() returns a GSocketConnection, but in some
cases (eg, encrypted SOCKS), GProxy might return a GIOStream that is
not a GSocketConnection. In that case, GSocketClient would wrap the
stream up in a GProxyConnection, which is a subclass of
GSocketConnection but uses the input/output streams of the wrapped
connection.
GTlsConnection is not a GSocketConnection, so it has the same problem,
so it will need the same treatment. Rename the class to
GTcpWrapperStream, and make it public, so people can extract the base
stream from it when necessary.
(This is not ideal and GSocketClient will need to be revisited as an
API at some point...)
https://bugzilla.gnome.org/show_bug.cgi?id=588189
2010-11-02 01:22:24 +01:00
|
|
|
typedef struct _GTcpWrapperConnection GTcpWrapperConnection;
|
2009-05-15 21:26:24 +02:00
|
|
|
typedef struct _GThreadedSocketService GThreadedSocketService;
|
2015-06-25 13:58:14 +02:00
|
|
|
typedef struct _GDtlsConnection GDtlsConnection;
|
|
|
|
typedef struct _GDtlsClientConnection GDtlsClientConnection; /* Dummy typedef */
|
|
|
|
typedef struct _GDtlsServerConnection GDtlsServerConnection; /* Dummy typedef */
|
2008-07-01 08:32:35 +02:00
|
|
|
typedef struct _GThemedIcon GThemedIcon;
|
2009-12-21 20:50:32 +01:00
|
|
|
typedef struct _GTlsCertificate GTlsCertificate;
|
|
|
|
typedef struct _GTlsClientConnection GTlsClientConnection; /* Dummy typedef */
|
|
|
|
typedef struct _GTlsConnection GTlsConnection;
|
2011-08-04 08:54:55 +02:00
|
|
|
typedef struct _GTlsDatabase GTlsDatabase;
|
|
|
|
typedef struct _GTlsFileDatabase GTlsFileDatabase;
|
|
|
|
typedef struct _GTlsInteraction GTlsInteraction;
|
|
|
|
typedef struct _GTlsPassword GTlsPassword;
|
2009-12-21 20:50:32 +01:00
|
|
|
typedef struct _GTlsServerConnection GTlsServerConnection; /* Dummy typedef */
|
2008-07-01 08:32:35 +02:00
|
|
|
typedef struct _GVfs GVfs; /* Dummy typedef */
|
|
|
|
|
2010-05-07 21:55:54 +02:00
|
|
|
typedef struct _GProxyResolver GProxyResolver;
|
2010-08-10 21:24:37 +02:00
|
|
|
typedef struct _GProxy GProxy;
|
2010-04-26 23:27:33 +02:00
|
|
|
typedef struct _GProxyAddress GProxyAddress;
|
2010-08-10 21:25:11 +02:00
|
|
|
typedef struct _GProxyAddressEnumerator GProxyAddressEnumerator;
|
2010-05-07 21:55:54 +02:00
|
|
|
|
2008-07-01 08:32:35 +02:00
|
|
|
typedef struct _GVolume GVolume; /* Dummy typedef */
|
|
|
|
typedef struct _GVolumeMonitor GVolumeMonitor;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GAsyncReadyCallback:
|
2014-11-16 21:16:23 +01:00
|
|
|
* @source_object: (nullable): the object the asynchronous operation was started with.
|
2008-07-01 08:32:35 +02:00
|
|
|
* @res: a #GAsyncResult.
|
2023-01-09 14:12:16 +01:00
|
|
|
* @data: user data passed to the callback.
|
2008-07-01 08:32:35 +02:00
|
|
|
*
|
|
|
|
* Type definition for a function that will be called back when an asynchronous
|
2017-06-16 14:15:03 +02:00
|
|
|
* operation within GIO has been completed. #GAsyncReadyCallback
|
|
|
|
* callbacks from #GTask are guaranteed to be invoked in a later
|
|
|
|
* iteration of the
|
|
|
|
* [thread-default main context][g-main-context-push-thread-default]
|
|
|
|
* where the #GTask was created. All other users of
|
|
|
|
* #GAsyncReadyCallback must likewise call it asynchronously in a
|
|
|
|
* later iteration of the main context.
|
2021-03-12 13:44:57 +01:00
|
|
|
*
|
|
|
|
* The asynchronous operation is guaranteed to have held a reference to
|
|
|
|
* @source_object from the time when the `*_async()` function was called, until
|
|
|
|
* after this callback returns.
|
2008-07-01 08:32:35 +02:00
|
|
|
**/
|
|
|
|
typedef void (*GAsyncReadyCallback) (GObject *source_object,
|
|
|
|
GAsyncResult *res,
|
2023-01-09 14:12:16 +01:00
|
|
|
gpointer data);
|
2008-07-01 08:32:35 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GFileProgressCallback:
|
|
|
|
* @current_num_bytes: the current number of bytes in the operation.
|
|
|
|
* @total_num_bytes: the total number of bytes in the operation.
|
2023-01-09 14:12:16 +01:00
|
|
|
* @data: user data passed to the callback.
|
2008-07-01 08:32:35 +02:00
|
|
|
*
|
|
|
|
* When doing file operations that may take a while, such as moving
|
|
|
|
* a file or copying a file, a progress callback is used to pass how
|
|
|
|
* far along that operation is to the application.
|
|
|
|
**/
|
|
|
|
typedef void (*GFileProgressCallback) (goffset current_num_bytes,
|
|
|
|
goffset total_num_bytes,
|
2023-01-09 14:12:16 +01:00
|
|
|
gpointer data);
|
2008-07-01 08:32:35 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GFileReadMoreCallback:
|
|
|
|
* @file_contents: the data as currently read.
|
|
|
|
* @file_size: the size of the data currently read.
|
2023-01-09 14:12:16 +01:00
|
|
|
* @callback_data: data passed to the callback.
|
2008-07-01 08:32:35 +02:00
|
|
|
*
|
2008-11-21 11:30:43 +01:00
|
|
|
* When loading the partial contents of a file with g_file_load_partial_contents_async(),
|
2008-07-01 08:32:35 +02:00
|
|
|
* it may become necessary to determine if any more data from the file should be loaded.
|
|
|
|
* A #GFileReadMoreCallback function facilitates this by returning %TRUE if more data
|
|
|
|
* should be read, or %FALSE otherwise.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if more data should be read back. %FALSE otherwise.
|
|
|
|
**/
|
|
|
|
typedef gboolean (* GFileReadMoreCallback) (const char *file_contents,
|
|
|
|
goffset file_size,
|
2023-01-09 13:03:12 +01:00
|
|
|
gpointer callback_data);
|
2008-07-01 08:32:35 +02:00
|
|
|
|
2013-07-28 19:41:17 +02:00
|
|
|
/**
|
|
|
|
* GFileMeasureProgressCallback:
|
|
|
|
* @reporting: %TRUE if more reports will come
|
|
|
|
* @current_size: the current cumulative size measurement
|
|
|
|
* @num_dirs: the number of directories visited so far
|
|
|
|
* @num_files: the number of non-directory files encountered
|
2023-01-09 14:12:16 +01:00
|
|
|
* @data: the data passed to the original request for this callback
|
2013-07-28 19:41:17 +02:00
|
|
|
*
|
|
|
|
* This callback type is used by g_file_measure_disk_usage() to make
|
|
|
|
* periodic progress reports when measuring the amount of disk spaced
|
|
|
|
* used by a directory.
|
|
|
|
*
|
|
|
|
* These calls are made on a best-effort basis and not all types of
|
|
|
|
* #GFile will support them. At the minimum, however, one call will
|
|
|
|
* always be made immediately.
|
|
|
|
*
|
|
|
|
* In the case that there is no support, @reporting will be set to
|
|
|
|
* %FALSE (and the other values undefined) and no further calls will be
|
|
|
|
* made. Otherwise, the @reporting will be %TRUE and the other values
|
|
|
|
* all-zeros during the first (immediate) call. In this way, you can
|
|
|
|
* know which type of progress UI to show without a delay.
|
|
|
|
*
|
|
|
|
* For g_file_measure_disk_usage() the callback is made directly. For
|
|
|
|
* g_file_measure_disk_usage_async() the callback is made via the
|
|
|
|
* default main context of the calling thread (ie: the same way that the
|
|
|
|
* final async result would be reported).
|
|
|
|
*
|
|
|
|
* @current_size is in the same units as requested by the operation (see
|
2019-03-07 18:28:32 +01:00
|
|
|
* %G_FILE_MEASURE_APPARENT_SIZE).
|
2013-07-28 19:41:17 +02:00
|
|
|
*
|
|
|
|
* The frequency of the updates is implementation defined, but is
|
|
|
|
* ideally about once every 200ms.
|
|
|
|
*
|
|
|
|
* The last progress callback may or may not be equal to the final
|
|
|
|
* result. Always check the async result to get the final value.
|
|
|
|
*
|
|
|
|
* Since: 2.38
|
|
|
|
**/
|
|
|
|
typedef void (* GFileMeasureProgressCallback) (gboolean reporting,
|
|
|
|
guint64 current_size,
|
|
|
|
guint64 num_dirs,
|
|
|
|
guint64 num_files,
|
2023-01-09 14:12:16 +01:00
|
|
|
gpointer data);
|
2008-07-01 08:32:35 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GIOSchedulerJobFunc:
|
|
|
|
* @job: a #GIOSchedulerJob.
|
|
|
|
* @cancellable: optional #GCancellable object, %NULL to ignore.
|
2023-01-09 14:12:16 +01:00
|
|
|
* @data: data passed to the callback function
|
2008-07-01 08:32:35 +02:00
|
|
|
*
|
|
|
|
* I/O Job function.
|
|
|
|
*
|
|
|
|
* Long-running jobs should periodically check the @cancellable
|
|
|
|
* to see if they have been cancelled.
|
|
|
|
*
|
|
|
|
* Returns: %TRUE if this function should be called again to
|
|
|
|
* complete the job, %FALSE if the job is complete (or cancelled)
|
2023-11-15 12:21:07 +01:00
|
|
|
* Deprecated: 2.36: Use [struct@GLib.ThreadPool] or
|
|
|
|
* [method@Gio.Task.run_in_thread]
|
2008-07-01 08:32:35 +02:00
|
|
|
**/
|
|
|
|
typedef gboolean (*GIOSchedulerJobFunc) (GIOSchedulerJob *job,
|
|
|
|
GCancellable *cancellable,
|
2023-01-09 14:12:16 +01:00
|
|
|
gpointer data);
|
2008-07-01 08:32:35 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GSimpleAsyncThreadFunc:
|
|
|
|
* @res: a #GSimpleAsyncResult.
|
|
|
|
* @object: a #GObject.
|
|
|
|
* @cancellable: optional #GCancellable object, %NULL to ignore.
|
|
|
|
*
|
|
|
|
* Simple thread function that runs an asynchronous operation and
|
|
|
|
* checks for cancellation.
|
|
|
|
**/
|
|
|
|
typedef void (*GSimpleAsyncThreadFunc) (GSimpleAsyncResult *res,
|
|
|
|
GObject *object,
|
|
|
|
GCancellable *cancellable);
|
|
|
|
|
2009-05-14 15:26:37 +02:00
|
|
|
/**
|
|
|
|
* GSocketSourceFunc:
|
2009-05-14 16:58:47 +02:00
|
|
|
* @socket: the #GSocket
|
2009-05-14 15:26:37 +02:00
|
|
|
* @condition: the current condition at the source fired.
|
2023-01-09 14:12:16 +01:00
|
|
|
* @data: data passed in by the user.
|
2009-05-14 15:26:37 +02:00
|
|
|
*
|
|
|
|
* This is the function type of the callback used for the #GSource
|
|
|
|
* returned by g_socket_create_source().
|
|
|
|
*
|
2009-05-28 00:20:08 +02:00
|
|
|
* Returns: it should return %FALSE if the source should be removed.
|
2009-05-18 13:02:11 +02:00
|
|
|
*
|
2009-05-14 15:26:37 +02:00
|
|
|
* Since: 2.22
|
|
|
|
*/
|
2009-05-14 16:58:47 +02:00
|
|
|
typedef gboolean (*GSocketSourceFunc) (GSocket *socket,
|
|
|
|
GIOCondition condition,
|
2023-01-09 14:12:16 +01:00
|
|
|
gpointer data);
|
2009-05-14 15:26:37 +02:00
|
|
|
|
2015-06-12 09:50:42 +02:00
|
|
|
/**
|
|
|
|
* GDatagramBasedSourceFunc:
|
|
|
|
* @datagram_based: the #GDatagramBased
|
|
|
|
* @condition: the current condition at the source fired
|
2023-01-09 14:12:16 +01:00
|
|
|
* @data: data passed in by the user
|
2015-06-12 09:50:42 +02:00
|
|
|
*
|
|
|
|
* This is the function type of the callback used for the #GSource
|
|
|
|
* returned by g_datagram_based_create_source().
|
|
|
|
*
|
|
|
|
* Returns: %G_SOURCE_REMOVE if the source should be removed,
|
|
|
|
* %G_SOURCE_CONTINUE otherwise
|
|
|
|
*
|
|
|
|
* Since: 2.48
|
|
|
|
*/
|
|
|
|
typedef gboolean (*GDatagramBasedSourceFunc) (GDatagramBased *datagram_based,
|
|
|
|
GIOCondition condition,
|
2023-01-09 14:12:16 +01:00
|
|
|
gpointer data);
|
2015-06-12 09:50:42 +02:00
|
|
|
|
2009-05-14 15:26:37 +02:00
|
|
|
/**
|
|
|
|
* GInputVector:
|
2009-05-19 11:27:07 +02:00
|
|
|
* @buffer: Pointer to a buffer where data will be written.
|
2009-05-28 00:20:08 +02:00
|
|
|
* @size: the available size in @buffer.
|
2009-05-14 15:26:37 +02:00
|
|
|
*
|
|
|
|
* Structure used for scatter/gather data input.
|
2014-04-16 23:56:02 +02:00
|
|
|
* You generally pass in an array of #GInputVectors
|
2009-05-28 00:20:08 +02:00
|
|
|
* and the operation will store the read data starting in the
|
|
|
|
* first buffer, switching to the next as needed.
|
2009-05-14 15:26:37 +02:00
|
|
|
*
|
|
|
|
* Since: 2.22
|
|
|
|
*/
|
2009-05-19 11:27:07 +02:00
|
|
|
typedef struct _GInputVector GInputVector;
|
|
|
|
|
|
|
|
struct _GInputVector {
|
2009-05-14 15:26:37 +02:00
|
|
|
gpointer buffer;
|
|
|
|
gsize size;
|
2009-05-19 11:27:07 +02:00
|
|
|
};
|
2009-05-14 15:26:37 +02:00
|
|
|
|
2015-07-29 12:36:50 +02:00
|
|
|
/**
|
|
|
|
* GInputMessage:
|
|
|
|
* @address: (optional) (out) (transfer full): return location
|
|
|
|
* for a #GSocketAddress, or %NULL
|
|
|
|
* @vectors: (array length=num_vectors) (out): pointer to an
|
|
|
|
* array of input vectors
|
|
|
|
* @num_vectors: the number of input vectors pointed to by @vectors
|
|
|
|
* @bytes_received: (out): will be set to the number of bytes that have been
|
|
|
|
* received
|
|
|
|
* @flags: (out): collection of #GSocketMsgFlags for the received message,
|
|
|
|
* outputted by the call
|
|
|
|
* @control_messages: (array length=num_control_messages) (optional)
|
|
|
|
* (out) (transfer full): return location for a
|
|
|
|
* caller-allocated array of #GSocketControlMessages, or %NULL
|
|
|
|
* @num_control_messages: (out) (optional): return location for the number of
|
|
|
|
* elements in @control_messages
|
|
|
|
*
|
|
|
|
* Structure used for scatter/gather data input when receiving multiple
|
|
|
|
* messages or packets in one go. You generally pass in an array of empty
|
|
|
|
* #GInputVectors and the operation will use all the buffers as if they
|
|
|
|
* were one buffer, and will set @bytes_received to the total number of bytes
|
|
|
|
* received across all #GInputVectors.
|
|
|
|
*
|
|
|
|
* This structure closely mirrors `struct mmsghdr` and `struct msghdr` from
|
|
|
|
* the POSIX sockets API (see `man 2 recvmmsg`).
|
|
|
|
*
|
|
|
|
* If @address is non-%NULL then it is set to the source address the message
|
|
|
|
* was received from, and the caller must free it afterwards.
|
|
|
|
*
|
|
|
|
* If @control_messages is non-%NULL then it is set to an array of control
|
|
|
|
* messages received with the message (if any), and the caller must free it
|
|
|
|
* afterwards. @num_control_messages is set to the number of elements in
|
|
|
|
* this array, which may be zero.
|
|
|
|
*
|
|
|
|
* Flags relevant to this message will be returned in @flags. For example,
|
|
|
|
* `MSG_EOR` or `MSG_TRUNC`.
|
|
|
|
*
|
|
|
|
* Since: 2.48
|
|
|
|
*/
|
|
|
|
typedef struct _GInputMessage GInputMessage;
|
|
|
|
|
|
|
|
struct _GInputMessage {
|
|
|
|
GSocketAddress **address;
|
|
|
|
|
|
|
|
GInputVector *vectors;
|
|
|
|
guint num_vectors;
|
|
|
|
|
|
|
|
gsize bytes_received;
|
|
|
|
gint flags;
|
|
|
|
|
|
|
|
GSocketControlMessage ***control_messages;
|
|
|
|
guint *num_control_messages;
|
|
|
|
};
|
|
|
|
|
2009-05-14 15:26:37 +02:00
|
|
|
/**
|
|
|
|
* GOutputVector:
|
2009-05-19 11:27:07 +02:00
|
|
|
* @buffer: Pointer to a buffer of data to read.
|
|
|
|
* @size: the size of @buffer.
|
2009-05-14 15:26:37 +02:00
|
|
|
*
|
|
|
|
* Structure used for scatter/gather data output.
|
2014-04-16 23:56:02 +02:00
|
|
|
* You generally pass in an array of #GOutputVectors
|
2009-05-28 00:20:08 +02:00
|
|
|
* and the operation will use all the buffers as if they were
|
|
|
|
* one buffer.
|
2009-05-14 15:26:37 +02:00
|
|
|
*
|
|
|
|
* Since: 2.22
|
|
|
|
*/
|
2009-05-19 11:27:07 +02:00
|
|
|
typedef struct _GOutputVector GOutputVector;
|
|
|
|
|
|
|
|
struct _GOutputVector {
|
2009-05-14 15:26:37 +02:00
|
|
|
gconstpointer buffer;
|
|
|
|
gsize size;
|
2009-05-19 11:27:07 +02:00
|
|
|
};
|
2009-05-14 15:26:37 +02:00
|
|
|
|
2014-06-12 19:16:45 +02:00
|
|
|
/**
|
|
|
|
* GOutputMessage:
|
2016-10-29 03:29:02 +02:00
|
|
|
* @address: (nullable): a #GSocketAddress, or %NULL
|
2014-06-12 19:16:45 +02:00
|
|
|
* @vectors: pointer to an array of output vectors
|
|
|
|
* @num_vectors: the number of output vectors pointed to by @vectors.
|
|
|
|
* @bytes_sent: initialize to 0. Will be set to the number of bytes
|
|
|
|
* that have been sent
|
2016-10-29 03:29:02 +02:00
|
|
|
* @control_messages: (array length=num_control_messages) (nullable): a pointer
|
2014-06-12 19:16:45 +02:00
|
|
|
* to an array of #GSocketControlMessages, or %NULL.
|
|
|
|
* @num_control_messages: number of elements in @control_messages.
|
|
|
|
*
|
|
|
|
* Structure used for scatter/gather data output when sending multiple
|
|
|
|
* messages or packets in one go. You generally pass in an array of
|
|
|
|
* #GOutputVectors and the operation will use all the buffers as if they
|
|
|
|
* were one buffer.
|
|
|
|
*
|
|
|
|
* If @address is %NULL then the message is sent to the default receiver
|
|
|
|
* (as previously set by g_socket_connect()).
|
|
|
|
*
|
|
|
|
* Since: 2.44
|
|
|
|
*/
|
|
|
|
typedef struct _GOutputMessage GOutputMessage;
|
|
|
|
|
|
|
|
struct _GOutputMessage {
|
|
|
|
GSocketAddress *address;
|
|
|
|
|
|
|
|
GOutputVector *vectors;
|
|
|
|
guint num_vectors;
|
|
|
|
|
|
|
|
guint bytes_sent;
|
|
|
|
|
|
|
|
GSocketControlMessage **control_messages;
|
|
|
|
guint num_control_messages;
|
|
|
|
};
|
|
|
|
|
2010-05-06 20:13:59 +02:00
|
|
|
typedef struct _GCredentials GCredentials;
|
|
|
|
typedef struct _GUnixCredentialsMessage GUnixCredentialsMessage;
|
2010-05-14 02:29:04 +02:00
|
|
|
typedef struct _GUnixFDList GUnixFDList;
|
2010-05-06 20:13:59 +02:00
|
|
|
typedef struct _GDBusMessage GDBusMessage;
|
|
|
|
typedef struct _GDBusConnection GDBusConnection;
|
|
|
|
typedef struct _GDBusProxy GDBusProxy;
|
|
|
|
typedef struct _GDBusMethodInvocation GDBusMethodInvocation;
|
|
|
|
typedef struct _GDBusServer GDBusServer;
|
|
|
|
typedef struct _GDBusAuthObserver GDBusAuthObserver;
|
|
|
|
typedef struct _GDBusErrorEntry GDBusErrorEntry;
|
|
|
|
typedef struct _GDBusInterfaceVTable GDBusInterfaceVTable;
|
|
|
|
typedef struct _GDBusSubtreeVTable GDBusSubtreeVTable;
|
|
|
|
typedef struct _GDBusAnnotationInfo GDBusAnnotationInfo;
|
|
|
|
typedef struct _GDBusArgInfo GDBusArgInfo;
|
|
|
|
typedef struct _GDBusMethodInfo GDBusMethodInfo;
|
|
|
|
typedef struct _GDBusSignalInfo GDBusSignalInfo;
|
|
|
|
typedef struct _GDBusPropertyInfo GDBusPropertyInfo;
|
|
|
|
typedef struct _GDBusInterfaceInfo GDBusInterfaceInfo;
|
|
|
|
typedef struct _GDBusNodeInfo GDBusNodeInfo;
|
2009-05-14 15:26:37 +02:00
|
|
|
|
2010-11-06 20:49:55 +01:00
|
|
|
/**
|
|
|
|
* GCancellableSourceFunc:
|
|
|
|
* @cancellable: the #GCancellable
|
2023-01-09 14:12:16 +01:00
|
|
|
* @data: data passed in by the user.
|
2010-11-06 20:49:55 +01:00
|
|
|
*
|
|
|
|
* This is the function type of the callback used for the #GSource
|
|
|
|
* returned by g_cancellable_source_new().
|
|
|
|
*
|
|
|
|
* Returns: it should return %FALSE if the source should be removed.
|
|
|
|
*
|
|
|
|
* Since: 2.28
|
|
|
|
*/
|
|
|
|
typedef gboolean (*GCancellableSourceFunc) (GCancellable *cancellable,
|
2023-01-09 14:12:16 +01:00
|
|
|
gpointer data);
|
2010-11-06 20:49:55 +01:00
|
|
|
|
2010-09-18 19:05:25 +02:00
|
|
|
/**
|
|
|
|
* GPollableSourceFunc:
|
|
|
|
* @pollable_stream: the #GPollableInputStream or #GPollableOutputStream
|
2023-01-09 14:12:16 +01:00
|
|
|
* @data: data passed in by the user.
|
2010-09-18 19:05:25 +02:00
|
|
|
*
|
|
|
|
* This is the function type of the callback used for the #GSource
|
|
|
|
* returned by g_pollable_input_stream_create_source() and
|
|
|
|
* g_pollable_output_stream_create_source().
|
|
|
|
*
|
|
|
|
* Returns: it should return %FALSE if the source should be removed.
|
|
|
|
*
|
|
|
|
* Since: 2.28
|
|
|
|
*/
|
|
|
|
typedef gboolean (*GPollableSourceFunc) (GObject *pollable_stream,
|
2023-01-09 14:12:16 +01:00
|
|
|
gpointer data);
|
2010-09-18 19:05:25 +02:00
|
|
|
|
2011-04-08 21:14:47 +02:00
|
|
|
typedef struct _GDBusInterface GDBusInterface; /* Dummy typedef */
|
2011-04-13 22:33:51 +02:00
|
|
|
typedef struct _GDBusInterfaceSkeleton GDBusInterfaceSkeleton;
|
2011-04-08 21:14:47 +02:00
|
|
|
typedef struct _GDBusObject GDBusObject; /* Dummy typedef */
|
2011-04-13 22:33:51 +02:00
|
|
|
typedef struct _GDBusObjectSkeleton GDBusObjectSkeleton;
|
2011-04-08 21:14:47 +02:00
|
|
|
typedef struct _GDBusObjectProxy GDBusObjectProxy;
|
|
|
|
typedef struct _GDBusObjectManager GDBusObjectManager; /* Dummy typedef */
|
|
|
|
typedef struct _GDBusObjectManagerClient GDBusObjectManagerClient;
|
|
|
|
typedef struct _GDBusObjectManagerServer GDBusObjectManagerServer;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* GDBusProxyTypeFunc:
|
|
|
|
* @manager: A #GDBusObjectManagerClient.
|
|
|
|
* @object_path: The object path of the remote object.
|
2016-10-29 03:29:02 +02:00
|
|
|
* @interface_name: (nullable): The interface name of the remote object or %NULL if a #GDBusObjectProxy #GType is requested.
|
2023-01-09 14:12:16 +01:00
|
|
|
* @data: data passed in by the user.
|
2011-04-08 21:14:47 +02:00
|
|
|
*
|
|
|
|
* Function signature for a function used to determine the #GType to
|
2011-04-25 15:29:18 +02:00
|
|
|
* use for an interface proxy (if @interface_name is not %NULL) or
|
|
|
|
* object proxy (if @interface_name is %NULL).
|
2011-04-08 21:14:47 +02:00
|
|
|
*
|
|
|
|
* This function is called in the
|
2014-04-15 16:18:59 +02:00
|
|
|
* [thread-default main loop][g-main-context-push-thread-default]
|
2011-04-08 21:14:47 +02:00
|
|
|
* that @manager was constructed in.
|
|
|
|
*
|
|
|
|
* Returns: A #GType to use for the remote object. The returned type
|
2016-05-26 10:12:32 +02:00
|
|
|
* must be a #GDBusProxy or #GDBusObjectProxy -derived
|
2011-04-25 15:29:18 +02:00
|
|
|
* type.
|
2011-04-08 21:14:47 +02:00
|
|
|
*
|
|
|
|
* Since: 2.30
|
|
|
|
*/
|
|
|
|
typedef GType (*GDBusProxyTypeFunc) (GDBusObjectManagerClient *manager,
|
|
|
|
const gchar *object_path,
|
|
|
|
const gchar *interface_name,
|
2023-01-09 14:12:16 +01:00
|
|
|
gpointer data);
|
2011-04-08 21:14:47 +02:00
|
|
|
|
2012-04-18 23:21:13 +02:00
|
|
|
typedef struct _GTestDBus GTestDBus;
|
|
|
|
|
2012-05-17 20:37:17 +02:00
|
|
|
typedef struct _GSubprocess GSubprocess;
|
|
|
|
typedef struct _GSubprocessLauncher GSubprocessLauncher;
|
|
|
|
|
2008-07-01 08:32:35 +02:00
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __GIO_TYPES_H__ */
|