2 * Include file for cabextract - a program to extract Microsoft Cabinet files
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_CABEXTRACT_H
21 #define _CAPTIVE_INSTALL_ACQUIRE_CABEXTRACT_H 1
24 #include <glib/gtypes.h>
29 typedef unsigned char UBYTE; /* 8 bits exactly */
30 typedef unsigned short UWORD; /* 16 bits (or more) */
31 typedef unsigned int ULONG; /* 32 bits (or more) */
32 typedef signed int LONG; /* 32 bits (or more) */
35 struct cabinet *next; /* for making a list of cabinets */
36 struct acquire_cabinet *acquire_cabinet;
37 const char *filename; /* input name of cabinet */
38 off_t filelen; /* length of cabinet file */
39 off_t blocks_off; /* offset to data blocks in file */
40 struct cabinet *prevcab, *nextcab; /* multipart cabinet chains */
41 char *prevname, *nextname; /* and their filenames */
42 char *previnfo, *nextinfo; /* and their visible names */
43 struct folder *folders; /* first folder in this cabinet */
44 struct file *files; /* first file in this cabinet */
45 UBYTE block_resv; /* reserved space in datablocks */
46 UBYTE flags; /* header flags */
50 struct file *next; /* next file in sequence */
51 struct folder *folder; /* folder that contains this file */
52 char *filename; /* output name of file */
54 FILE *fh; /* open file handle or NULL */
56 ULONG length; /* uncompressed length of file */
57 ULONG offset; /* uncompressed offset in folder */
58 UWORD index; /* magic index number of folder */
59 UWORD time, date, attribs; /* MS-DOS time/date/attributes */
62 struct cabinet *find_cabs_in_file(struct acquire_cabinet *acquire_cabinet);
63 struct file *process_files(struct cabinet *basecab);
64 int extract_file(struct file *fi, int lower, int fix, char *dir);
69 #endif /* _CAPTIVE_INSTALL_ACQUIRE_CABEXTRACT_H */