e4f1af58b662a2b39fac5af10c3aedc43f7862cd
[captive.git] / src / libcaptive / client / file.h
1 /* $Id$
2  * Include file for captive vfs 'file' private interface to reactos
3  * Copyright (C) 2003 Jan Kratochvil <project-captive@jankratochvil.net>
4  * 
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; exactly version 2 of June 1991 is required
8  * 
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  * 
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17  */
18
19
20 #ifndef _CAPTIVE_CLIENT_PRIV_FILE_H
21 #define _CAPTIVE_CLIENT_PRIV_FILE_H 1
22
23
24 #include <glib/gmacros.h>
25 #include <glib/gtypes.h>
26 #include "captive/client-vfs.h"
27
28
29 G_BEGIN_DECLS
30
31 struct _CaptiveFileObject {
32         GObject parent_instance;
33
34         /*< private >*/
35         CaptiveVfsObject *vfs;
36         };
37 struct _CaptiveFileObjectClass {
38         GObjectClass parent_class;
39
40         GnomeVFSResult (*read)(CaptiveFileObject *captive_file_object,
41                         gpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_read_return);
42         GnomeVFSResult (*write)(CaptiveFileObject *captive_file_object,
43                         gconstpointer buffer,GnomeVFSFileSize num_bytes,GnomeVFSFileSize *bytes_written_return);
44         GnomeVFSResult (*seek)
45                         (CaptiveFileObject *captive_file_object,GnomeVFSSeekPosition whence,GnomeVFSFileOffset offset);
46         GnomeVFSResult (*tell)(CaptiveFileObject *captive_file_object,GnomeVFSFileOffset *offset_return);
47         GnomeVFSResult (*remove)(CaptiveFileObject *captive_file_object);
48         GnomeVFSResult (*file_info_get)(CaptiveFileObject *captive_file_object,
49                         GnomeVFSFileInfo *file_info);
50         GnomeVFSResult (*file_info_set)(CaptiveFileObject *captive_file_object,
51                         const GnomeVFSFileInfo *info,GnomeVFSSetFileInfoMask mask);
52         GnomeVFSResult (*truncate)(CaptiveFileObject *captive_file_object,GnomeVFSFileSize file_size);
53         GnomeVFSResult (*move)(CaptiveFileObject *captive_file_object_old,const gchar *pathname_new,gboolean force_replace);
54         };
55
56 GnomeVFSResult captive_file_init(CaptiveFileObject *captive_file_object,CaptiveVfsObject *captive_vfs_object);
57
58 G_END_DECLS
59
60
61 #endif /* _CAPTIVE_CLIENT_PRIV_FILE_H */