summaryrefslogtreecommitdiffstats
path: root/app-arch/p7zip/files/p7zip_4.44-libun7zip.patch
blob: e3216c461fc4f30df61286b78af8d0c864cf5a34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
diff -dPNur p7zip_4.44/CPP/7zip/Bundles/Un7Zip/makefile p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/makefile
--- p7zip_4.44/CPP/7zip/Bundles/Un7Zip/makefile	1970-01-01 01:00:00.000000000 +0100
+++ p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/makefile	2007-03-29 13:01:21.000000000 +0200
@@ -0,0 +1,84 @@
+PROG=libun7zip.so
+
+LOCAL_FLAGS= -I../../../Common/ -I../../../myWindows/ -I../../../ -I../../../include_windows/ \
+-DCOMPRESS_BCJ2 -DEXTRACT_ONLY -DEXCLUDE_COM -DNO_REGISTRY -DFORMAT_7Z \
+-DCOMPRESS_LZMA -DCOMPRESS_BCJ_X86 -DCOMPRESS_COPY -DCOMPRESS_PPMD -D_SFX $(RPM_OPT_FLAGS)
+
+include ../../../../makefile.machine
+
+LOCAL_SHARED=$(LINK_SHARED)
+LIBS=$(LOCAL_LIBS_DLL)
+
+MY_WINDOWS= \
+	$(MY_HOME)/myGetTickCount.o \
+	$(MY_HOME)/wine_date_and_time.o \
+	
+OBJS=\
+CoderMixer2.o\
+CoderMixer2MT.o\
+CoderMixer2ST.o\
+CrossThreadProgress.o\
+FilterCoder.o\
+ItemNameUtils.o\
+OutStreamWithCRC.o\
+ConsoleClose.o\
+ExtractCallbackConsole.o\
+ExtractCallbackNULL.o\
+List.o\
+OpenCallbackConsole.o\
+UserInputUtils.o\
+7zDecode.o\
+7zExtract.o\
+7zFolderOutStream.o\
+7zHandler.o\
+7zHeader.o\
+7zIn.o\
+7zMethodID.o\
+LZMADecoder.o\
+BranchCoder.o\
+x86.o\
+x86_2.o\
+PPMDDecoder.o\
+LZOutWindow.o\
+CopyCoder.o\
+Error.o\
+FileDir.o\
+FileFind.o\
+FileIO.o\
+FileName.o\
+PropVariant.o\
+PropVariantConversions.o\
+Synchronization.o\
+../../../Common/MyWindows.o\
+../../../Common/Alloc.o\
+../../../Common/StdInStream.o\
+../../../Common/StdOutStream.o\
+../../../Common/StringConvert.o\
+../../../Common/String.o\
+../../../Common/CRC.o\
+../../../Common/Vector.o\
+../../../Common/Wildcard.o\
+../../../Common/IntToString.o\
+FilePathAutoRename.o\
+FileStreams.o\
+InBuffer.o\
+LimitedStreams.o\
+LockedStream.o\
+OffsetStream.o\
+OutBuffer.o\
+ProgressUtils.o\
+StreamBinder.o\
+StreamObjects.o\
+StreamUtils.o\
+ArchiveExtractCallback.o\
+ArchiveOpenCallback.o\
+ArchiverInfo.o\
+DefaultName.o\
+Extract.o\
+ExtractingFilePath.o\
+OpenArchive.o\
+PropIDUtils.o\
+Un7Zip.o
+
+include ../../../../makefile.glb
+
diff -dPNur p7zip_4.44/CPP/7zip/Bundles/Un7Zip/makefile.depend p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/makefile.depend
--- p7zip_4.44/CPP/7zip/Bundles/Un7Zip/makefile.depend	1970-01-01 01:00:00.000000000 +0100
+++ p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/makefile.depend	2007-03-29 13:01:21.000000000 +0200
@@ -0,0 +1 @@
+ 
\ No newline at end of file
diff -dPNur p7zip_4.44/CPP/7zip/Bundles/Un7Zip/makefile.list p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/makefile.list
--- p7zip_4.44/CPP/7zip/Bundles/Un7Zip/makefile.list	1970-01-01 01:00:00.000000000 +0100
+++ p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/makefile.list	2007-03-29 13:01:21.000000000 +0200
@@ -0,0 +1,128 @@
+CoderMixer2.o : ../../Archive/Common/CoderMixer2.cpp
+	$(CXX) $(CFLAGS) ../../Archive/Common/CoderMixer2.cpp
+CoderMixer2MT.o : ../../Archive/Common/CoderMixer2MT.cpp
+	$(CXX) $(CFLAGS) ../../Archive/Common/CoderMixer2MT.cpp
+CoderMixer2ST.o : ../../Archive/Common/CoderMixer2ST.cpp
+	$(CXX) $(CFLAGS) ../../Archive/Common/CoderMixer2ST.cpp
+CrossThreadProgress.o : ../../Archive/Common/CrossThreadProgress.cpp
+	$(CXX) $(CFLAGS) ../../Archive/Common/CrossThreadProgress.cpp
+FilterCoder.o : ../../Archive/Common/FilterCoder.cpp
+	$(CXX) $(CFLAGS) ../../Archive/Common/FilterCoder.cpp
+ItemNameUtils.o : ../../Archive/Common/ItemNameUtils.cpp
+	$(CXX) $(CFLAGS) ../../Archive/Common/ItemNameUtils.cpp
+OutStreamWithCRC.o : ../../Archive/Common/OutStreamWithCRC.cpp
+	$(CXX) $(CFLAGS) ../../Archive/Common/OutStreamWithCRC.cpp
+ConsoleClose.o : ../../UI/Console/ConsoleClose.cpp
+	$(CXX) $(CFLAGS) ../../UI/Console/ConsoleClose.cpp
+ExtractCallbackConsole.o : ../../UI/Console/ExtractCallbackConsole.cpp
+	$(CXX) $(CFLAGS) ../../UI/Console/ExtractCallbackConsole.cpp
+ExtractCallbackNULL.o : ../../UI/Console/ExtractCallbackNULL.cpp
+	$(CXX) $(CFLAGS) ../../UI/Console/ExtractCallbackNULL.cpp
+List.o : ../../UI/Console/List.cpp
+	$(CXX) $(CFLAGS) ../../UI/Console/List.cpp
+OpenCallbackConsole.o : ../../UI/Console/OpenCallbackConsole.cpp
+	$(CXX) $(CFLAGS) ../../UI/Console/OpenCallbackConsole.cpp
+UserInputUtils.o : ../../UI/Console/UserInputUtils.cpp
+	$(CXX) $(CFLAGS) ../../UI/Console/UserInputUtils.cpp
+7zDecode.o : ../../Archive/7z/7zDecode.cpp
+	$(CXX) $(CFLAGS) ../../Archive/7z/7zDecode.cpp
+7zExtract.o : ../../Archive/7z/7zExtract.cpp
+	$(CXX) $(CFLAGS) ../../Archive/7z/7zExtract.cpp
+7zFolderOutStream.o : ../../Archive/7z/7zFolderOutStream.cpp
+	$(CXX) $(CFLAGS) ../../Archive/7z/7zFolderOutStream.cpp
+7zHandler.o : ../../Archive/7z/7zHandler.cpp
+	$(CXX) $(CFLAGS) ../../Archive/7z/7zHandler.cpp
+7zHeader.o : ../../Archive/7z/7zHeader.cpp
+	$(CXX) $(CFLAGS) ../../Archive/7z/7zHeader.cpp
+7zIn.o : ../../Archive/7z/7zIn.cpp
+	$(CXX) $(CFLAGS) ../../Archive/7z/7zIn.cpp
+7zMethodID.o : ../../Archive/7z/7zMethodID.cpp
+	$(CXX) $(CFLAGS) ../../Archive/7z/7zMethodID.cpp
+LZMADecoder.o : ../../Compress/LZMA/LZMADecoder.cpp
+	$(CXX) $(CFLAGS) ../../Compress/LZMA/LZMADecoder.cpp
+BranchCoder.o : ../../Compress/Branch/BranchCoder.cpp
+	$(CXX) $(CFLAGS) ../../Compress/Branch/BranchCoder.cpp
+x86.o : ../../Compress/Branch/x86.cpp
+	$(CXX) $(CFLAGS) ../../Compress/Branch/x86.cpp
+x86_2.o : ../../Compress/Branch/x86_2.cpp
+	$(CXX) $(CFLAGS) ../../Compress/Branch/x86_2.cpp
+PPMDDecoder.o : ../../Compress/PPMD/PPMDDecoder.cpp
+	$(CXX) $(CFLAGS) ../../Compress/PPMD/PPMDDecoder.cpp
+LZOutWindow.o : ../../Compress/LZ/LZOutWindow.cpp
+	$(CXX) $(CFLAGS) ../../Compress/LZ/LZOutWindow.cpp
+CopyCoder.o : ../../Compress/Copy/CopyCoder.cpp
+	$(CXX) $(CFLAGS) ../../Compress/Copy/CopyCoder.cpp
+Error.o : ../../../Windows/Error.cpp
+	$(CXX) $(CFLAGS) ../../../Windows/Error.cpp
+FileDir.o : ../../../Windows/FileDir.cpp
+	$(CXX) $(CFLAGS) ../../../Windows/FileDir.cpp
+FileFind.o : ../../../Windows/FileFind.cpp
+	$(CXX) $(CFLAGS) ../../../Windows/FileFind.cpp
+FileIO.o : ../../../Windows/FileIO.cpp
+	$(CXX) $(CFLAGS) ../../../Windows/FileIO.cpp
+FileName.o : ../../../Windows/FileName.cpp
+	$(CXX) $(CFLAGS) ../../../Windows/FileName.cpp
+PropVariant.o : ../../../Windows/PropVariant.cpp
+	$(CXX) $(CFLAGS) ../../../Windows/PropVariant.cpp
+PropVariantConversions.o : ../../../Windows/PropVariantConversions.cpp
+	$(CXX) $(CFLAGS) ../../../Windows/PropVariantConversions.cpp
+Synchronization.o : ../../../Windows/Synchronization.cpp
+	$(CXX) $(CFLAGS) ../../../Windows/Synchronization.cpp
+Alloc.o : ../../../Common/Alloc.cpp
+	$(CXX) $(CFLAGS) ../../../Common/Alloc.cpp
+CRC.o : ../../../Common/CRC.cpp
+	$(CXX) $(CFLAGS) ../../../Common/CRC.cpp
+IntToString.o : ../../../Common/IntToString.cpp
+	$(CXX) $(CFLAGS) ../../../Common/IntToString.cpp
+StdInStream.o : ../../../Common/StdInStream.cpp
+	$(CXX) $(CFLAGS) ../../../Common/StdInStream.cpp
+StdOutStream.o : ../../../Common/StdOutStream.cpp
+	$(CXX) $(CFLAGS) ../../../Common/StdOutStream.cpp
+String.o : ../../../Common/String.cpp
+	$(CXX) $(CFLAGS) ../../../Common/String.cpp
+StringConvert.o : ../../../Common/StringConvert.cpp
+	$(CXX) $(CFLAGS) ../../../Common/StringConvert.cpp
+Vector.o : ../../../Common/Vector.cpp
+	$(CXX) $(CFLAGS) ../../../Common/Vector.cpp
+Wildcard.o : ../../../Common/Wildcard.cpp
+	$(CXX) $(CFLAGS) ../../../Common/Wildcard.cpp
+FilePathAutoRename.o : ../../Common/FilePathAutoRename.cpp
+	$(CXX) $(CFLAGS) ../../Common/FilePathAutoRename.cpp
+FileStreams.o : ../../Common/FileStreams.cpp
+	$(CXX) $(CFLAGS) ../../Common/FileStreams.cpp
+InBuffer.o : ../../Common/InBuffer.cpp
+	$(CXX) $(CFLAGS) ../../Common/InBuffer.cpp
+LimitedStreams.o : ../../Common/LimitedStreams.cpp
+	$(CXX) $(CFLAGS) ../../Common/LimitedStreams.cpp
+LockedStream.o : ../../Common/LockedStream.cpp
+	$(CXX) $(CFLAGS) ../../Common/LockedStream.cpp
+OffsetStream.o : ../../Common/OffsetStream.cpp
+	$(CXX) $(CFLAGS) ../../Common/OffsetStream.cpp
+OutBuffer.o : ../../Common/OutBuffer.cpp
+	$(CXX) $(CFLAGS) ../../Common/OutBuffer.cpp
+ProgressUtils.o : ../../Common/ProgressUtils.cpp
+	$(CXX) $(CFLAGS) ../../Common/ProgressUtils.cpp
+StreamUtils.o : ../../Common/StreamUtils.cpp
+	$(CXX) $(CFLAGS) ../../Common/StreamUtils.cpp
+StreamBinder.o : ../../Common/StreamBinder.cpp
+	$(CXX) $(CFLAGS) ../../Common/StreamBinder.cpp
+StreamObjects.o : ../../Common/StreamObjects.cpp
+	$(CXX) $(CFLAGS) ../../Common/StreamObjects.cpp
+ArchiveExtractCallback.o : ../../UI/Common/ArchiveExtractCallback.cpp
+	$(CXX) $(CFLAGS) ../../UI/Common/ArchiveExtractCallback.cpp
+ArchiveOpenCallback.o : ../../UI/Common/ArchiveOpenCallback.cpp
+	$(CXX) $(CFLAGS) ../../UI/Common/ArchiveOpenCallback.cpp
+ArchiverInfo.o : ../../UI/Common/ArchiverInfo.cpp
+	$(CXX) $(CFLAGS) ../../UI/Common/ArchiverInfo.cpp
+DefaultName.o : ../../UI/Common/DefaultName.cpp
+	$(CXX) $(CFLAGS) ../../UI/Common/DefaultName.cpp
+Extract.o : ../../UI/Common/Extract.cpp
+	$(CXX) $(CFLAGS) ../../UI/Common/Extract.cpp
+ExtractingFilePath.o : ../../UI/Common/ExtractingFilePath.cpp
+	$(CXX) $(CFLAGS) ../../UI/Common/ExtractingFilePath.cpp
+OpenArchive.o : ../../UI/Common/OpenArchive.cpp
+	$(CXX) $(CFLAGS) ../../UI/Common/OpenArchive.cpp
+PropIDUtils.o : ../../UI/Common/PropIDUtils.cpp
+	$(CXX) $(CFLAGS) ../../UI/Common/PropIDUtils.cpp
+Un7Zip.o : ./Un7Zip.cpp
+	$(CXX) $(CFLAGS) ./Un7Zip.cpp
diff -dPNur p7zip_4.44/CPP/7zip/Bundles/Un7Zip/testlib.c p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/testlib.c
--- p7zip_4.44/CPP/7zip/Bundles/Un7Zip/testlib.c	1970-01-01 01:00:00.000000000 +0100
+++ p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/testlib.c	2007-03-29 13:01:21.000000000 +0200
@@ -0,0 +1,7 @@
+
+#include "u7zip.h"
+
+int main(int argc, char *argv[])
+{
+    return un7zip(argv[1], "/tmp", 0);
+}
diff -dPNur p7zip_4.44/CPP/7zip/Bundles/Un7Zip/u7zip.h p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/u7zip.h
--- p7zip_4.44/CPP/7zip/Bundles/Un7Zip/u7zip.h	1970-01-01 01:00:00.000000000 +0100
+++ p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/u7zip.h	2007-03-29 13:01:21.000000000 +0200
@@ -0,0 +1,19 @@
+#ifndef __UN7ZIP_H
+#define __UN7ZIP_H
+
+#define LIST_7Z    0
+#define TEST_7Z    1
+#define EXTRACT_7Z 2
+
+#define S_OK          0x00000000L
+#define S_FALSE       0x00000001L
+#define E_NOTIMPL     0x80004001L
+#define E_NOINTERFACE 0x80004002L
+#define E_ABORT       0x80004004L
+#define E_FAIL        0x80004005L
+#define E_OUTOFMEMORY 0x8007000EL
+#define E_INVALIDARG  0x80070057L
+
+int un7zip(char *name, char *dir, int command);
+
+#endif
diff -dPNur p7zip_4.44/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp
--- p7zip_4.44/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp	1970-01-01 01:00:00.000000000 +0100
+++ p7zip_4.44-new/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp	2007-03-29 12:50:00.000000000 +0200
@@ -0,0 +1,130 @@
+// Un7Zip.cpp
+
+#include "StdAfx.h"
+
+#include "Common/MyInitGuid.h"
+
+#include "Common/StdOutStream.h"
+#include "Common/Wildcard.h"
+#include "Common/StringConvert.h"
+#include "Common/MyCom.h"
+#include "Common/Exception.h"
+
+#include "Windows/FileDir.h"
+#include "Windows/FileName.h"
+#include "Windows/Defs.h"
+
+#include "../../IPassword.h"
+#include "../../ICoder.h"
+
+#include "../../UI/Common/OpenArchive.h"
+#include "../../UI/Common/DefaultName.h"
+#include "../../UI/Common/ExitCode.h"
+#include "../../UI/Common/Extract.h"
+
+#include "../../UI/Console/List.h"
+#include "../../UI/Console/OpenCallbackConsole.h"
+#include "../../UI/Console/ExtractCallbackNULL.h"
+
+
+static int Un7Zip(char *name, char *dir, int command);
+
+extern "C" {
+
+int un7zip(char *name, char *dir, int command)
+{
+    return Un7Zip(name, dir, command);
+}
+
+}
+
+using namespace NWindows;
+using namespace NFile;
+
+static const wchar_t *kUniversalWildcard = L"*";
+static bool AddNameToCensor(NWildcard::CCensor &wildcardCensor)
+{
+  wildcardCensor.AddItem(true, kUniversalWildcard, false);
+  return true;
+}
+
+static int Un7Zip(char *name, char *dir, int commands)
+{
+  
+  CStdOutStream *g_StdStream = &g_StdOut;
+
+  NWildcard::CCensor wildcardCensor;
+  AddNameToCensor(wildcardCensor);
+  bool passwordEnabled = 1;
+  UString password = L"null";
+  
+  UString outputDir= MultiByteToUnicodeString(dir);
+  UString archiveName = MultiByteToUnicodeString(name);
+
+  NFind::CFileInfoW archiveFileInfo;
+
+  if (!NFind::FindFile(archiveName, archiveFileInfo))
+        return S_FALSE;
+  if (archiveFileInfo.IsDirectory())
+        return S_FALSE;
+
+  {
+
+    UStringVector v1, v2;
+    v1.Add(archiveName);
+    v2.Add(archiveName);
+
+    const NWildcard::CCensorNode &wildcardCensorHead = 
+      wildcardCensor.Pairs.Front().Head;
+
+    if(commands > 0)
+    {
+      CExtractCallbackNULL *ecs = new CExtractCallbackNULL;
+      CMyComPtr<IFolderArchiveExtractCallback> extractCallback = ecs;
+      ecs->OutStream = g_StdStream;
+      ecs->PasswordIsDefined = passwordEnabled;
+      ecs->Password = password;
+      ecs->Init();
+
+      COpenCallbackConsole openCallback;
+      openCallback.OutStream = g_StdStream;
+      openCallback.PasswordIsDefined = passwordEnabled;
+      openCallback.Password = password;
+
+      CExtractOptions eo;
+      eo.StdOutMode = false;
+      eo.PathMode = NExtract::NPathMode::kFullPathnames;
+      if(commands == 1)
+        eo.TestMode = 1;
+      else
+        eo.TestMode = 0;
+      eo.OverwriteMode = NExtract::NOverwriteMode::kWithoutPrompt;
+      eo.OutputDir = outputDir;
+      eo.YesToAll = 1;
+
+      UString errorMessage;
+      HRESULT result = DecompressArchives(
+          v1, v2,
+          wildcardCensorHead, 
+          eo, &openCallback, ecs, errorMessage);
+
+      if (ecs->NumArchiveErrors != 0 || ecs->NumFileErrors != 0)
+        return S_FALSE;
+      if (result != S_OK)
+        return S_FALSE;
+    }
+    else
+    {
+      HRESULT result = ListArchives(
+          v1, v2,
+          wildcardCensorHead, 
+          true, 
+	  false,
+          passwordEnabled, 
+          password);
+      if (result != S_OK)
+          return S_FALSE;;
+    }
+  }
+  return S_OK;
+}
diff -dPNur p7zip_4.44/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp p7zip_4.44-new/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp
--- p7zip_4.44/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp	1970-01-01 01:00:00.000000000 +0100
+++ p7zip_4.44-new/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp	2007-03-29 12:55:02.000000000 +0200
@@ -0,0 +1,132 @@
+// ExtractCallbackNULL.cpp
+
+#include "StdAfx.h"
+
+#include "ExtractCallbackNULL.h"
+#include "UserInputUtils.h"
+#include "ConsoleClose.h"
+
+#include "Common/Wildcard.h"
+
+#include "Windows/FileDir.h"
+#include "Windows/FileFind.h"
+#include "Windows/Time.h"
+#include "Windows/Defs.h"
+#include "Windows/PropVariant.h"
+#include "Windows/Error.h"
+#include "Windows/PropVariantConversions.h"
+
+#include "../../Common/FilePathAutoRename.h"
+
+#include "../Common/ExtractingFilePath.h"
+
+using namespace NWindows;
+using namespace NFile;
+using namespace NDirectory;
+
+STDMETHODIMP CExtractCallbackNULL::SetTotal(UInt64 size)
+{
+  if (NConsoleClose::TestBreakSignal())
+    return E_ABORT;
+  return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackNULL::SetCompleted(const UInt64 *completeValue)
+{
+  if (NConsoleClose::TestBreakSignal())
+    return E_ABORT;
+  return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackNULL::AskOverwrite(
+    const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
+    const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
+    Int32 *answer)
+{
+  
+  NUserAnswerMode::EEnum overwriteAnswer = ScanUserYesNoAllQuit(OutStream);
+  
+  switch(overwriteAnswer)
+  {
+    case NUserAnswerMode::kQuit:
+      return E_ABORT;
+    case NUserAnswerMode::kNo:
+      *answer = NOverwriteAnswer::kNo;
+      break;
+    case NUserAnswerMode::kNoAll:
+      *answer = NOverwriteAnswer::kNoToAll;
+      break;
+    case NUserAnswerMode::kYesAll:
+      *answer = NOverwriteAnswer::kYesToAll;
+      break;
+    case NUserAnswerMode::kYes:
+      *answer = NOverwriteAnswer::kYes;
+      break;
+    case NUserAnswerMode::kAutoRename:
+      *answer = NOverwriteAnswer::kAutoRename;
+      break;
+    default:
+      return E_FAIL;
+  }
+  return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackNULL::PrepareOperation(const wchar_t *name, Int32 askExtractMode, const UInt64 *position)
+{
+  return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackNULL::MessageError(const wchar_t *message)
+{
+  return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackNULL::SetOperationResult(Int32 operationResult, bool encrypted)
+{
+  return S_OK;
+}
+
+STDMETHODIMP CExtractCallbackNULL::CryptoGetTextPassword(BSTR *password)
+{
+  if (!PasswordIsDefined)
+  {
+    Password = GetPassword(OutStream); 
+    PasswordIsDefined = true;
+  }
+  CMyComBSTR tempName(Password);
+  *password = tempName.Detach();
+  return S_OK;
+}
+
+HRESULT CExtractCallbackNULL::BeforeOpen(const wchar_t *name)
+{
+  return S_OK;
+}
+
+HRESULT CExtractCallbackNULL::OpenResult(const wchar_t *name, HRESULT result, bool encrypted)
+{
+  return S_OK;
+}
+  
+HRESULT CExtractCallbackNULL::ThereAreNoFiles()
+{
+  return S_OK;
+}
+
+HRESULT CExtractCallbackNULL::ExtractResult(HRESULT result)
+{
+  if (result == S_OK)
+    return result;
+  if (result == E_ABORT)
+    return result;
+  if (result == E_OUTOFMEMORY)
+    return result;
+  return S_OK;
+}
+
+HRESULT CExtractCallbackNULL::SetPassword(const UString &password)
+{
+  PasswordIsDefined = true;
+  Password = password;
+  return S_OK;
+}
diff -dPNur p7zip_4.44/CPP/7zip/UI/Console/ExtractCallbackNULL.h p7zip_4.44-new/CPP/7zip/UI/Console/ExtractCallbackNULL.h
--- p7zip_4.44/CPP/7zip/UI/Console/ExtractCallbackNULL.h	1970-01-01 01:00:00.000000000 +0100
+++ p7zip_4.44-new/CPP/7zip/UI/Console/ExtractCallbackNULL.h	2007-03-29 12:55:12.000000000 +0200
@@ -0,0 +1,65 @@
+// ExtractCallbackNULL.h
+
+#ifndef __EXTRACTCALLBACKCONSOLE_H
+#define __EXTRACTCALLBACKCONSOLE_H
+
+#include "Common/String.h"
+#include "Common/StdOutStream.h"
+#include "../../Common/FileStreams.h"
+#include "../../IPassword.h"
+#include "../../Archive/IArchive.h"
+#include "../Common/ArchiveExtractCallback.h"
+
+class CExtractCallbackNULL: 
+  public IExtractCallbackUI,
+  public ICryptoGetTextPassword,
+  public CMyUnknownImp
+{
+public:
+  MY_UNKNOWN_IMP2(IFolderArchiveExtractCallback, ICryptoGetTextPassword)
+
+  STDMETHOD(SetTotal)(UInt64 total);
+  STDMETHOD(SetCompleted)(const UInt64 *completeValue);
+
+  // IFolderArchiveExtractCallback
+  STDMETHOD(AskOverwrite)(
+      const wchar_t *existName, const FILETIME *existTime, const UInt64 *existSize,
+      const wchar_t *newName, const FILETIME *newTime, const UInt64 *newSize,
+      Int32 *answer);
+  STDMETHOD (PrepareOperation)(const wchar_t *name, Int32 askExtractMode, const UInt64 *position);
+
+  STDMETHOD(MessageError)(const wchar_t *message);
+  STDMETHOD(SetOperationResult)(Int32 operationResult, bool encrypted);
+
+  // ICryptoGetTextPassword
+  STDMETHOD(CryptoGetTextPassword)(BSTR *password);
+
+  HRESULT BeforeOpen(const wchar_t *name);
+  HRESULT OpenResult(const wchar_t *name, HRESULT result, bool encrypted);
+  HRESULT ThereAreNoFiles();
+  HRESULT ExtractResult(HRESULT result);
+
+  HRESULT SetPassword(const UString &password);
+
+public:
+  bool PasswordIsDefined;
+  UString Password;
+  
+  UInt64 NumArchives;
+  UInt64 NumArchiveErrors;
+  UInt64 NumFileErrors;
+  UInt64 NumFileErrorsInCurrentArchive;
+
+  CStdOutStream *OutStream;
+
+  void Init()
+  {
+    NumArchives = 0;
+    NumArchiveErrors = 0;
+    NumFileErrors = 0;
+    NumFileErrorsInCurrentArchive = 0;
+  }
+
+};
+
+#endif