Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
gvfs.h
Go to the documentation of this file.
1/* GIO - GLib Input, Output and Streaming Library
2 *
3 * Copyright (C) 2006-2007 Red Hat, Inc.
4 *
5 * SPDX-License-Identifier: LGPL-2.1-or-later
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General
18 * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
19 *
20 * Author: Alexander Larsson <alexl@redhat.com>
21 */
22
23#ifndef __G_VFS_H__
24#define __G_VFS_H__
25
26#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
27#error "Only <gio/gio.h> can be included directly."
28#endif
29
30#include <gio/giotypes.h>
31
33
34#define G_TYPE_VFS (g_vfs_get_type ())
35#define G_VFS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_VFS, GVfs))
36#define G_VFS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), G_TYPE_VFS, GVfsClass))
37#define G_VFS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), G_TYPE_VFS, GVfsClass))
38#define G_IS_VFS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_VFS))
39#define G_IS_VFS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), G_TYPE_VFS))
40
41/**
42 * GVfsFileLookupFunc:
43 * @vfs: a #GVfs
44 * @identifier: the identifier to look up a #GFile for. This can either
45 * be a URI or a parse name as returned by g_file_get_parse_name()
46 * @user_data: user data passed to the function
47 *
48 * This function type is used by g_vfs_register_uri_scheme() to make it
49 * possible for a client to associate a URI scheme to a different #GFile
50 * implementation.
51 *
52 * The client should return a reference to the new file that has been
53 * created for @uri, or %NULL to continue with the default implementation.
54 *
55 * Returns: (transfer full): a #GFile for @identifier.
56 *
57 * Since: 2.50
58 */
59typedef GFile * (* GVfsFileLookupFunc) (GVfs *vfs,
60 const char *identifier,
61 gpointer user_data);
62
63/**
64 * G_VFS_EXTENSION_POINT_NAME:
65 *
66 * Extension point for #GVfs functionality.
67 * See [Extending GIO][extending-gio].
68 */
69#define G_VFS_EXTENSION_POINT_NAME "gio-vfs"
70
71typedef struct _GVfsClass GVfsClass;
72
77
79{
81
82 /* Virtual Table */
83
85 GFile * (* get_file_for_path) (GVfs *vfs,
86 const char *path);
87 GFile * (* get_file_for_uri) (GVfs *vfs,
88 const char *uri);
89 const gchar * const * (* get_supported_uri_schemes) (GVfs *vfs);
90 GFile * (* parse_name) (GVfs *vfs,
91 const char *parse_name);
92
93 /*< private >*/
94 void (* local_file_add_info) (GVfs *vfs,
95 const char *filename,
96 guint64 device,
97 GFileAttributeMatcher *attribute_matcher,
98 GFileInfo *info,
99 GCancellable *cancellable,
100 gpointer *extra_data,
101 GDestroyNotify *free_extra_data);
105 const char *filename,
106 GFileInfo *info,
108 GCancellable *cancellable,
109 GError **error);
110 void (* local_file_removed) (GVfs *vfs,
111 const char *filename);
112 void (* local_file_moved) (GVfs *vfs,
113 const char *source,
114 const char *dest);
115 GIcon * (* deserialize_icon) (GVfs *vfs,
116 GVariant *value);
117 /* Padding for future expansion */
118 void (*_g_reserved1) (void);
119 void (*_g_reserved2) (void);
120 void (*_g_reserved3) (void);
121 void (*_g_reserved4) (void);
122 void (*_g_reserved5) (void);
123 void (*_g_reserved6) (void);
124};
125
128
133 const char *path);
136 const char *uri);
139
142 const char *parse_name);
143
148
151 const char *scheme,
152 GVfsFileLookupFunc uri_func,
153 gpointer uri_data,
154 GDestroyNotify uri_destroy,
155 GVfsFileLookupFunc parse_name_func,
156 gpointer parse_name_data,
157 GDestroyNotify parse_name_destroy);
160 const char *scheme);
161
162
164
165#endif /* __G_VFS_H__ */
#define GIO_AVAILABLE_IN_ALL
#define GIO_AVAILABLE_IN_2_50
GFileQueryInfoFlags
Definition gioenums.h:187
struct _GIcon GIcon
Definition giotypes.h:92
struct _GFileInfo GFileInfo
Definition giotypes.h:75
struct _GFile GFile
Definition giotypes.h:74
struct _GFileAttributeMatcher GFileAttributeMatcher
Definition giotypes.h:82
unsigned long guint64
Definition glibconfig.h:67
#define G_END_DECLS
Definition gmacros.h:910
#define G_BEGIN_DECLS
Definition gmacros.h:909
#define G_GNUC_CONST
Definition gmacros.h:637
gsize GType
Definition gtype.h:427
gint gboolean
Definition gtypes.h:56
G_BEGIN_DECLS typedef char gchar
Definition gtypes.h:52
void * gpointer
Definition gtypes.h:109
void(* GDestroyNotify)(gpointer data)
Definition gtypes.h:140
typedefG_BEGIN_DECLS struct _GVariant GVariant
Definition gvariant.h:36
GFile *(* GVfsFileLookupFunc)(GVfs *vfs, const char *identifier, gpointer user_data)
Definition gvfs.h:59
GIO_AVAILABLE_IN_ALL GVfs * g_vfs_get_local(void)
GIO_AVAILABLE_IN_ALL GFile * g_vfs_get_file_for_path(GVfs *vfs, const char *path)
GIO_AVAILABLE_IN_ALL const gchar *const * g_vfs_get_supported_uri_schemes(GVfs *vfs)
GIO_AVAILABLE_IN_ALL GType g_vfs_get_type(void) G_GNUC_CONST
GIO_AVAILABLE_IN_ALL GFile * g_vfs_get_file_for_uri(GVfs *vfs, const char *uri)
GIO_AVAILABLE_IN_2_50 gboolean g_vfs_unregister_uri_scheme(GVfs *vfs, const char *scheme)
GIO_AVAILABLE_IN_2_50 gboolean g_vfs_register_uri_scheme(GVfs *vfs, const char *scheme, GVfsFileLookupFunc uri_func, gpointer uri_data, GDestroyNotify uri_destroy, GVfsFileLookupFunc parse_name_func, gpointer parse_name_data, GDestroyNotify parse_name_destroy)
GIO_AVAILABLE_IN_ALL GVfs * g_vfs_get_default(void)
GIO_AVAILABLE_IN_ALL GFile * g_vfs_parse_name(GVfs *vfs, const char *parse_name)
GIO_AVAILABLE_IN_ALL gboolean g_vfs_is_active(GVfs *vfs)
int value
Definition lsqlite3.c:2155
static void error(LoadState *S, const char *why)
void(* _g_reserved4)(void)
Definition gvfs.h:121
void(* add_writable_namespaces)(GVfs *vfs, GFileAttributeInfoList *list)
Definition gvfs.h:102
GObjectClass parent_class
Definition gvfs.h:80
void(* _g_reserved6)(void)
Definition gvfs.h:123
gboolean(* is_active)(GVfs *vfs)
Definition gvfs.h:84
void(* local_file_removed)(GVfs *vfs, const char *filename)
Definition gvfs.h:110
GFile *(* parse_name)(GVfs *vfs, const char *parse_name)
Definition gvfs.h:90
void(* _g_reserved3)(void)
Definition gvfs.h:120
gboolean(* local_file_set_attributes)(GVfs *vfs, const char *filename, GFileInfo *info, GFileQueryInfoFlags flags, GCancellable *cancellable, GError **error)
Definition gvfs.h:104
void(* local_file_moved)(GVfs *vfs, const char *source, const char *dest)
Definition gvfs.h:112
void(* _g_reserved5)(void)
Definition gvfs.h:122
void(* _g_reserved2)(void)
Definition gvfs.h:119
void(* _g_reserved1)(void)
Definition gvfs.h:118
void(* local_file_add_info)(GVfs *vfs, const char *filename, guint64 device, GFileAttributeMatcher *attribute_matcher, GFileInfo *info, GCancellable *cancellable, gpointer *extra_data, GDestroyNotify *free_extra_data)
Definition gvfs.h:94
Definition gvfs.h:74
GObject parent_instance
Definition gvfs.h:75