2 * CORBA ORBit IDL definition of sandbox intra-captive interface
3 * Copyright (C) 2002-2003 Jan Kratochvil <project-captive@jankratochvil.net>
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
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.
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
22 typedef sequence<octet> Bytes;
25 typedef unsigned long GnomeVFSResult; /* enum */
26 exception GnomeVFSResultException {
27 GnomeVFSResult gnome_vfs_result;
31 typedef unsigned long GIOStatus; /* enum */
32 exception GIOStatusException {
33 GIOStatus g_io_status;
37 typedef unsigned long GLogLevelFlags; /* enum mask */
38 struct GLogMessage { /* accepted by 'GLogFunc' */
39 /* string log_domain; always "Captive" */
40 GLogLevelFlags log_level;
43 exception GLogMessageFatal {
44 GLogMessage g_log_message;
48 /* Do not use 'oneway' as we would loose logging order coherency. */
49 void g_log_func(in GLogMessage g_log_message);
53 typedef unsigned long GnomeVFSFileType; /* enum */
54 typedef unsigned short GnomeVFSFilePermissions;
55 typedef unsigned long guint;
56 typedef unsigned long long time_t;
57 typedef unsigned long long GnomeVFSFileSize;
58 typedef unsigned long long GnomeVFSFileFlags;
59 typedef long long GnomeVFSFileOffset;
60 typedef unsigned long GnomeVFSSeekPosition; /* enum */
61 typedef unsigned long GnomeVFSSetFileInfoMask; /* enum mask */
62 typedef unsigned long long GnomeVFSOpenMode; /* enum mask */
63 struct CaptiveFileInfoObject {
64 string name; /* Base name of the file (no path). */
65 /* File type (i.e. regular, directory, block device...). */
66 GnomeVFSFileType type;
68 GnomeVFSFilePermissions permissions; /* File permissions. */
69 boolean permissions_valid;
70 GnomeVFSFileSize size; /* Size in bytes. */
72 GnomeVFSFileSize block_count; /* Size measured in units of 512-byte blocks. */
73 boolean block_count_valid;
74 /* Access, modification and change times. */
75 time_t atime; /* not valid if ==(time_t)0 */
77 time_t mtime; /* not valid if ==(time_t)0 */
79 time_t ctime; /* not valid if ==(time_t)0 */
81 GnomeVFSFileFlags flags;
86 typedef long long GInt64;
87 typedef unsigned long long GUInt64;
88 typedef unsigned long GSeekType; /* enum */
89 typedef unsigned long GSize;
90 interface CaptiveIOChannel {
91 void read(out Bytes buffer,in GSize count)
92 raises (GIOStatusException,GLogMessageFatal);
93 void write(in Bytes buffer,out GSize bytes_written_return)
94 raises (GIOStatusException,GLogMessageFatal);
95 void seek(in GInt64 offset,in GSeekType type)
96 raises (GIOStatusException,GLogMessageFatal);
98 raises (GLogMessageFatal);
102 typedef unsigned long CaptiveOptionRwmode; /* enum */
103 typedef unsigned long CaptiveOptionMedia; /* enum */
104 struct CaptiveOptionsModule {
105 string pathname_utf8;
108 typedef sequence<CaptiveOptionsModule> CaptiveOptionsModuleList;
109 struct CaptiveOptions {
111 CaptiveOptionsModule filesystem;
112 CaptiveOptionRwmode rwmode;
113 CaptiveOptionMedia media;
114 boolean debug_messages;
115 CaptiveIOChannel image_iochannel;
116 CaptiveOptionsModuleList load_module;
120 typedef unsigned long GUInt32;
121 struct CaptiveVfsVolumeInfo {
125 GUInt64 bytes_available;
129 interface Directory {
130 void read(out CaptiveFileInfoObject file_info)
131 raises (GnomeVFSResultException,GLogMessageFatal);
133 raises (GnomeVFSResultException,GLogMessageFatal);
139 void read(out Bytes buffer,in GnomeVFSFileSize num_bytes)
140 raises (GnomeVFSResultException,GLogMessageFatal);
141 void write(in Bytes buffer,out GnomeVFSFileSize bytes_written_return)
142 raises (GnomeVFSResultException,GLogMessageFatal);
143 void seek(in GnomeVFSSeekPosition whence,in GnomeVFSFileOffset offset)
144 raises (GnomeVFSResultException,GLogMessageFatal);
145 void tell(out GnomeVFSFileOffset offset_return)
146 raises (GnomeVFSResultException,GLogMessageFatal);
148 raises (GnomeVFSResultException,GLogMessageFatal);
149 void file_info_get(out CaptiveFileInfoObject file_info)
150 raises (GnomeVFSResultException,GLogMessageFatal);
151 void file_info_set(in CaptiveFileInfoObject file_info,in GnomeVFSSetFileInfoMask mask)
152 raises (GnomeVFSResultException,GLogMessageFatal);
153 void truncate(in GnomeVFSFileSize file_size)
154 raises (GnomeVFSResultException,GLogMessageFatal);
155 void move(in string pathname_new,in boolean force_replace)
156 raises (GnomeVFSResultException,GLogMessageFatal);
162 void init(in CaptiveOptions options);
164 Directory directory_new_open(in string pathname)
165 raises (GnomeVFSResultException,GLogMessageFatal);
166 Directory directory_new_make(in string pathname,in GnomeVFSFilePermissions perm)
167 raises (GnomeVFSResultException,GLogMessageFatal);
168 File file_new_open(in string pathname,in GnomeVFSOpenMode mode)
169 raises (GnomeVFSResultException,GLogMessageFatal);
170 File file_new_create(in string pathname,in GnomeVFSOpenMode mode,in boolean exclusive,in unsigned long perm)
171 raises (GnomeVFSResultException,GLogMessageFatal);
172 void volume_info_get(out CaptiveVfsVolumeInfo volume_info)
173 raises (GnomeVFSResultException,GLogMessageFatal);