annotate unrarlib.h @ 13832:2f8cfe66dbfd

Different buffering scheme, avoiding possible races (SDL is using threads!).
author reimar
date Sun, 31 Oct 2004 21:02:47 +0000
parents 6e35326c742f
children 775330fe3889
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7446
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
1 /* ***************************************************************************
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
2 **
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
3 ** This file is part of the UniquE RAR File Library.
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
4 **
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
5 ** Copyright (C) 2000-2002 by Christian Scheurer (www.ChristianScheurer.ch)
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
6 ** UNIX port copyright (c) 2000-2002 by Johannes Winkelmann (jw@tks6.net)
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
7 **
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
8 ** The contents of this file are subject to the UniquE RAR File Library
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
9 ** License (the "unrarlib-license.txt"). You may not use this file except
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
10 ** in compliance with the License. You may obtain a copy of the License
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
11 ** at http://www.unrarlib.org/license.html.
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
12 ** Software distributed under the License is distributed on an "AS IS"
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
13 ** basis, WITHOUT WARRANTY OF ANY KIND, either express or implied warranty.
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
14 **
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
15 ** Alternatively, the contents of this file may be used under the terms
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
16 ** of the GNU General Public License Version 2 or later (the "GPL"), in
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
17 ** which case the provisions of the GPL are applicable instead of those
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
18 ** above. If you wish to allow use of your version of this file only
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
19 ** under the terms of the GPL and not to allow others to use your version
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
20 ** of this file under the terms of the UniquE RAR File Library License,
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
21 ** indicate your decision by deleting the provisions above and replace
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
22 ** them with the notice and other provisions required by the GPL. If you
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
23 ** do not delete the provisions above, a recipient may use your version
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
24 ** of this file under the terms of the GPL or the UniquE RAR File Library
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
25 ** License.
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
26 **
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
27 ************************************************************************** */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
28
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
29 /* include file for the "UniquE RAR File Library" */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
30 /* (C) 2000-2002 by Christian Scheurer aka. UniquE */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
31 /* multi-OS version (Win32, Linux and SUN) */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
32
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
33 #ifndef __URARLIB_H
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
34 #define __URARLIB_H
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
35
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
36 #ifdef __cplusplus
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
37 extern "C"
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
38 {
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
39 #endif
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
40
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
41
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
42 /* ************************************************************************ */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
43 /* ************************************************************************ */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
44 /* ** ** */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
45 /* ** CONFIGURATION of the UniquE RAR FileLib ** */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
46 /* ** ==> you may change the setting for the lib HERE! ** */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
47 /* ** ** */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
48 /* ************************************************************************ */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
49 /* ************************************************************************ */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
50
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
51
8053
e550de4bd477 disabled DEBUG_LOG, noticed by Bernd Ernesti <mplayer@lists.veego.de>
alex
parents: 7446
diff changeset
52 /*#define _DEBUG_LOG*/ /* generate debug messages */
7446
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
53
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
54 #define _DO_CRC32_CHECK /* perform cyclical redundancy */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
55 /* check (CRC32) - disable this */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
56 /* for a little speed-up */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
57 /*#define _USE_ASM*/ /*
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
58 * enable assembly extensions
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
59 * x86 cpus.
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
60 */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
61
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
62 /*#define _USE_MEMORY_TO_MEMORY_DECOMPRESSION*/ /* read file from memory or a */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
63 /* resource instead of reading */
11000
6e35326c742f many small typo and grammar fixes
gabucino
parents: 8053
diff changeset
64 /* from a file. NOTE: you won't */
7446
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
65 /* be able to decompress from */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
66 /* file if you enable this */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
67 /* option! */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
68
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
69
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
70 #ifdef WIN32 /* autodetect Win32 and Linux */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
71 #define _WIN_32 /* Win32 with VisualC */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
72 #define _DEBUG_LOG_FILE "C:\\temp\\debug_unrar.txt" /* log file path */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
73 #else
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
74 #define _UNIX /* Linux or Unix with GCC */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
75 #define _DEBUG_LOG_FILE "/tmp/debug_unrar.txt" /* log file path */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
76 /*#define NON_INTEL_BYTE_ORDER*/ /* GCC on motorola systems */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
77
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
78 #endif
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
79
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
80 /* ------------------------------------------------------------------------ */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
81
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
82
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
83
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
84 /* -- global type definitions --------------------------------------------- */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
85
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
86 #ifdef NON_INTEL_BYTE_ORDER
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
87 #ifdef _USE_ASM
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
88 #warning Disabling assembly because NON_INTEL_BYTE_ORDER is set
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
89 #undef _USE_ASM
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
90 #endif
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
91 #endif
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
92
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
93 #ifdef _WIN_32
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
94 typedef unsigned char UBYTE; /* WIN32 definitions */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
95 typedef unsigned short UWORD;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
96 typedef unsigned long UDWORD;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
97 #endif
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
98
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
99 #ifdef _UNIX /* LINUX/UNIX definitions */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
100 typedef unsigned char UBYTE;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
101 typedef unsigned short UWORD;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
102 typedef unsigned long UDWORD;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
103 #endif
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
104
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
105
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
106 /* This structure is used for listing archive content */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
107 struct RAR20_archive_entry /* These infos about files are */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
108 { /* stored in RAR v2.0 archives */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
109 char *Name;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
110 UWORD NameSize;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
111 UDWORD PackSize;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
112 UDWORD UnpSize;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
113 UBYTE HostOS; /* MSDOS=0,OS2=1,WIN32=2,UNIX=3 */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
114 UDWORD FileCRC;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
115 UDWORD FileTime;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
116 UBYTE UnpVer;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
117 UBYTE Method;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
118 UDWORD FileAttr;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
119 };
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
120
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
121 typedef struct archivelist /* used to list archives */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
122 {
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
123 struct RAR20_archive_entry item;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
124 struct archivelist *next;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
125 } ArchiveList_struct;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
126
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
127
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
128 #ifdef _USE_MEMORY_TO_MEMORY_DECOMPRESSION
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
129 typedef struct memory_file /* used to decompress files in */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
130 { /* memory */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
131 void *data; /* pointer to the file data */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
132 unsigned long size; /* total size of the file data */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
133 unsigned long offset; /* offset within "memory-file" */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
134 } MemoryFile;
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
135 #endif
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
136
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
137 /* -- global functions ---------------------------------------------------- */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
138
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
139 /* urarlib_get:
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
140 * decompresses and decrypt data from a RAR file to a buffer in system memory.
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
141 *
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
142 * input: *output pointer to an empty char*. This pointer will show
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
143 * to the extracted data
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
144 * *size shows where to write the size of the decompressed
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
145 * file
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
146 * (**NOTE: URARLib _does_ memory allocation etc.!**)
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
147 * *filename pointer to string containing the file to decompress
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
148 * *rarfile pointer to a string with the full name and path of
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
149 * the RAR file or pointer to a RAR file in memory if
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
150 * memory-to-memory decompression is active.
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
151 * *libpassword pointer to a string with the password used to
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
152 * en-/decrypt the RAR
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
153 * output: int returns TRUE on success or FALSE on error
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
154 * (FALSE=0, TRUE=1)
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
155 */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
156
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
157 extern int urarlib_get(void *output,
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
158 unsigned long *size,
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
159 char *filename,
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
160 void *rarfile,
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
161 char *libpassword);
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
162
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
163
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
164
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
165 /* urarlib_list:
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
166 * list the content of a RAR archive.
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
167 *
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
168 * input: *rarfile pointer to a string with the full name and path of
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
169 * the RAR file or pointer to a RAR file in memory if
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
170 * memory-to-memory decompression is active.
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
171 * *list pointer to an ArchiveList_struct that can be
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
172 * filled with details about the archive
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
173 * to the extracted data
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
174 * output: int number of files/directories within archive
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
175 */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
176
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
177 extern int urarlib_list(void *rarfile, ArchiveList_struct *list);
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
178
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
179
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
180 /* urarlib_freelist:
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
181 * (after the suggestion and code of Duy Nguyen, Sean O'Blarney
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
182 * and Johannes Winkelmann who independently wrote a patch)
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
183 * free the memory of a ArchiveList_struct created by urarlib_list.
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
184 *
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
185 * input: *list pointer to an ArchiveList_struct
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
186 * output: -
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
187 */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
188
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
189 extern void urarlib_freelist(ArchiveList_struct *list);
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
190
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
191 /* ------------------------------------------------------------------------ */
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
192
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
193
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
194
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
195 #ifdef __cplusplus
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
196 };
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
197 #endif
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
198
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
199 #endif
ad00ad5f25a9 Automatic unrar of vobsub. Does not work with rar v3
kmkaplan
parents:
diff changeset
200