summaryrefslogtreecommitdiff
path: root/daemon/gvfsafpvolume.h
blob: 209ad74601fab7a473d5c27d33a0eac1c84ed37c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
 /* GIO - GLib Input, Output and Streaming Library
 * 
 * Copyright (C) Carl-Anton Ingmarsson 2011 <ca.ingmarsson@gmail.com>
 *
 * 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
 * version 2 of the License, or (at your option) any later version.
 *
 * 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
 * Public License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 *
 * Author: Carl-Anton Ingmarsson <ca.ingmarsson@gmail.com>
 */

#ifndef _GVFSAFPVOLUME_H_
#define _GVFSAFPVOLUME_H_

#include <glib-object.h>

G_BEGIN_DECLS

typedef struct _GVfsAfpServer GVfsAfpServer;

#define G_VFS_TYPE_AFP_VOLUME             (g_vfs_afp_volume_get_type ())
#define G_VFS_AFP_VOLUME(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), G_VFS_TYPE_AFP_VOLUME, GVfsAfpVolume))
#define G_VFS_AFP_VOLUME_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), G_VFS_TYPE_AFP_VOLUME, GVfsAfpVolumeClass))
#define G_VFS_IS_AFP_VOLUME(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), G_VFS_TYPE_AFP_VOLUME))
#define G_VFS_IS_AFP_VOLUME_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), G_VFS_TYPE_AFP_VOLUME))
#define G_VFS_AFP_VOLUME_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), G_VFS_TYPE_AFP_VOLUME, GVfsAfpVolumeClass))

typedef struct _GVfsAfpVolumeClass GVfsAfpVolumeClass;
typedef struct _GVfsAfpVolume GVfsAfpVolume;
typedef struct _GVfsAfpVolumePrivate GVfsAfpVolumePrivate;

struct _GVfsAfpVolumeClass
{
  GObjectClass parent_class;
};

struct _GVfsAfpVolume
{
  GObject parent_instance;

  GVfsAfpVolumePrivate *priv;
};

GType g_vfs_afp_volume_get_type (void) G_GNUC_CONST;

GVfsAfpVolume *g_vfs_afp_volume_new                 (GVfsAfpServer *server);

gboolean       g_vfs_afp_volume_mount_sync          (GVfsAfpVolume *volume,
                                                     const char    *volume_name,
                                                     GCancellable  *cancellable,
                                                     GError       **error);

guint16        g_vfs_afp_volume_get_attributes      (GVfsAfpVolume *volume);
guint16        g_vfs_afp_volume_get_id              (GVfsAfpVolume *volume);

void           g_vfs_afp_volume_get_parms           (GVfsAfpVolume        *volume,
                                                     guint16              vol_bitmap,
                                                     GCancellable        *cancellable,
                                                     GAsyncReadyCallback  callback,
                                                     gpointer             user_data);

GFileInfo *    g_vfs_afp_volume_get_parms_finish    (GVfsAfpVolume       *volume,
                                                     GAsyncResult        *result,
                                                     GError             **error);

void           g_vfs_afp_volume_open_fork           (GVfsAfpVolume      *volume,
                                                     const char         *filename,
                                                     guint16             access_mode,
                                                     guint16             bitmap,
                                                     GCancellable       *cancellable,
                                                     GAsyncReadyCallback callback,
                                                     gpointer            user_data);

gboolean       g_vfs_afp_volume_open_fork_finish    (GVfsAfpVolume  *volume,
                                                     GAsyncResult   *res,
                                                     gint16         *fork_refnum,
                                                     GFileInfo      **info,
                                                     GError         **error);

void           g_vfs_afp_volume_close_fork          (GVfsAfpVolume       *volume,
                                                     gint16               fork_refnum,
                                                     GCancellable        *cancellable,
                                                     GAsyncReadyCallback  callback,
                                                     gpointer             user_data);

gboolean      g_vfs_afp_volume_close_fork_finish   (GVfsAfpVolume  *volume,
                                                    GAsyncResult   *result,
                                                    GError         **error);

void          g_vfs_afp_volume_delete              (GVfsAfpVolume       *volume,
                                                    const char          *filename,
                                                    GCancellable        *cancellable,
                                                    GAsyncReadyCallback  callback,
                                                    gpointer             user_data);

gboolean      g_vfs_afp_volume_delete_finish       (GVfsAfpVolume  *volume,
                                                    GAsyncResult   *result,
                                                    GError         **error);

void          g_vfs_afp_volume_create_file         (GVfsAfpVolume      *volume,
                                                    const char         *filename,
                                                    gboolean            hard_create,
                                                    GCancellable       *cancellable,
                                                    GAsyncReadyCallback callback,
                                                    gpointer            user_data);

gboolean     g_vfs_afp_volume_create_file_finish   (GVfsAfpVolume  *volume,
                                                    GAsyncResult   *result,
                                                    GError         **error);

void         g_vfs_afp_volume_create_directory     (GVfsAfpVolume      *volume,
                                                    const char         *directory,
                                                    GCancellable       *cancellable,
                                                    GAsyncReadyCallback callback,
                                                    gpointer            user_data);

gboolean     g_vfs_afp_volume_create_directory_finish (GVfsAfpVolume  *volume,
                                                       GAsyncResult   *result,
                                                       GError         **error);

void         g_vfs_afp_volume_copy_file            (GVfsAfpVolume      *volume,
                                                    const char         *source,
                                                    const char         *destination,
                                                    GCancellable       *cancellable,
                                                    GAsyncReadyCallback callback,
                                                    gpointer            user_data);

gboolean     g_vfs_afp_volume_copy_file_finish     (GVfsAfpVolume *volume,
                                                    GAsyncResult  *res,
                                                    GError       **error);

