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>
27 #include "cabinet-memory.h"
32 /* It is not 'GObject'-based as we will move to GnomeVFS handler cabextract://
36 struct acquire_cabinet {
39 GnomeVFSFileOffset offset;
40 GnomeVFSHandle **handlep;
41 GnomeVFSFileSize size;
42 const gchar *filename;
44 GnomeVFSURI *handle_uri;
45 void (*seek)(struct acquire_cabinet *acquire_cabinet,GnomeVFSFileOffset offset);
46 void (*seek_skip)(struct acquire_cabinet *acquire_cabinet,GnomeVFSFileOffset offset);
47 GnomeVFSFileOffset (*tell)(struct acquire_cabinet *acquire_cabinet);
48 GnomeVFSResult (*read)
49 (struct acquire_cabinet *acquire_cabinet,gpointer buffer,GnomeVFSFileSize bytes,GnomeVFSFileSize *bytes_read);
50 gint cabinet_done,cabinet_used;
51 CaptiveAcquireCabinetMemoryObject *memory; /* cabextract/cabextract.c memory leaks tracker */
54 void acquire_cabinet_seek(struct acquire_cabinet *acquire_cabinet,GnomeVFSFileOffset offset);
55 void acquire_cabinet_seek_skip(struct acquire_cabinet *acquire_cabinet,GnomeVFSFileOffset offset);
56 GnomeVFSFileOffset acquire_cabinet_tell(struct acquire_cabinet *acquire_cabinet);
57 GnomeVFSResult acquire_cabinet_read
58 (struct acquire_cabinet *acquire_cabinet,gpointer buffer,GnomeVFSFileSize bytes,GnomeVFSFileSize *bytes_read);
60 struct acquire_cabinet *acquire_cabinet_new_from_memory
61 (gconstpointer file_base,size_t file_length,GnomeVFSURI *uri,gint cabinet_used);
62 struct acquire_cabinet *acquire_cabinet_new_from_handle
63 (GnomeVFSHandle **handlep,GnomeVFSFileInfo *file_info,GnomeVFSURI *uri,gint cabinet_used);
64 void acquire_cabinet_free(struct acquire_cabinet *acquire_cabinet);
65 void acquire_cabinet_load(struct acquire_cabinet *acquire_cabinet);
70 #endif /* _CAPTIVE_INSTALL_ACQUIRE_CABINET_H */