summaryrefslogtreecommitdiffstats
path: root/app-arch/p7zip/files/p7zip_4.57-libun7zip.patch
blob: 07a3188fecb7fe6e6a71e919c88e61dbf7eb39ab (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
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Un7Zip/makefile p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/makefile
--- p7zip_4.57/CPP/7zip/Bundles/Un7Zip/makefile	1970-01-01 01:00:00.000000000 +0100
+++ p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/makefile	2008-04-11 19:39:40.000000000 +0200
@@ -0,0 +1,99 @@
+PROG=libun7zip.so
+
+LOCAL_FLAGS= \
+  -DEXTRACT_ONLY \
+  -DNO_READ_FROM_CODER \
+  -D_SFX
+
+include ../../../../makefile.crc32
+include ../../../../makefile.machine
+
+LOCAL_SHARED=$(LINK_SHARED)
+LIBS=$(LOCAL_LIBS_DLL)
+
+OBJS=\
+myGetTickCount.o\
+wine_date_and_time.o\
+mySplitCommandLine.o\
+CommandLineParser.o\
+CRC.o\
+IntToString.o\
+StdInStream.o\
+StdOutStream.o\
+MyString.o\
+MyWindows.o\
+StringConvert.o\
+MyVector.o\
+Wildcard.o\
+CoderMixer2.o\
+CoderMixer2MT.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\
+7zRegister.o\
+LZMADecoder.o\
+LZMARegister.o\
+BranchCoder.o\
+x86.o\
+x86_2.o\
+PPMDDecoder.o\
+PPMDRegister.o\
+LZOutWindow.o\
+CopyCoder.o\
+CopyRegister.o\
+7zAES.o\
+7zAESRegister.o\
+MyAES.o\
+Error.o\
+FileDir.o\
+FileFind.o\
+FileIO.o\
+FileName.o\
+PropVariant.o\
+PropVariantConversions.o\
+Synchronization.o\
+System.o\
+FilePathAutoRename.o\
+FileStreams.o\
+InBuffer.o\
+LimitedStreams.o\
+LockedStream.o\
+StreamUtils.o\
+OutBuffer.o\
+ProgressUtils.o\
+StreamBinder.o\
+StreamObjects.o\
+VirtThread.o \
+ArchiveExtractCallback.o\
+ArchiveOpenCallback.o\
+DefaultName.o\
+LoadCodecs.o\
+Extract.o\
+ExtractingFilePath.o\
+OpenArchive.o\
+PropIDUtils.o\
+CreateCoder.o\
+Sha256.o \
+BranchX86.o \
+BCJ2Register.o\
+BCJRegister.o\
+Threads.o\
+$(OBJ_CRC32) \
+Aes.o \
+Un7Zip.o
+
+include ../../../../makefile.glb
+
diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Un7Zip/makefile.depend p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/makefile.depend
--- p7zip_4.57/CPP/7zip/Bundles/Un7Zip/makefile.depend	1970-01-01 01:00:00.000000000 +0100
+++ p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/makefile.depend	2008-04-11 18:37:10.000000000 +0200
@@ -0,0 +1 @@
+ 
\ No newline at end of file
diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Un7Zip/makefile.list p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/makefile.list
--- p7zip_4.57/CPP/7zip/Bundles/Un7Zip/makefile.list	1970-01-01 01:00:00.000000000 +0100
+++ p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/makefile.list	2008-04-11 19:19:43.000000000 +0200
@@ -0,0 +1,180 @@
+wine_date_and_time.o : ../../../myWindows/wine_date_and_time.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../myWindows/wine_date_and_time.cpp
+myGetTickCount.o : ../../../myWindows/myGetTickCount.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../myWindows/myGetTickCount.cpp 
+mySplitCommandLine.o : ../../../myWindows/mySplitCommandLine.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../myWindows/mySplitCommandLine.cpp
+CommandLineParser.o : ../../../Common/CommandLineParser.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/CommandLineParser.cpp
+CRC.o : ../../../Common/CRC.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/CRC.cpp
+IntToString.o : ../../../Common/IntToString.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/IntToString.cpp
+ListFileUtils.o : ../../../Common/ListFileUtils.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/ListFileUtils.cpp
+MyWindows.o : ../../../Common/MyWindows.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/MyWindows.cpp
+Random.o : ../../../Common/Random.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/Random.cpp
+StdInStream.o : ../../../Common/StdInStream.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/StdInStream.cpp
+StdOutStream.o : ../../../Common/StdOutStream.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/StdOutStream.cpp
+MyString.o : ../../../Common/MyString.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/MyString.cpp
+StringConvert.o : ../../../Common/StringConvert.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/StringConvert.cpp
+StringToInt.o : ../../../Common/StringToInt.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/StringToInt.cpp
+UTFConvert.o : ../../../Common/UTFConvert.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/UTFConvert.cpp
+MyVector.o : ../../../Common/MyVector.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/MyVector.cpp
+Wildcard.o : ../../../Common/Wildcard.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Common/Wildcard.cpp
+CoderMixer2.o : ../../Archive/Common/CoderMixer2.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/Common/CoderMixer2.cpp
+CoderMixer2MT.o : ../../Archive/Common/CoderMixer2MT.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/Common/CoderMixer2MT.cpp
+CrossThreadProgress.o : ../../Archive/Common/CrossThreadProgress.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/Common/CrossThreadProgress.cpp
+ItemNameUtils.o : ../../Archive/Common/ItemNameUtils.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/Common/ItemNameUtils.cpp
+OutStreamWithCRC.o : ../../Archive/Common/OutStreamWithCRC.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/Common/OutStreamWithCRC.cpp
+ConsoleClose.o : ../../UI/Console/ConsoleClose.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Console/ConsoleClose.cpp
+ExtractCallbackConsole.o : ../../UI/Console/ExtractCallbackConsole.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Console/ExtractCallbackConsole.cpp
+List.o : ../../UI/Console/List.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Console/List.cpp
+MainAr.o : ../../UI/Console/MainAr.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Console/MainAr.cpp
+OpenCallbackConsole.o : ../../UI/Console/OpenCallbackConsole.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Console/OpenCallbackConsole.cpp
+UserInputUtils.o : ../../UI/Console/UserInputUtils.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Console/UserInputUtils.cpp
+7zDecode.o : ../../Archive/7z/7zDecode.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/7z/7zDecode.cpp
+7zExtract.o : ../../Archive/7z/7zExtract.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/7z/7zExtract.cpp
+7zFolderOutStream.o : ../../Archive/7z/7zFolderOutStream.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/7z/7zFolderOutStream.cpp
+7zHandler.o : ../../Archive/7z/7zHandler.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/7z/7zHandler.cpp
+7zHeader.o : ../../Archive/7z/7zHeader.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/7z/7zHeader.cpp
+7zIn.o : ../../Archive/7z/7zIn.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/7z/7zIn.cpp
+LZMADecoder.o : ../../Compress/LZMA/LZMADecoder.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/LZMA/LZMADecoder.cpp
+BranchCoder.o : ../../Compress/Branch/BranchCoder.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/Branch/BranchCoder.cpp
+x86.o : ../../Compress/Branch/x86.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/Branch/x86.cpp
+x86_2.o : ../../Compress/Branch/x86_2.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/Branch/x86_2.cpp
+PPMDDecoder.o : ../../Compress/PPMD/PPMDDecoder.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/PPMD/PPMDDecoder.cpp
+LZOutWindow.o : ../../Compress/LZ/LZOutWindow.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/LZ/LZOutWindow.cpp
+CopyCoder.o : ../../Compress/Copy/CopyCoder.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/Copy/CopyCoder.cpp
+7zAES.o : ../../Crypto/7zAES/7zAES.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Crypto/7zAES/7zAES.cpp
+MyAES.o : ../../Crypto/AES/MyAES.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Crypto/AES/MyAES.cpp
+Sha256.o : ../../Crypto/Hash/Sha256.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Crypto/Hash/Sha256.cpp
+Error.o : ../../../Windows/Error.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/Error.cpp
+FileDir.o : ../../../Windows/FileDir.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/FileDir.cpp
+FileFind.o : ../../../Windows/FileFind.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/FileFind.cpp
+FileIO.o : ../../../Windows/FileIO.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/FileIO.cpp
+FileName.o : ../../../Windows/FileName.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/FileName.cpp
+PropVariant.o : ../../../Windows/PropVariant.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/PropVariant.cpp
+PropVariantConversions.o : ../../../Windows/PropVariantConversions.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/PropVariantConversions.cpp
+Synchronization.o : ../../../Windows/Synchronization.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/Synchronization.cpp
+System.o : ../../../Windows/System.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../../Windows/System.cpp
+CreateCoder.o : ../../Common/CreateCoder.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/CreateCoder.cpp
+FilePathAutoRename.o : ../../Common/FilePathAutoRename.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/FilePathAutoRename.cpp
+FileStreams.o : ../../Common/FileStreams.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/FileStreams.cpp
+FilterCoder.o : ../../Common/FilterCoder.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/FilterCoder.cpp
+InBuffer.o : ../../Common/InBuffer.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/InBuffer.cpp
+LimitedStreams.o : ../../Common/LimitedStreams.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/LimitedStreams.cpp
+LockedStream.o : ../../Common/LockedStream.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/LockedStream.cpp
+StreamUtils.o : ../../Common/StreamUtils.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/StreamUtils.cpp
+OutBuffer.o : ../../Common/OutBuffer.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/OutBuffer.cpp
+ProgressUtils.o : ../../Common/ProgressUtils.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/ProgressUtils.cpp
+StreamBinder.o : ../../Common/StreamBinder.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/StreamBinder.cpp
+StreamObjects.o : ../../Common/StreamObjects.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/StreamObjects.cpp
+VirtThread.o : ../../Common/VirtThread.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Common/VirtThread.cpp
+ArchiveExtractCallback.o : ../../UI/Common/ArchiveExtractCallback.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Common/ArchiveExtractCallback.cpp
+ArchiveOpenCallback.o : ../../UI/Common/ArchiveOpenCallback.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Common/ArchiveOpenCallback.cpp
+LoadCodecs.o : ../../UI/Common/LoadCodecs.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Common/LoadCodecs.cpp
+DefaultName.o : ../../UI/Common/DefaultName.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Common/DefaultName.cpp
+Extract.o : ../../UI/Common/Extract.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Common/Extract.cpp
+ExtractingFilePath.o : ../../UI/Common/ExtractingFilePath.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Common/ExtractingFilePath.cpp
+OpenArchive.o : ../../UI/Common/OpenArchive.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Common/OpenArchive.cpp
+PropIDUtils.o : ../../UI/Common/PropIDUtils.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Common/PropIDUtils.cpp
+Main.o : ./Main.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ./Main.cpp
+BranchX86.o : ../../../../C/Compress/Branch/BranchX86.c
+	$(CC) $(CFLAGS) $(CC_SHARED) ../../../../C/Compress/Branch/BranchX86.c
+7zRegister.o : ../../Archive/7z/7zRegister.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Archive/7z/7zRegister.cpp
+LZMARegister.o : ../../Compress/LZMA/LZMARegister.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/LZMA/LZMARegister.cpp
+BCJ2Register.o : ../../Compress/Branch/BCJ2Register.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/Branch/BCJ2Register.cpp
+BCJRegister.o : ../../Compress/Branch/BCJRegister.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/Branch/BCJRegister.cpp
+PPMDRegister.o : ../../Compress/PPMD/PPMDRegister.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/PPMD/PPMDRegister.cpp
+CopyRegister.o : ../../Compress/Copy/CopyRegister.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Compress/Copy/CopyRegister.cpp
+7zAESRegister.o : ../../Crypto/7zAES/7zAESRegister.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../Crypto/7zAES/7zAESRegister.cpp
+Threads.o : ../../../../C/Threads.c
+	$(CC) $(CFLAGS) $(CC_SHARED) ../../../../C/Threads.c
+Aes.o : ../../../../C/Crypto/Aes.c
+	$(CC) $(CFLAGS) $(CC_SHARED) ../../../../C/Crypto/Aes.c
+# CRC32, C version
+7zCrc.o : ../../../../C/7zCrc.c
+	$(CC) $(CFLAGS) $(CC_SHARED) ../../../../C/7zCrc.c
+# CRC32, ASM version
+7zCrcT8.o : ../../../../C/7zCrcT8.c
+	$(CC) $(CFLAGS) $(CC_SHARED) ../../../../C/7zCrcT8.c
+ExtractCallbackNULL.o : ../../UI/Console/ExtractCallbackNULL.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ../../UI/Console/ExtractCallbackNULL.cpp
+Un7Zip.o : ./Un7Zip.cpp
+	$(CXX) $(CFLAGS) $(CC_SHARED) ./Un7Zip.cpp
diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Un7Zip/testlib.c p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/testlib.c
--- p7zip_4.57/CPP/7zip/Bundles/Un7Zip/testlib.c	1970-01-01 01:00:00.000000000 +0100
+++ p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/testlib.c	2008-04-11 18:37:10.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.57/CPP/7zip/Bundles/Un7Zip/u7zip.h p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/u7zip.h
--- p7zip_4.57/CPP/7zip/Bundles/Un7Zip/u7zip.h	1970-01-01 01:00:00.000000000 +0100
+++ p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/u7zip.h	2008-04-11 18:37:10.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.57/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp
--- p7zip_4.57/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp	1970-01-01 01:00:00.000000000 +0100
+++ p7zip_4.57-new/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp	2008-04-11 19:33:45.000000000 +0200
@@ -0,0 +1,148 @@
+// 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/MyException.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);
+
+
+    CCodecs *codecs = new CCodecs;
+    CMyComPtr<
+      #ifdef EXTERNAL_CODECS
+      ICompressCodecsInfo
+      #else
+      IUnknown
+      #endif
+      > compressCodecsInfo = codecs;
+    HRESULT result = codecs->Load();
+    if (result != S_OK)
+      throw CSystemException(result);
+
+    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;
+      CDecompressStat stat;
+ 
+      HRESULT result = DecompressArchives(
+          codecs,
+          v1, v2,
+          wildcardCensorHead, 
+          eo, &openCallback, ecs, errorMessage, stat);
+
+      if (ecs->NumArchiveErrors != 0 || ecs->NumFileErrors != 0)
+        return S_FALSE;
+      if (result != S_OK)
+        return S_FALSE;
+    }
+    else
+    {
+      UInt64 numErrors = 0;
+      HRESULT result = ListArchives(
+          codecs,
+          v1, v2,
+          wildcardCensorHead, 
+          true, false, 
+          passwordEnabled, 
+          password, numErrors);
+
+      if (result != S_OK)
+          return S_FALSE;;
+    }
+  }
+  return S_OK;
+}
diff -dPNur p7zip_4.57/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp p7zip_4.57-new/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp
--- p7zip_4.57/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp	1970-01-01 01:00:00.000000000 +0100
+++ p7zip_4.57-new/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp	2008-04-11 19:28:29.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, bool /* isFolder */, 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.57/CPP/7zip/UI/Console/ExtractCallbackNULL.h p7zip_4.57-new/CPP/7zip/UI/Console/ExtractCallbackNULL.h
--- p7zip_4.57/CPP/7zip/UI/Console/ExtractCallbackNULL.h	1970-01-01 01:00:00.000000000 +0100
+++ p7zip_4.57-new/CPP/7zip/UI/Console/ExtractCallbackNULL.h	2008-04-11 19:28:46.000000000 +0200
@@ -0,0 +1,65 @@
+// ExtractCallbackNULL.h
+
+#ifndef __EXTRACTCALLBACKCONSOLE_H
+#define __EXTRACTCALLBACKCONSOLE_H
+
+#include "Common/MyString.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, bool isFolder, 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