void         g_vfs_afp_volume_rename               (GVfsAfpVolume      *volume,
                                                    const char         *filename,
                                                    const char         *new_name,
                                                    GCancellable       *cancellable,
                                                    GAsyncReadyCallback callback,
                                                    gpointer            user_data);

gboolean     g_vfs_afp_volume_rename_finish        (GVfsAfpVolume  *volume,
                                                    GAsyncResult   *res,
                                                    GError        **error);

void         g_vfs_afp_volume_move_and_rename      (GVfsAfpVolume      *volume,
                                                    const char         *source,
                                                    const char         *destination,
                                                    GCancellable       *cancellable,
                                                    GAsyncReadyCallback callback,
                                                    gpointer            user_data);

gboolean     g_vfs_afp_volume_move_and_rename_finish (GVfsAfpVolume  *volume,
                                                      GAsyncResult   *res,
                                                      GError        **error);

void          g_vfs_afp_volume_map_id              (GVfsAfpVolume       *volume,
                                                    AfpMapIDFunction     map_function,
                                                    gint64               id,
                                                    GCancellable        *cancellable,
                                                    GAsyncReadyCallback  callback,
                                                    gpointer             user_data);

char *        g_vfs_afp_volume_map_id_finish       (GVfsAfpVolume   *volume,
                                                    GAsyncResult     *res,
                                                    AfpMapIDFunction *map_function,
                                                    GError          **error);

void          g_vfs_afp_volume_get_filedir_parms   (GVfsAfpVolume       *volume,
                                                    const char          *filename,
                                                    guint16              file_bitmap,
                                                    guint16              dir_bitmap,
                                                    GCancellable        *cancellable,
                                                    GAsyncReadyCallback  callback,
                                                    gpointer             user_data);

GFileInfo *   g_vfs_afp_volume_get_filedir_parms_finish (GVfsAfpVolume  *volume,
                                                         GAsyncResult   *result,
                                                         GError         **error);

void          g_vfs_afp_volume_get_fork_parms      (GVfsAfpVolume       *volume,
                                                    gint16               fork_refnum,
                                                    guint16              file_bitmap,
                                                    GCancellable        *cancellable,
                                                    GAsyncReadyCallback  callback,
                                                    gpointer             user_data);

GFileInfo *   g_vfs_afp_volume_get_fork_parms_finish (GVfsAfpVolume  *volume,
                                                      GAsyncResult   *result,
                                                      GError         **error);

void          g_vfs_afp_volume_set_fork_size         (GVfsAfpVolume       *volume,
                                                      gint16               fork_refnum,
                                                      gint64               size,
                                                      GCancellable        *cancellable,
                                                      GAsyncReadyCallback  callback,
                                                      gpointer             user_data);

gboolean      g_vfs_afp_volume_set_fork_size_finish  (GVfsAfpVolume  *volume,
                                                      GAsyncResult   *result,
                                                      GError         **error);

void          g_vfs_afp_volume_set_unix_privs      (GVfsAfpVolume       *volume,
                                                    const char          *filename,
                                                    guint32              uid,
                                                    guint32              gid,
                                                    guint32              permissions,
                                                    guint32              ua_permissions,
                                                    GCancellable        *cancellable,
                                                    GAsyncReadyCallback  callback,
                                                    gpointer             user_data);

gboolean      g_vfs_afp_volume_set_unix_privs_finish (GVfsAfpVolume  *volume,
                                                      GAsyncResult   *res,
                                                      GError        **error);

void          g_vfs_afp_volume_enumerate             (GVfsAfpVolume       *volume,
                                                      const char          *directory,
                                                      gint64               start_index,
                                                      guint16              file_bitmap,
                                                      guint16              dir_bitmap,
                                                      GCancellable        *cancellable,
                                                      GAsyncReadyCallback  callback,
                                                      gpointer             user_data);

gboolean      g_vfs_afp_volume_enumerate_finish      (GVfsAfpVolume  *volume,
                                                      GAsyncResult   *res,
                                                      GPtrArray      **infos,
                                                      GError        **error);

void          g_vfs_afp_volume_exchange_files        (GVfsAfpVolume       *volume,
                                                      const char          *source,
                                                      const char          *destination,
                                                      GCancellable        *cancellable,
                                                      GAsyncReadyCallback  callback,
                                                      gpointer             user_data);

gboolean      g_vfs_afp_volume_exchange_files_finish (GVfsAfpVolume  *volume,
                                                      GAsyncResult   *res,
                                                      GError        **error);

void          g_vfs_afp_volume_write_to_fork         (GVfsAfpVolume       *volume,
                                                      guint16              fork_refnum,
                                                      char                *buffer,
                                                      gsize                buffer_size,
                                                      gint64               offset,
                                                      GCancellable        *cancellable,
                                                      GAsyncReadyCallback  callback,
                                                      gpointer             user_data);

gboolean      g_vfs_afp_volume_write_to_fork_finish  (GVfsAfpVolume  *volume,
                                                      GAsyncResult   *res,
                                                      gint64         *last_written,
                                                      GError        **error);

void          g_vfs_afp_volume_read_from_fork        (GVfsAfpVolume       *volume,
                                                      guint16              fork_refnum,
                                                      char                *buffer,
                                                      gsize                bytes_requested,
                                                      gint64               offset,
                                                      GCancellable        *cancellable,
                                                      GAsyncReadyCallback  callback,
                                                      gpointer             user_data);

gboolean      g_vfs_afp_volume_read_from_fork_finish (GVfsAfpVolume  *volume,
                                                      GAsyncResult   *res,
                                                      gsize          *bytes_read,
                                                      GError        **error);


G_END_DECLS

#endif /* _GVFSAFPVOLUME_H_ */