#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "util.h"
#include "version.h"
#include "compat.h"
#include "options.h"
#include "help.h"
#include "image.h"
#include "log2lines.h"
Go to the source code of this file.
◆ check_directory()
int check_directory |
( |
int |
force | ) |
|
Definition at line 80 of file cache.c.
81{
86 char *check_iso;
88
91 if (check_iso &&
PATHCMP(check_iso,
".7z") == 0)
92 {
94
95
99 else
100 strcpy(compressed_7z_path,
".");
101
103
104
105
106
107 strcpy(check_iso,
".iso");
109 {
112 {
115 return 2;
116 }
117 }
118 else
120 }
121
122 if (check_iso &&
PATHCMP(check_iso,
".iso") == 0)
123 {
126 {
129 *check_iso = '\0';
132 {
136 }
137 else
139 }
140 else
141 {
143 return 1;
144 }
145 }
149 else
153 return 0;
154}
char * strcat(char *DstString, const char *SrcString)
char * strcpy(char *DstString, const char *SrcString)
static BOOL file_exists(const WCHAR *file_name)
static int check_dir(DOS_FS *fs, DOS_FILE **root, int dots)
#define sprintf(buf, format,...)
int __cdecl system(_In_opt_z_ const char *_Command)
_CRT_RESTORE_GCC_WARNINGS _CRT_DISABLE_GCC_WARNINGS _Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
◆ cleanable()
Definition at line 72 of file cache.c.
73{
75 return 1;
76 return 0;
77}
int strcmp(const char *String1, const char *String2)
static void basename(LPCWSTR path, LPWSTR name)
Referenced by check_directory().
◆ create_cache()
int create_cache |
( |
int |
force, |
|
|
int |
skipImageBase |
|
) |
| |
Definition at line 190 of file cache.c.
191{
195 size_t ImageBase;
196
198 {
199 l2l_dbg(1,
"Apparently %s is not writable (mounted ISO?), using current dir\n",
tmp_name);
202 }
203 else
204 {
208 }
209
210 if (force)
211 {
214 }
215 else
216 {
218 {
220 return 0;
221 }
222 }
223
225
231 {
235 return 2;
236 }
237 l2l_dbg(0,
"Creating cache ...");
238
240 {
242 {
244 {
247 continue;
248
250 if (*Fname == '\n')
251 *Fname = '\0';
252
254 Fname--;
256 Fname++;
257 if (*Fname && !skipImageBase)
258 {
260 fprintf(fw,
"%s|%s|%0x\n", Fname,
Line, (
unsigned int)ImageBase);
261 else
262 l2l_dbg(3,
"%s|%s|%0x, ERR=%d\n", Fname,
Line, (
unsigned int)ImageBase,
err);
263 }
264 }
266 }
269 }
271 return 0;
272}
ACPI_SIZE strlen(const char *String)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_ _CRTIMP FILE *__cdecl fopen(_In_z_ const char *_Filename, _In_z_ const char *_Mode)
_Check_return_opt_ _CRTIMP char *__cdecl fgets(_Out_writes_z_(_MaxCount) char *_Buf, _In_ int _MaxCount, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fclose(_Inout_ FILE *_File)
◆ read_cache()
Definition at line 157 of file cache.c.
158{
163
165
167 if (!fr)
168 {
170 return 2;
171 }
173
175 {
177 if (!pentry)
178 {
179 l2l_dbg(2,
"** Create entry failed of: %s\n",
Line);
180 }
181 else
183 }
184
187}
Referenced by main().
◆ unpack_iso()
Definition at line 27 of file cache.c.
28{
32 int iso_copied = 0;
34
37 {
38 l2l_dbg(1,
"Open of %s failed (locked for writing?), trying to copy first\n", iso);
39
42 return 3;
43 iso_copied = 1;
44 }
45 else
47
50 {
51 l2l_dbg(0,
"\nCannot unpack %s (check 7z path!)\n", iso_tmp);
54 }
55 else
56 {
57 l2l_dbg(2,
"\nUnpacking reactos.cab in %s\n",
dir);
60 {
61 l2l_dbg(0,
"\nCannot unpack reactos.cab in %s\n",
dir);
64 }
65 }
66 if (iso_copied)
69}
Referenced by check_directory().
◆ cache_name
◆ CacheName
◆ tmp_name
◆ TmpName