2 * Include file for drivers acquiring installation utility
3 * Copyright (C) 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
20 #ifndef _CAPTIVE_INSTALL_ACQUIRE_CABINET_H
21 #define _CAPTIVE_INSTALL_ACQUIRE_CABINET_H 1
24 #include <glib/gtypes.h>
25 #include <libgnomevfs/gnome-vfs-file-size.h>
26 #include <libgnomevfs/gnome-vfs-handle.h>
31 /* It is not 'GObject'-based as we will move to GnomeVFS handler cabextract://
35 struct acquire_cabinet {
38 GnomeVFSFileOffset offset;
39 GnomeVFSHandle **handlep;
40 GnomeVFSFileSize size;
41 const gchar *filename;
43 GnomeVFSURI *handle_uri;
44 void (*seek)(struct acquire_cabinet *acquire_cabinet,GnomeVFSFileOffset offset);
45 void (*seek_skip)(struct acquire_cabinet *acquire_cabinet,GnomeVFSFileOffset offset);
46 GnomeVFSFileOffset (*tell)(struct acquire_cabinet *acquire_cabinet);
47 GnomeVFSResult (*read)
48 (struct acquire_cabinet *acquire_cabinet,gpointer buffer,GnomeVFSFileSize bytes,GnomeVFSFileSize *bytes_read);
49 gint cabinet_done,cabinet_used;
52 void acquire_cabinet_seek(struct acquire_cabinet *acquire_cabinet,GnomeVFSFileOffset offset);
53 void acquire_cabinet_seek_skip(struct acquire_cabinet *acquire_cabinet,GnomeVFSFileOffset offset);
54 GnomeVFSFileOffset acquire_cabinet_tell(struct acquire_cabinet *acquire_cabinet);
55 GnomeVFSResult acquire_cabinet_read
56 (struct acquire_cabinet *acquire_cabinet,gpointer buffer,GnomeVFSFileSize bytes,GnomeVFSFileSize *bytes_read);
58 struct acquire_cabinet *acquire_cabinet_new_from_memory
59 (gconstpointer file_base,size_t file_length,GnomeVFSURI *uri,gint cabinet_used);
60 struct acquire_cabinet *acquire_cabinet_new_from_handle
61 (GnomeVFSHandle **handlep,GnomeVFSFileInfo *file_info,GnomeVFSURI *uri,gint cabinet_used);
62 void acquire_cabinet_free(struct acquire_cabinet *acquire_cabinet);
63 void acquire_cabinet_load(struct acquire_cabinet *acquire_cabinet);
68 #endif /* _CAPTIVE_INSTALL_ACQUIRE_CABINET_H */