summaryrefslogtreecommitdiffstats
path: root/app-arch/p7zip/files
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
committerSuren A. Chilingaryan <csa@suren.me>2019-09-01 00:00:32 +0200
commitca9627e70852f6b2e835660df870fe3ab405882d (patch)
tree0a008b1d5b16fa0679a195ed7b5662c7891f591c /app-arch/p7zip/files
downloaddarklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.gz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.bz2
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.xz
darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.zip
Initial import
Diffstat (limited to 'app-arch/p7zip/files')
-rw-r--r--app-arch/p7zip/files/4.65-hardlink.patch13
-rw-r--r--app-arch/p7zip/files/4.65-makefile.patch20
-rw-r--r--app-arch/p7zip/files/7z5
-rw-r--r--app-arch/p7zip/files/7za5
-rw-r--r--app-arch/p7zip/files/9.04-kde4.patch87
-rw-r--r--app-arch/p7zip/files/9.04-makefile.patch19
-rw-r--r--app-arch/p7zip/files/p7zip73
-rw-r--r--app-arch/p7zip/files/p7zip-4.16_x86_static.patch10
-rw-r--r--app-arch/p7zip/files/p7zip-9.13-QA.patch17
-rw-r--r--app-arch/p7zip/files/p7zip-9.20.1-QA.patch17
-rw-r--r--app-arch/p7zip/files/p7zip-9.20.1-execstack.patch24
-rw-r--r--app-arch/p7zip/files/p7zip-ds-442.patch11
-rw-r--r--app-arch/p7zip/files/p7zip-ds-rcc.patch314
-rw-r--r--app-arch/p7zip/files/p7zip_4.27-libun7zip.patch597
-rw-r--r--app-arch/p7zip/files/p7zip_4.44-libun7zip.patch599
-rw-r--r--app-arch/p7zip/files/p7zip_4.57-ds-rusxmms.patch336
-rw-r--r--app-arch/p7zip/files/p7zip_4.57-libun7zip.patch684
-rw-r--r--app-arch/p7zip/files/p7zip_4.65-ds-rusxmms.patch305
-rw-r--r--app-arch/p7zip/files/p7zip_4.65-libun7zip.patch550
-rw-r--r--app-arch/p7zip/files/p7zip_9.04-ds-rusxmms.patch294
-rw-r--r--app-arch/p7zip/files/p7zip_9.13-ds-dynbuf.patch12
-rw-r--r--app-arch/p7zip/files/p7zip_9.13-ds-rusxmms.patch307
22 files changed, 4299 insertions, 0 deletions
diff --git a/app-arch/p7zip/files/4.65-hardlink.patch b/app-arch/p7zip/files/4.65-hardlink.patch
new file mode 100644
index 0000000..05d9e71
--- /dev/null
+++ b/app-arch/p7zip/files/4.65-hardlink.patch
@@ -0,0 +1,13 @@
+--- makefile 2009-02-25 16:03:33.000000000 +0100
++++ makefile.new 2009-02-25 16:03:17.000000000 +0100
+@@ -55,8 +55,8 @@
+ $(MAKE) -C CPP/7zip/UI/Console all
+
+ 7zG: common7z
+- cd bin ; rm -f Lang ; ln ../GUI/Lang .
+- cd bin ; rm -f help ; ln ../GUI/help .
++ cd bin ; rm -f Lang ; ln -sf ../GUI/Lang .
++ cd bin ; rm -f help ; ln -sf ../GUI/help .
+ $(MAKE) -C CPP/7zip/UI/GUI all
+
+ clean:
diff --git a/app-arch/p7zip/files/4.65-makefile.patch b/app-arch/p7zip/files/4.65-makefile.patch
new file mode 100644
index 0000000..b0297f8
--- /dev/null
+++ b/app-arch/p7zip/files/4.65-makefile.patch
@@ -0,0 +1,20 @@
+--- CPP/7zip/Bundles/Format7zFree/makefile 2009-02-09 21:47:24.000000000 +0100
++++ CPP/7zip/Bundles/Format7zFree/makefile.new 2009-02-25 14:18:31.000000000 +0100
+@@ -271,8 +271,6 @@
+ MyAes.o \
+ Pbkdf2HmacSha1.o \
+ RandGen.o \
+- Rar20Crypto.o \
+- RarAes.o \
+ Sha1.o \
+ WzAes.o \
+ ZipCrypto.o \
+@@ -313,7 +313,6 @@
+ $(LZH_OBJS) \
+ $(LZM_OBJS) \
+ $(NSIS_OBJS) \
+- $(RAR_OBJS) \
+ $(SPLIT_OBJS) \
+ $(TAR_OBJS) \
+ $(UDF_OBJS) \
+
diff --git a/app-arch/p7zip/files/7z b/app-arch/p7zip/files/7z
new file mode 100644
index 0000000..05c7086
--- /dev/null
+++ b/app-arch/p7zip/files/7z
@@ -0,0 +1,5 @@
+#!/bin/sh
+# 7z wrapper, p7zip, should be called with full path
+# so symlink and copy should not be used instead.
+
+exec /usr/lib/p7zip/7z "$@"
diff --git a/app-arch/p7zip/files/7za b/app-arch/p7zip/files/7za
new file mode 100644
index 0000000..f718bb4
--- /dev/null
+++ b/app-arch/p7zip/files/7za
@@ -0,0 +1,5 @@
+#!/bin/sh
+# 7za wrapper, p7zip, should be called with full path
+# so symlink and copy should not be used instead.
+
+exec /usr/lib/p7zip/7za "$@"
diff --git a/app-arch/p7zip/files/9.04-kde4.patch b/app-arch/p7zip/files/9.04-kde4.patch
new file mode 100644
index 0000000..c309d70
--- /dev/null
+++ b/app-arch/p7zip/files/9.04-kde4.patch
@@ -0,0 +1,87 @@
+diff --git a/GUI/kde/p7zip_compress.desktop b/GUI/kde/p7zip_compress.desktop
+index 9010fbd..b965fa6 100644
+--- a/GUI/kde/p7zip_compress.desktop
++++ b/GUI/kde/p7zip_compress.desktop
+@@ -1,6 +1,8 @@
+ [Desktop Entry]
+-ServiceTypes=inode/directory
+-Actions=CompressDialog;Compress7z;CompressZip;extractHere;ExtractSubdir;ExtractTo;test;Benchmark
++Type=Service
++ServiceTypes=KonqPopupMenu/Plugin
++MimeType=all/all;
++Actions=CompressDialog;Compress7z;CompressZip;Benchmark
+ X-KDE-Priority=TopLevel
+ X-KDE-Submenu=7-Zip
+ X-KDE-Icon=p7zip
+diff --git a/GUI/kde/p7zip_extract.desktop b/GUI/kde/p7zip_extract.desktop
+index 9038c76..a7dca4d 100644
+--- a/GUI/kde/p7zip_extract.desktop
++++ b/GUI/kde/p7zip_extract.desktop
+@@ -1,10 +1,30 @@
+ [Desktop Entry]
+ X-SuSE-translate=true
+-Encoding=UTF-8
+-ServiceTypes=application/x-gzip,application/x-lha,application/x-tar,application/x-tgz,application/x-tbz,application/x-tbz2,application/x-zip,application/x-bzip,application/x-tzo,application/x-lzop,application/x-rar,application/x-rar-compressed,application/x-zoo,application/x-tarz,application/x-archive,application/x-bzip2,application/x-jar,application/x-deb,application/x-ace,application/x-7z,application/x-arc,application/x-arj,application/x-compress,application/x-cpio,application/x-pak
+-Actions=extractHere
++Type=Service
++ServiceTypes=KonqPopupMenu/Plugin
++MimeType=application/x-gzip;application/x-lha;application/x-tar;application/x-compressed-tar;application/x-bzip-compressed-tar;application/zip;application/x-bzip;application/x-tzo;application/x-lzop;application/x-rar;application/x-zoo;application/x-tarz;application/x-archive;application/x-bzip2;application/x-java-archive;application/x-deb;application/x-ace;application/x-7z-compressed;application/x-arc;application/x-arj;application/x-compress;application/x-zip-compressed;application/x-cpio;application/x-pak;
++#MimeType=application/x-gzip;application/x-lha;application/x-tar;application/x-tgz;application/x-tbz;application/x-tbz2;application/x-zip;application/x-bzip;application/x-tzo;application/x-lzop;application/x-rar;application/x-rar-compressed;application/x-zoo;application/x-tarz;application/x-archive;application/x-bzip2;application/x-jar;application/x-deb;application/x-ace;application/x-7z;application/x-arc;application/x-arj;application/x-compress;application/x-cpio;application/x-pak;
++Actions=extractHere;ExtractSubdir;ExtractTo;test;
++X-KDE-Priority=TopLevel
++X-KDE-Submenu=7-Zip
++X-KDE-Icon=p7zip
+
+ [Desktop Action extractHere]
+-Name=Extract Here with 7-zip
++Name=Extract Here
+ Exec=p7zipForFilemanager x %U
+ Icon=p7zip
++
++[Desktop Action ExtractSubdir]
++Name=Extract to subdirectory
++Icon=p7zip
++Exec=p7zipForFilemanager xs %U
++
++[Desktop Action ExtractTo]
++Name=Extract to ...
++Icon=p7zip
++Exec=p7zipForFilemanager xd %U
++
++[Desktop Action test]
++Name=Test Archive
++Exec=p7zipForFilemanager t %U
++Icon=p7zip
+diff --git a/GUI/kde/p7zip_extract_subdir.desktop b/GUI/kde/p7zip_extract_subdir.desktop
+index 1800fa0..a711f3c 100644
+--- a/GUI/kde/p7zip_extract_subdir.desktop
++++ b/GUI/kde/p7zip_extract_subdir.desktop
+@@ -1,6 +1,5 @@
+ [Desktop Entry]
+ X-SuSE-translate=true
+-Encoding=UTF-8
+ ServiceTypes=application/x-gzip,application/x-lha,application/x-tar,application/x-tgz,application/x-tbz,application/x-tbz2,application/x-zip,application/x-bzip,application/x-tzo,application/x-lzop,application/x-rar,application/x-rar-compressed,application/x-zoo,application/x-tarz,application/x-archive,application/x-bzip2,application/x-jar,application/x-deb,application/x-ace,application/x-7z,application/x-arc,application/x-arj,application/x-compress,application/x-cpio,application/x-pak
+ Actions=ExtractSubdir
+
+diff --git a/GUI/kde/p7zip_extract_to.desktop b/GUI/kde/p7zip_extract_to.desktop
+index bf13ec0..18d2b74 100644
+--- a/GUI/kde/p7zip_extract_to.desktop
++++ b/GUI/kde/p7zip_extract_to.desktop
+@@ -1,6 +1,5 @@
+ [Desktop Entry]
+ X-SuSE-translate=true
+-Encoding=UTF-8
+ ServiceTypes=application/x-gzip,application/x-lha,application/x-tar,application/x-tgz,application/x-tbz,application/x-tbz2,application/x-zip,application/x-bzip,application/x-tzo,application/x-lzop,application/x-rar,application/x-rar-compressed,application/x-zoo,application/x-tarz,application/x-archive,application/x-bzip2,application/x-jar,application/x-deb,application/x-ace,application/x-7z,application/x-arc,application/x-arj,application/x-compress,application/x-cpio,application/x-pak
+ Actions=ExtractTo
+
+diff --git a/GUI/kde/p7zip_test.desktop b/GUI/kde/p7zip_test.desktop
+index 2c17acb..5212bb2 100644
+--- a/GUI/kde/p7zip_test.desktop
++++ b/GUI/kde/p7zip_test.desktop
+@@ -1,6 +1,5 @@
+ [Desktop Entry]
+ X-SuSE-translate=true
+-Encoding=UTF-8
+ ServiceTypes=application/x-gzip,application/x-lha,application/x-tar,application/x-tgz,application/x-tbz,application/x-tbz2,application/x-zip,application/x-bzip,application/x-tzo,application/x-lzop,application/x-rar,application/x-rar-compressed,application/x-zoo,application/x-tarz,application/x-archive,application/x-bzip2,application/x-jar,application/x-deb,application/x-ace,application/x-7z,application/x-arc,application/x-arj,application/x-compress,application/x-cpio,application/x-pak
+ Actions=test
+
diff --git a/app-arch/p7zip/files/9.04-makefile.patch b/app-arch/p7zip/files/9.04-makefile.patch
new file mode 100644
index 0000000..93a99cc
--- /dev/null
+++ b/app-arch/p7zip/files/9.04-makefile.patch
@@ -0,0 +1,19 @@
+--- p7zip_9.04/CPP/7zip/Bundles/Format7zFree/makefile.orig 2010-01-04 13:58:54.527887746 +0100
++++ p7zip_9.04/CPP/7zip/Bundles/Format7zFree/makefile 2010-01-04 13:59:10.290868343 +0100
+@@ -247,8 +247,6 @@
+ MyAes.o \
+ Pbkdf2HmacSha1.o \
+ RandGen.o \
+- Rar20Crypto.o \
+- RarAes.o \
+ Sha1.o \
+ WzAes.o \
+ ZipCrypto.o \
+@@ -298,7 +296,6 @@
+ $(HFS_OBJS) \
+ $(ISO_OBJS) \
+ $(NSIS_OBJS) \
+- $(RAR_OBJS) \
+ $(TAR_OBJS) \
+ $(UDF_OBJS) \
+ $(WIM_OBJS) \
diff --git a/app-arch/p7zip/files/p7zip b/app-arch/p7zip/files/p7zip
new file mode 100644
index 0000000..9aaf078
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip
@@ -0,0 +1,73 @@
+#!/bin/bash
+# gzip-like CLI wrapper for p7zip
+set -e
+
+compress=true
+file=
+
+usage ()
+ {
+ echo "Usage: $0 [-d] [-h|--help] [file]"
+ exit 1
+ }
+
+while [ "$#" != "0" ] ; do
+ case "$1" in
+ -d) compress=false ;;
+ -c) echo "$0: ignoring $1 option (not yet implemented)" ;;
+ -h|--help) usage ;;
+ *)
+ if [ "${file}" = "" ] ; then
+ file="$1"
+ else
+ usage
+ fi
+ ;;
+ esac
+ shift
+done
+
+# make sure they're present, before we screw up
+for i in mktemp 7z rm cat tty ; do
+ if ! which $i > /dev/null ; then
+ echo "$0: $i: command not found"
+ exit 1
+ fi
+done
+
+if [ "${file}" != "" ] ; then
+ if ${compress} ; then
+ 7z a ${file}.7z ${file}
+ rm ${file}
+ else
+ case ${file} in
+ *.7z)
+ 7z x ${file}
+ rm ${file}
+ ;;
+ *)
+ echo "$0: ${file}: unknown suffix -- ignored"
+ ;;
+ esac
+ fi
+ exit 0
+fi
+
+tmp=`mktemp`
+trap "rm -f ${tmp}" 0
+
+if ${compress} ; then
+ if tty > /dev/null ; then
+ echo "$0: compressed data not written to a terminal."
+ echo "For help, type: $0 -h"
+ exit 1
+ fi
+ rm -f ${tmp}
+ 7z a ${tmp} -si >/dev/null
+ cat ${tmp}
+else
+ cat > ${tmp}
+ 7z x ${tmp} -so 2>/dev/null | cat
+fi
+
+rm -f ${tmp}
diff --git a/app-arch/p7zip/files/p7zip-4.16_x86_static.patch b/app-arch/p7zip/files/p7zip-4.16_x86_static.patch
new file mode 100644
index 0000000..c52ef86
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip-4.16_x86_static.patch
@@ -0,0 +1,10 @@
+--- makefile.machine.orig 2005-04-15 18:31:10.000000000 +0200
++++ makefile.machine 2005-04-15 18:12:26.000000000 +0200
+@@ -11,6 +11,6 @@
+ CC=gcc $(ALLFLAGS)
+ LINK_SHARED=-shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -static
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
diff --git a/app-arch/p7zip/files/p7zip-9.13-QA.patch b/app-arch/p7zip/files/p7zip-9.13-QA.patch
new file mode 100644
index 0000000..4a2b92e
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip-9.13-QA.patch
@@ -0,0 +1,17 @@
+From: Julian Ospald <hasufell@gentoo.org>
+Date: Thu Jun 7 14:29:51 UTC 2012
+Subject: fix QA warnings
+
+https://sourceforge.net/tracker/?func=detail&atid=660493&aid=3532590&group_id=111810
+
+--- CPP/7zip/Archive/NtfsHandler.cpp
++++ CPP/7zip/Archive/NtfsHandler.cpp
+@@ -1250,7 +1250,7 @@
+ if (recSizeLog < Header.SectorSizeLog)
+ return false;
+ numSectorsInRec = 1 << (recSizeLog - Header.SectorSizeLog);
+- if (!mftRec.Parse(ByteBuf, Header.SectorSizeLog, numSectorsInRec, NULL, 0))
++ if (!mftRec.Parse(ByteBuf, Header.SectorSizeLog, numSectorsInRec, 0, NULL))
+ return S_FALSE;
+ if (!mftRec.IsFILE())
+ return S_FALSE;
diff --git a/app-arch/p7zip/files/p7zip-9.20.1-QA.patch b/app-arch/p7zip/files/p7zip-9.20.1-QA.patch
new file mode 100644
index 0000000..8845aca
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip-9.20.1-QA.patch
@@ -0,0 +1,17 @@
+From: Julian Ospald <hasufell@gentoo.org>
+Date: Thu Jun 7 14:31:12 UTC 2012
+Subject: fix QA warnings
+
+https://sourceforge.net/tracker/?func=detail&atid=660493&aid=3532590&group_id=111810
+
+--- CPP/7zip/Archive/NtfsHandler.cpp
++++ CPP/7zip/Archive/NtfsHandler.cpp
+@@ -1280,7 +1280,7 @@
+ if (recSizeLog < Header.SectorSizeLog)
+ return false;
+ numSectorsInRec = 1 << (recSizeLog - Header.SectorSizeLog);
+- if (!mftRec.Parse(ByteBuf, Header.SectorSizeLog, numSectorsInRec, NULL, 0))
++ if (!mftRec.Parse(ByteBuf, Header.SectorSizeLog, numSectorsInRec, 0, NULL))
+ return S_FALSE;
+ if (!mftRec.IsFILE())
+ return S_FALSE;
diff --git a/app-arch/p7zip/files/p7zip-9.20.1-execstack.patch b/app-arch/p7zip/files/p7zip-9.20.1-execstack.patch
new file mode 100644
index 0000000..1fdff48
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip-9.20.1-execstack.patch
@@ -0,0 +1,24 @@
+diff -Naupr p7zip_9.20.1.orig/Asm/x64/7zCrcT8U.asm p7zip_9.20.1/Asm/x64/7zCrcT8U.asm
+--- p7zip_9.20.1.orig/Asm/x64/7zCrcT8U.asm 2008-08-14 11:18:07.000000000 +0200
++++ p7zip_9.20.1/Asm/x64/7zCrcT8U.asm 2011-07-26 17:43:57.727910278 +0200
+@@ -101,3 +101,8 @@ _CrcUpdateT8:
+ ret
+
+ end
++
++%ifidn __OUTPUT_FORMAT__,elf
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
++
+diff -Naupr p7zip_9.20.1.orig/Asm/x86/7zCrcT8U.asm p7zip_9.20.1/Asm/x86/7zCrcT8U.asm
+--- p7zip_9.20.1.orig/Asm/x86/7zCrcT8U.asm 2009-07-14 12:44:15.000000000 +0200
++++ p7zip_9.20.1/Asm/x86/7zCrcT8U.asm 2011-07-26 17:44:23.938864508 +0200
+@@ -99,3 +99,8 @@ _CrcUpdateT8:
+
+
+ ; end
++
++%ifidn __OUTPUT_FORMAT__,elf
++section .note.GNU-stack noalloc noexec nowrite progbits
++%endif
++
diff --git a/app-arch/p7zip/files/p7zip-ds-442.patch b/app-arch/p7zip/files/p7zip-ds-442.patch
new file mode 100644
index 0000000..ba9b3d2
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip-ds-442.patch
@@ -0,0 +1,11 @@
+diff -dPNur p7zip_4.42/7zip/Bundles/Un7Zip/Un7Zip.cpp p7zip_4.42-new/7zip/Bundles/Un7Zip/Un7Zip.cpp
+--- p7zip_4.42/7zip/Bundles/Un7Zip/Un7Zip.cpp 2006-06-28 04:12:35.000000000 +0500
++++ p7zip_4.42-new/7zip/Bundles/Un7Zip/Un7Zip.cpp 2006-06-28 04:25:56.000000000 +0500
+@@ -117,6 +117,7 @@
+ v1, v2,
+ wildcardCensorHead,
+ true,
++ false,
+ passwordEnabled,
+ password);
+ if (result != S_OK)
diff --git a/app-arch/p7zip/files/p7zip-ds-rcc.patch b/app-arch/p7zip/files/p7zip-ds-rcc.patch
new file mode 100644
index 0000000..98e7855
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip-ds-rcc.patch
@@ -0,0 +1,314 @@
+diff -dPNur p7zip_4.44-old/C/rccrecode.c p7zip_4.44/C/rccrecode.c
+--- p7zip_4.44-old/C/rccrecode.c 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.44/C/rccrecode.c 2007-04-14 19:47:03.000000000 +0200
+@@ -0,0 +1,69 @@
++#include <pthread.h>
++#include <librcc.h>
++
++static rcc_class_default_charset default_oem[] = {
++ { "ru", "IBM866" },
++ { NULL, NULL }
++};
++
++static rcc_class_default_charset default_iso[] = {
++ { "ru", "CP1251" },
++ { NULL, NULL }
++};
++
++#define ARC_CLASS 0
++#define OUT_CLASS 1
++#define ARCOUT_CLASS 0
++static rcc_class classes[] = {
++ { "oem", RCC_CLASS_STANDARD, NULL, default_oem, "OEM Encoding", 0 },
++ { "out", RCC_CLASS_STANDARD, "LC_CTYPE", NULL, "Output", 0 },
++ { NULL }
++};
++
++static int initialized = 0;
++static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
++
++void *rcc_init() {
++ rcc_context ctx;
++
++ pthread_mutex_lock(&mutex);
++ if (!initialized) {
++ rccInit();
++ rccInitDefaultContext(NULL, 0, 0, classes, 0);
++ rccInitDb4(NULL, NULL, 0);
++ }
++ initialized++;
++ pthread_mutex_unlock(&mutex);
++
++ ctx = rccCreateContext(NULL, 0, 0, classes, 0);
++ if (ctx) rccInitDb4(ctx, NULL, 0);
++
++ return ctx;
++}
++
++
++void rcc_free(void *ctx) {
++ if (ctx) rccFreeContext((rcc_context)ctx);
++
++ pthread_mutex_lock(&mutex);
++ if (initialized == 1) rccFree();
++ initialized--;
++ pthread_mutex_unlock(&mutex);
++}
++
++
++char *rcc_read(void *ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, ARC_CLASS, OUT_CLASS, string, size, NULL);
++}
++
++char *rcc_write(rcc_context ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, OUT_CLASS, ARCOUT_CLASS, string, size, NULL);
++}
+diff -dPNur p7zip_4.44-old/C/rccrecode.h p7zip_4.44/C/rccrecode.h
+--- p7zip_4.44-old/C/rccrecode.h 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.44/C/rccrecode.h 2007-04-14 19:34:20.000000000 +0200
+@@ -0,0 +1,17 @@
++#ifndef _RCC_RECODE_H
++#define _RCC_RECODE_H
++
++# ifdef __cplusplus
++extern "C" {
++# endif
++
++ void *rcc_init();
++ void rcc_free(void *ctx);
++ char *rcc_read(void *ctx, const char *string, size_t size);
++ char *rcc_write(void *ctx, const char *string, size_t size);
++
++# ifdef __cplusplus
++}
++# endif
++
++#endif /* _RCC_RECODE_H */
+diff -dPNur p7zip_4.44-old/CPP/7zip/Archive/Zip/makefile p7zip_4.44/CPP/7zip/Archive/Zip/makefile
+--- p7zip_4.44-old/CPP/7zip/Archive/Zip/makefile 2007-01-23 21:29:41.000000000 +0100
++++ p7zip_4.44/CPP/7zip/Archive/Zip/makefile 2007-04-14 18:36:44.000000000 +0200
+@@ -13,6 +13,7 @@
+ LIBS=$(LOCAL_LIBS_DLL)
+
+ OBJS = \
++../../../../C/rccrecode.o \
+ ../../../Common/MyWindows.o \
+ ../../../Common/Vector.o\
+ ../../../Common/Alloc.o\
+diff -dPNur p7zip_4.44-old/CPP/7zip/Archive/Zip/ZipIn.cpp p7zip_4.44/CPP/7zip/Archive/Zip/ZipIn.cpp
+--- p7zip_4.44-old/CPP/7zip/Archive/Zip/ZipIn.cpp 2007-01-20 18:06:58.000000000 +0100
++++ p7zip_4.44/CPP/7zip/Archive/Zip/ZipIn.cpp 2007-04-14 19:34:59.000000000 +0200
+@@ -9,11 +9,22 @@
+ #include "../../Common/LimitedStreams.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ namespace NArchive {
+ namespace NZip {
++
++CInArchive::CInArchive() {
++ rccctx = rcc_init();
++}
++
++CInArchive::~CInArchive() {
++ rcc_free(rccctx);
++}
++
+
+ // static const char kEndOfString = '\0';
+-
++
+ bool CInArchive::Open(IInStream *inStream, const UInt64 *searchHeaderSizeLimit)
+ {
+ m_Stream = inStream;
+@@ -179,10 +190,18 @@
+
+ AString CInArchive::ReadFileName(UInt32 nameSize)
+ {
++ char *rccrec;
+ if (nameSize == 0)
+ return AString();
+ SafeReadBytes(m_NameBuffer.GetBuffer(nameSize), nameSize);
+ m_NameBuffer.ReleaseBuffer(nameSize);
++
++ rccrec = rcc_read(rccctx, (LPCSTR)m_NameBuffer, 0);
++ if (rccrec) {
++ m_NameBuffer = rccrec;
++ free(rccrec);
++ }
++
+ return m_NameBuffer;
+ }
+
+diff -dPNur p7zip_4.44-old/CPP/7zip/Archive/Zip/ZipIn.h p7zip_4.44/CPP/7zip/Archive/Zip/ZipIn.h
+--- p7zip_4.44-old/CPP/7zip/Archive/Zip/ZipIn.h 2007-01-20 18:06:28.000000000 +0100
++++ p7zip_4.44/CPP/7zip/Archive/Zip/ZipIn.h 2007-04-14 19:05:31.000000000 +0200
+@@ -104,6 +104,10 @@
+ bool SeekInArchive(UInt64 position);
+ ISequentialInStream *CreateLimitedStream(UInt64 position, UInt64 size);
+ IInStream* CreateStream();
++
++ void *rccctx;
++ CInArchive();
++ ~CInArchive();
+ };
+
+ }}
+diff -dPNur p7zip_4.44-old/CPP/7zip/Archive/Zip/ZipOut.cpp p7zip_4.44/CPP/7zip/Archive/Zip/ZipOut.cpp
+--- p7zip_4.44-old/CPP/7zip/Archive/Zip/ZipOut.cpp 2007-01-20 18:06:57.000000000 +0100
++++ p7zip_4.44/CPP/7zip/Archive/Zip/ZipOut.cpp 2007-04-14 19:44:44.000000000 +0200
+@@ -8,9 +8,19 @@
+ #include "../../Common/OffsetStream.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ namespace NArchive {
+ namespace NZip {
+
++COutArchive::COutArchive() {
++ rccctx = rcc_init();
++}
++
++COutArchive::~COutArchive() {
++ rcc_free(rccctx);
++}
++
+ void COutArchive::Create(IOutStream *outStream)
+ {
+ m_Stream = outStream;
+@@ -104,6 +114,8 @@
+
+ HRESULT COutArchive::WriteLocalHeader(const CLocalItem &item)
+ {
++ char *rccrec;
++
+ m_Stream->Seek(m_BasePosition, STREAM_SEEK_SET, NULL);
+
+ bool isZip64 = m_IsZip64 || item.PackSize >= 0xFFFFFFFF || item.UnPackSize >= 0xFFFFFFFF;
+@@ -124,6 +136,12 @@
+ return E_FAIL;
+ }
+ WriteUInt16((UInt16)m_ExtraSize); // test it;
++ rccrec = rcc_write(rccctx, (const char *)item.Name, item.Name.Length());
++ if (rccrec) {
++ printf("%u, %s.\n", item.Name.Length(), rccrec);
++ WriteBytes(rccrec, strlen(rccrec));
++ free(rccrec);
++ } else
+ WriteBytes((const char *)item.Name, item.Name.Length());
+
+ UInt32 extraPos = 0;
+@@ -147,6 +165,8 @@
+
+ void COutArchive::WriteCentralHeader(const CItem &item)
+ {
++ char *rccrec;
++
+ m_Stream->Seek(m_BasePosition, STREAM_SEEK_SET, NULL);
+
+ bool isUnPack64 = item.UnPackSize >= 0xFFFFFFFF;
+@@ -175,6 +195,13 @@
+ WriteUInt16(item.InternalAttributes);
+ WriteUInt32(item.ExternalAttributes);
+ WriteUInt32(isPosition64 ? 0xFFFFFFFF: (UInt32)item.LocalHeaderPosition);
++
++ rccrec = rcc_write(rccctx, (const char *)item.Name, item.Name.Length());
++ if (rccrec) {
++ printf("C: %u, %s.\n", item.Name.Length(), rccrec);
++ WriteBytes(rccrec, strlen(rccrec));
++ free(rccrec);
++ } else
+ WriteBytes((const char *)item.Name, item.Name.Length());
+ if (isZip64)
+ {
+diff -dPNur p7zip_4.44-old/CPP/7zip/Archive/Zip/ZipOut.h p7zip_4.44/CPP/7zip/Archive/Zip/ZipOut.h
+--- p7zip_4.44-old/CPP/7zip/Archive/Zip/ZipOut.h 2007-01-20 18:06:29.000000000 +0100
++++ p7zip_4.44/CPP/7zip/Archive/Zip/ZipOut.h 2007-04-14 19:10:12.000000000 +0200
+@@ -44,6 +44,11 @@
+ void CreateStreamForCompressing(IOutStream **outStream);
+ void CreateStreamForCopying(ISequentialOutStream **outStream);
+ void SeekToPackedDataPosition();
++
++ void *rccctx;
++ COutArchive();
++ ~COutArchive();
++
+ };
+
+ }}
+diff -dPNur p7zip_4.44-old/CPP/7zip/Bundles/Alone/makefile p7zip_4.44/CPP/7zip/Bundles/Alone/makefile
+--- p7zip_4.44-old/CPP/7zip/Bundles/Alone/makefile 2007-01-23 21:29:43.000000000 +0100
++++ p7zip_4.44/CPP/7zip/Bundles/Alone/makefile 2007-04-14 18:52:31.000000000 +0200
+@@ -41,6 +41,7 @@
+ $(MY_HOME)/mySplitCommandLine.o
+
+ OBJS=\
++../../../../C/rccrecode.o \
+ ../../../Common/MyWindows.o \
+ 7zAES.o \
+ 7zCompressionMode.o \
+diff -dPNur p7zip_4.44-old/makefile.linux_amd64 p7zip_4.44/makefile.linux_amd64
+--- p7zip_4.44-old/makefile.linux_amd64 2007-04-14 15:37:39.000000000 +0200
++++ p7zip_4.44/makefile.linux_amd64 2007-04-14 18:50:13.000000000 +0200
+@@ -11,6 +11,6 @@
+ CC=x86_64-pc-linux-gnu-gcc $(ALLFLAGS)
+ LINK_SHARED=-shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
+diff -dPNur p7zip_4.44-old/makefile.linux_gcc_2.95_no_need_for_libstdc p7zip_4.44/makefile.linux_gcc_2.95_no_need_for_libstdc
+--- p7zip_4.44-old/makefile.linux_gcc_2.95_no_need_for_libstdc 2007-04-14 15:37:39.000000000 +0200
++++ p7zip_4.44/makefile.linux_gcc_2.95_no_need_for_libstdc 2007-04-14 18:51:02.000000000 +0200
+@@ -10,6 +10,6 @@
+ CC=x86_64-pc-linux-gnu-gcc $(ALLFLAGS)
+ LINK_SHARED=-shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
+diff -dPNur p7zip_4.44-old/makefile.linux_x86_ppc_alpha p7zip_4.44/makefile.linux_x86_ppc_alpha
+--- p7zip_4.44-old/makefile.linux_x86_ppc_alpha 2007-04-14 15:37:39.000000000 +0200
++++ p7zip_4.44/makefile.linux_x86_ppc_alpha 2007-04-14 18:51:15.000000000 +0200
+@@ -14,6 +14,6 @@
+ CC=x86_64-pc-linux-gnu-gcc $(ALLFLAGS)
+ LINK_SHARED=-shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
+diff -dPNur p7zip_4.44-old/makefile.linux_x86_ppc_alpha__gcc_4.X p7zip_4.44/makefile.linux_x86_ppc_alpha__gcc_4.X
+--- p7zip_4.44-old/makefile.linux_x86_ppc_alpha__gcc_4.X 2007-04-14 15:37:39.000000000 +0200
++++ p7zip_4.44/makefile.linux_x86_ppc_alpha__gcc_4.X 2007-04-14 18:51:19.000000000 +0200
+@@ -14,6 +14,6 @@
+ CC=x86_64-pc-linux-gnu-gcc $(ALLFLAGS)
+ LINK_SHARED=-shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
+diff -dPNur p7zip_4.44-old/makefile.machine p7zip_4.44/makefile.machine
+--- p7zip_4.44-old/makefile.machine 2007-04-14 15:37:39.000000000 +0200
++++ p7zip_4.44/makefile.machine 2007-04-14 18:49:24.000000000 +0200
+@@ -11,6 +11,6 @@
+ CC=x86_64-pc-linux-gnu-gcc $(ALLFLAGS)
+ LINK_SHARED=-shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
diff --git a/app-arch/p7zip/files/p7zip_4.27-libun7zip.patch b/app-arch/p7zip/files/p7zip_4.27-libun7zip.patch
new file mode 100644
index 0000000..0020729
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_4.27-libun7zip.patch
@@ -0,0 +1,597 @@
+diff -ruN p7zip_4.27.orig/7zip/Bundles/Un7Zip/makefile p7zip_4.27/7zip/Bundles/Un7Zip/makefile
+--- p7zip_4.27.orig/7zip/Bundles/Un7Zip/makefile 1970-01-01 03:00:00.000000000 +0300
++++ p7zip_4.27/7zip/Bundles/Un7Zip/makefile 2005-09-23 09:48:09.000000000 +0400
+@@ -0,0 +1,85 @@
++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 \
++ $(MY_HOME)/myModuleFileName.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 -ruN p7zip_4.27.orig/7zip/Bundles/Un7Zip/makefile.depend p7zip_4.27/7zip/Bundles/Un7Zip/makefile.depend
+--- p7zip_4.27.orig/7zip/Bundles/Un7Zip/makefile.depend 1970-01-01 03:00:00.000000000 +0300
++++ p7zip_4.27/7zip/Bundles/Un7Zip/makefile.depend 2005-09-23 09:48:46.000000000 +0400
+@@ -0,0 +1 @@
++
+\ В конце файла нет новой строки
+diff -ruN p7zip_4.27.orig/7zip/Bundles/Un7Zip/makefile.list p7zip_4.27/7zip/Bundles/Un7Zip/makefile.list
+--- p7zip_4.27.orig/7zip/Bundles/Un7Zip/makefile.list 1970-01-01 03:00:00.000000000 +0300
++++ p7zip_4.27/7zip/Bundles/Un7Zip/makefile.list 2005-09-23 09:48:09.000000000 +0400
+@@ -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 -ruN p7zip_4.27.orig/7zip/Bundles/Un7Zip/testlib.c p7zip_4.27/7zip/Bundles/Un7Zip/testlib.c
+--- p7zip_4.27.orig/7zip/Bundles/Un7Zip/testlib.c 1970-01-01 03:00:00.000000000 +0300
++++ p7zip_4.27/7zip/Bundles/Un7Zip/testlib.c 2005-09-23 09:48:09.000000000 +0400
+@@ -0,0 +1,7 @@
++
++#include "u7zip.h"
++
++int main(int argc, char *argv[])
++{
++ return un7zip(argv[1], "/tmp", 0);
++}
+diff -ruN p7zip_4.27.orig/7zip/Bundles/Un7Zip/u7zip.h p7zip_4.27/7zip/Bundles/Un7Zip/u7zip.h
+--- p7zip_4.27.orig/7zip/Bundles/Un7Zip/u7zip.h 1970-01-01 03:00:00.000000000 +0300
++++ p7zip_4.27/7zip/Bundles/Un7Zip/u7zip.h 2005-09-23 09:48:09.000000000 +0400
+@@ -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 -ruN p7zip_4.27.orig/7zip/Bundles/Un7Zip/Un7Zip.cpp p7zip_4.27/7zip/Bundles/Un7Zip/Un7Zip.cpp
+--- p7zip_4.27.orig/7zip/Bundles/Un7Zip/Un7Zip.cpp 1970-01-01 03:00:00.000000000 +0300
++++ p7zip_4.27/7zip/Bundles/Un7Zip/Un7Zip.cpp 2005-09-23 09:48:09.000000000 +0400
+@@ -0,0 +1,127 @@
++// 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;
++
++ HRESULT result = DecompressArchives(
++ v1, v2,
++ wildcardCensorHead,
++ eo, &openCallback, ecs);
++ 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,
++ passwordEnabled,
++ password);
++ if (result != S_OK)
++ return S_FALSE;;
++ }
++ }
++ return S_OK;
++}
+diff -ruN p7zip_4.27.orig/7zip/UI/Console/ExtractCallbackNULL.cpp p7zip_4.27/7zip/UI/Console/ExtractCallbackNULL.cpp
+--- p7zip_4.27.orig/7zip/UI/Console/ExtractCallbackNULL.cpp 1970-01-01 03:00:00.000000000 +0300
++++ p7zip_4.27/7zip/UI/Console/ExtractCallbackNULL.cpp 2005-09-23 09:48:09.000000000 +0400
+@@ -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)
++{
++ 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)
++{
++ 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 -ruN p7zip_4.27.orig/7zip/UI/Console/ExtractCallbackNULL.h p7zip_4.27/7zip/UI/Console/ExtractCallbackNULL.h
+--- p7zip_4.27.orig/7zip/UI/Console/ExtractCallbackNULL.h 1970-01-01 03:00:00.000000000 +0300
++++ p7zip_4.27/7zip/UI/Console/ExtractCallbackNULL.h 2005-09-23 09:48:09.000000000 +0400
+@@ -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);
++
++ // ICryptoGetTextPassword
++ STDMETHOD(CryptoGetTextPassword)(BSTR *password);
++
++ HRESULT BeforeOpen(const wchar_t *name);
++ HRESULT OpenResult(const wchar_t *name, HRESULT result);
++ 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 CExtractCallbackNULL::Init()
++ {
++ NumArchives = 0;
++ NumArchiveErrors = 0;
++ NumFileErrors = 0;
++ NumFileErrorsInCurrentArchive = 0;
++ }
++
++};
++
++#endif
diff --git a/app-arch/p7zip/files/p7zip_4.44-libun7zip.patch b/app-arch/p7zip/files/p7zip_4.44-libun7zip.patch
new file mode 100644
index 0000000..e3216c4
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_4.44-libun7zip.patch
@@ -0,0 +1,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
diff --git a/app-arch/p7zip/files/p7zip_4.57-ds-rusxmms.patch b/app-arch/p7zip/files/p7zip_4.57-ds-rusxmms.patch
new file mode 100644
index 0000000..0913c13
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_4.57-ds-rusxmms.patch
@@ -0,0 +1,336 @@
+diff -dPNur p7zip_4.57/C/rccrecode.c p7zip_4.57-new/C/rccrecode.c
+--- p7zip_4.57/C/rccrecode.c 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.57-new/C/rccrecode.c 2008-04-11 20:23:42.000000000 +0200
+@@ -0,0 +1,71 @@
++#include <pthread.h>
++#include <librcc.h>
++
++static rcc_class_default_charset default_oem[] = {
++ { "ru", "IBM866" },
++ { NULL, NULL }
++};
++
++static rcc_class_default_charset default_iso[] = {
++ { "ru", "CP1251" },
++ { NULL, NULL }
++};
++
++#define ARC_CLASS 0
++#define OUT_CLASS 1
++#define ARCOUT_CLASS 0
++static rcc_class classes[] = {
++ { "oem", RCC_CLASS_STANDARD, NULL, default_oem, "OEM Encoding", 0 },
++ { "out", RCC_CLASS_STANDARD, "LC_CTYPE", NULL, "Output", 0 },
++ { NULL, RCC_CLASS_STANDARD, NULL, NULL, NULL, 0 }
++};
++
++static int initialized = 0;
++static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
++
++void *rcc_init() {
++ rcc_context ctx;
++
++ pthread_mutex_lock(&mutex);
++ if (!initialized) {
++ rccInit();
++ rccInitDefaultContext(NULL, 0, 0, classes, 0);
++ rccLoad(NULL, "zip");
++ rccInitDb4(NULL, NULL, 0);
++ }
++ initialized++;
++ pthread_mutex_unlock(&mutex);
++
++ ctx = rccCreateContext(NULL, 0, 0, classes, 0);
++ if (ctx) rccInitDb4(ctx, NULL, 0);
++ if (ctx) rccLoad(ctx, "zip");
++
++ return ctx;
++}
++
++
++void rcc_free(void *ctx) {
++ if (ctx) rccFreeContext((rcc_context)ctx);
++
++ pthread_mutex_lock(&mutex);
++ if (initialized == 1) rccFree();
++ initialized--;
++ pthread_mutex_unlock(&mutex);
++}
++
++
++char *rcc_read(void *ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, ARC_CLASS, OUT_CLASS, string, size, NULL);
++}
++
++char *rcc_write(rcc_context ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, OUT_CLASS, ARCOUT_CLASS, string, size, NULL);
++}
+diff -dPNur p7zip_4.57/C/rccrecode.h p7zip_4.57-new/C/rccrecode.h
+--- p7zip_4.57/C/rccrecode.h 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.57-new/C/rccrecode.h 2008-04-11 20:23:42.000000000 +0200
+@@ -0,0 +1,17 @@
++#ifndef _RCC_RECODE_H
++#define _RCC_RECODE_H
++
++# ifdef __cplusplus
++extern "C" {
++# endif
++
++ void *rcc_init();
++ void rcc_free(void *ctx);
++ char *rcc_read(void *ctx, const char *string, size_t size);
++ char *rcc_write(void *ctx, const char *string, size_t size);
++
++# ifdef __cplusplus
++}
++# endif
++
++#endif /* _RCC_RECODE_H */
+diff -dPNur p7zip_4.57/CPP/7zip/Archive/Zip/ZipIn.cpp p7zip_4.57-new/CPP/7zip/Archive/Zip/ZipIn.cpp
+--- p7zip_4.57/CPP/7zip/Archive/Zip/ZipIn.cpp 2007-12-08 11:19:00.000000000 +0100
++++ p7zip_4.57-new/CPP/7zip/Archive/Zip/ZipIn.cpp 2008-04-11 20:23:42.000000000 +0200
+@@ -9,11 +9,22 @@
+ #include "../../Common/LimitedStreams.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ namespace NArchive {
+ namespace NZip {
++
++CInArchive::CInArchive() {
++ rccctx = rcc_init();
++}
++
++CInArchive::~CInArchive() {
++ rcc_free(rccctx);
++}
++
+
+ // static const char kEndOfString = '\0';
+-
++
+ bool CInArchive::Open(IInStream *inStream, const UInt64 *searchHeaderSizeLimit)
+ {
+ m_Stream = inStream;
+@@ -196,10 +207,18 @@
+
+ AString CInArchive::ReadFileName(UInt32 nameSize)
+ {
++ char *rccrec;
+ if (nameSize == 0)
+ return AString();
+ SafeReadBytes(m_NameBuffer.GetBuffer(nameSize), nameSize);
+ m_NameBuffer.ReleaseBuffer(nameSize);
++
++ rccrec = rcc_read(rccctx, (LPCSTR)m_NameBuffer, 0);
++ if (rccrec) {
++ m_NameBuffer = rccrec;
++ free(rccrec);
++ }
++
+ return m_NameBuffer;
+ }
+
+diff -dPNur p7zip_4.57/CPP/7zip/Archive/Zip/ZipIn.h p7zip_4.57-new/CPP/7zip/Archive/Zip/ZipIn.h
+--- p7zip_4.57/CPP/7zip/Archive/Zip/ZipIn.h 2007-12-08 11:19:00.000000000 +0100
++++ p7zip_4.57-new/CPP/7zip/Archive/Zip/ZipIn.h 2008-04-11 20:23:42.000000000 +0200
+@@ -106,6 +106,10 @@
+ bool SeekInArchive(UInt64 position);
+ ISequentialInStream *CreateLimitedStream(UInt64 position, UInt64 size);
+ IInStream* CreateStream();
++
++ void *rccctx;
++ CInArchive();
++ ~CInArchive();
+ };
+
+ }}
+diff -dPNur p7zip_4.57/CPP/7zip/Archive/Zip/ZipOut.cpp p7zip_4.57-new/CPP/7zip/Archive/Zip/ZipOut.cpp
+--- p7zip_4.57/CPP/7zip/Archive/Zip/ZipOut.cpp 2007-06-26 20:06:23.000000000 +0200
++++ p7zip_4.57-new/CPP/7zip/Archive/Zip/ZipOut.cpp 2008-04-11 20:23:42.000000000 +0200
+@@ -7,9 +7,19 @@
+ #include "../../Common/OffsetStream.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ namespace NArchive {
+ namespace NZip {
+
++COutArchive::COutArchive() {
++ rccctx = rcc_init();
++}
++
++COutArchive::~COutArchive() {
++ rcc_free(rccctx);
++}
++
+ void COutArchive::Create(IOutStream *outStream)
+ {
+ if (!m_OutBuffer.Create(1 << 16))
+@@ -112,6 +122,7 @@
+ {
+ SeekTo(m_BasePosition);
+
++ char *rccrec;
+ bool isZip64 = m_IsZip64 || item.PackSize >= 0xFFFFFFFF || item.UnPackSize >= 0xFFFFFFFF;
+
+ WriteUInt32(NSignature::kLocalFileHeader);
+@@ -130,6 +141,12 @@
+ throw CSystemException(E_FAIL);
+ }
+ WriteUInt16((UInt16)m_ExtraSize); // test it;
++ rccrec = rcc_write(rccctx, (const char *)item.Name, item.Name.Length());
++ if (rccrec) {
++ printf("%u, %s.\n", item.Name.Length(), rccrec);
++ WriteBytes(rccrec, strlen(rccrec));
++ free(rccrec);
++ } else
+ WriteBytes((const char *)item.Name, item.Name.Length());
+
+ UInt32 extraPos = 0;
+@@ -154,6 +171,7 @@
+
+ void COutArchive::WriteCentralHeader(const CItem &item)
+ {
++ char *rccrec;
+ bool isUnPack64 = item.UnPackSize >= 0xFFFFFFFF;
+ bool isPack64 = item.PackSize >= 0xFFFFFFFF;
+ bool isPosition64 = item.LocalHeaderPosition >= 0xFFFFFFFF;
+@@ -180,6 +198,13 @@
+ WriteUInt16(item.InternalAttributes);
+ WriteUInt32(item.ExternalAttributes);
+ WriteUInt32(isPosition64 ? 0xFFFFFFFF: (UInt32)item.LocalHeaderPosition);
++
++ rccrec = rcc_write(rccctx, (const char *)item.Name, item.Name.Length());
++ if (rccrec) {
++ printf("C: %u, %s.\n", item.Name.Length(), rccrec);
++ WriteBytes(rccrec, strlen(rccrec));
++ free(rccrec);
++ } else
+ WriteBytes((const char *)item.Name, item.Name.Length());
+ if (isZip64)
+ {
+diff -dPNur p7zip_4.57/CPP/7zip/Archive/Zip/ZipOut.h p7zip_4.57-new/CPP/7zip/Archive/Zip/ZipOut.h
+--- p7zip_4.57/CPP/7zip/Archive/Zip/ZipOut.h 2007-06-26 20:06:22.000000000 +0200
++++ p7zip_4.57-new/CPP/7zip/Archive/Zip/ZipOut.h 2008-04-11 20:23:42.000000000 +0200
+@@ -49,6 +49,11 @@
+ void CreateStreamForCompressing(IOutStream **outStream);
+ void CreateStreamForCopying(ISequentialOutStream **outStream);
+ void SeekToPackedDataPosition();
++
++ void *rccctx;
++ COutArchive();
++ ~COutArchive();
++
+ };
+
+ }}
+diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Alone/makefile p7zip_4.57-new/CPP/7zip/Bundles/Alone/makefile
+--- p7zip_4.57/CPP/7zip/Bundles/Alone/makefile 2007-07-24 20:55:33.000000000 +0200
++++ p7zip_4.57-new/CPP/7zip/Bundles/Alone/makefile 2008-04-11 20:23:42.000000000 +0200
+@@ -15,6 +15,7 @@
+ LIBS=$(LOCAL_LIBS)
+
+ OBJS=\
++rccrecode.o \
+ myGetTickCount.o \
+ wine_date_and_time.o \
+ myAddExeFlag.o \
+diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Alone/makefile.list p7zip_4.57-new/CPP/7zip/Bundles/Alone/makefile.list
+--- p7zip_4.57/CPP/7zip/Bundles/Alone/makefile.list 2007-07-24 20:56:10.000000000 +0200
++++ p7zip_4.57-new/CPP/7zip/Bundles/Alone/makefile.list 2008-04-11 20:23:42.000000000 +0200
+@@ -196,6 +196,7 @@
+ ../../../../C/Compress/Branch/BranchPPC.c \
+ ../../../../C/Compress/Branch/BranchSPARC.c \
+ ../../../../C/Compress/Branch/BranchX86.c \
++ ../../../../C/rccrecode.c \
+ ../../../../C/7zCrc.c \
+ ../../../../C/Sort.c \
+ ../../../../C/Threads.c \
+@@ -237,6 +238,8 @@
+ $(CXX) $(CFLAGS) ../../../Common/IntToString.cpp
+ ListFileUtils.o : ../../../Common/ListFileUtils.cpp
+ $(CXX) $(CFLAGS) ../../../Common/ListFileUtils.cpp
++rccrecode.o : ../../../../C/rccrecode.c
++ $(CC) $(CFLAGS) ../../../../C/rccrecode.c
+ MyWindows.o : ../../../Common/MyWindows.cpp
+ $(CXX) $(CFLAGS) ../../../Common/MyWindows.cpp
+ Random.o : ../../../Common/Random.cpp
+diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Format7zFree/makefile p7zip_4.57-new/CPP/7zip/Bundles/Format7zFree/makefile
+--- p7zip_4.57/CPP/7zip/Bundles/Format7zFree/makefile 2007-08-03 20:16:04.000000000 +0200
++++ p7zip_4.57-new/CPP/7zip/Bundles/Format7zFree/makefile 2008-04-11 20:30:53.000000000 +0200
+@@ -14,6 +14,7 @@
+ LIBS=$(LOCAL_LIBS_DLL)
+
+ OBJS = \
++rccrecode.o \
+ wine_date_and_time.o \
+ myGetTickCount.o \
+ CRC.o \
+diff -dPNur p7zip_4.57/CPP/7zip/Bundles/Format7zFree/makefile.list p7zip_4.57-new/CPP/7zip/Bundles/Format7zFree/makefile.list
+--- p7zip_4.57/CPP/7zip/Bundles/Format7zFree/makefile.list 2007-08-03 20:17:57.000000000 +0200
++++ p7zip_4.57-new/CPP/7zip/Bundles/Format7zFree/makefile.list 2008-04-11 20:32:11.000000000 +0200
+@@ -218,6 +218,7 @@
+ ../../../../C/Compress/Branch/BranchPPC.c \
+ ../../../../C/Compress/Branch/BranchSPARC.c \
+ ../../../../C/Compress/Branch/BranchX86.c \
++ ../../../../C/rccrecode.c \
+ ../../../../C/7zCrc.c \
+ ../../../../C/Sort.c \
+ ../../../../C/Threads.c \
+@@ -237,6 +238,8 @@
+ $(CXX) $(CC_SHARED) $(CFLAGS) ../../../Common/ListFileUtils.cpp
+ MyWindows.o : ../../../Common/MyWindows.cpp
+ $(CXX) $(CC_SHARED) $(CFLAGS) ../../../Common/MyWindows.cpp
++rccrecode.o : ../../../../C/rccrecode.c
++ $(CC) $(CC_SHARED) $(CFLAGS) ../../../../C/rccrecode.c
+ Random.o : ../../../Common/Random.cpp
+ $(CXX) $(CC_SHARED) $(CFLAGS) ../../../Common/Random.cpp
+ StdInStream.o : ../../../Common/StdInStream.cpp
+diff -dPNur p7zip_4.57/makefile.machine p7zip_4.57-new/makefile.machine
+--- p7zip_4.57/makefile.machine 2007-12-15 18:19:48.000000000 +0100
++++ p7zip_4.57-new/makefile.machine 2008-04-11 20:23:42.000000000 +0200
+@@ -14,7 +14,7 @@
+ CC_SHARED=-fPIC
+ LINK_SHARED=-fPIC -shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
+ OBJ_CRC32=$(OBJ_CRC32_C)
+diff -dPNur p7zip_4.57/makefile.machine.orig p7zip_4.57-new/makefile.machine.orig
+--- p7zip_4.57/makefile.machine.orig 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.57-new/makefile.machine.orig 2007-12-15 18:19:48.000000000 +0100
+@@ -0,0 +1,21 @@
++#
++# makefile for Linux (x86, PPC, alpha ...)
++#
++
++OPTFLAGS=-O
++
++ALLFLAGS=${OPTFLAGS} -s \
++ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
++ -DNDEBUG -D_REENTRANT -DENV_UNIX \
++ $(LOCAL_FLAGS)
++
++CXX=g++ $(ALLFLAGS)
++CC=gcc $(ALLFLAGS)
++CC_SHARED=-fPIC
++LINK_SHARED=-fPIC -shared
++
++LOCAL_LIBS=-lpthread
++LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
++
++OBJ_CRC32=$(OBJ_CRC32_C)
++
diff --git a/app-arch/p7zip/files/p7zip_4.57-libun7zip.patch b/app-arch/p7zip/files/p7zip_4.57-libun7zip.patch
new file mode 100644
index 0000000..07a3188
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_4.57-libun7zip.patch
@@ -0,0 +1,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
diff --git a/app-arch/p7zip/files/p7zip_4.65-ds-rusxmms.patch b/app-arch/p7zip/files/p7zip_4.65-ds-rusxmms.patch
new file mode 100644
index 0000000..7072522
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_4.65-ds-rusxmms.patch
@@ -0,0 +1,305 @@
+diff -dPNur p7zip_4.65/C/rccrecode.c p7zip_4.65-new/C/rccrecode.c
+--- p7zip_4.65/C/rccrecode.c 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/C/rccrecode.c 2009-06-14 02:44:19.000000000 +0200
+@@ -0,0 +1,71 @@
++#include <pthread.h>
++#include <librcc.h>
++
++static rcc_class_default_charset default_oem[] = {
++ { "ru", "IBM866" },
++ { NULL, NULL }
++};
++
++static rcc_class_default_charset default_iso[] = {
++ { "ru", "CP1251" },
++ { NULL, NULL }
++};
++
++#define ARC_CLASS 0
++#define OUT_CLASS 1
++#define ARCOUT_CLASS 0
++static rcc_class classes[] = {
++ { "oem", RCC_CLASS_STANDARD, NULL, default_oem, "OEM Encoding", 0 },
++ { "out", RCC_CLASS_STANDARD, "LC_CTYPE", NULL, "Output", 0 },
++ { NULL, RCC_CLASS_STANDARD, NULL, NULL, NULL, 0 }
++};
++
++static int initialized = 0;
++static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
++
++void *rcc_init() {
++ rcc_context ctx;
++
++ pthread_mutex_lock(&mutex);
++ if (!initialized) {
++ rccInit();
++ rccInitDefaultContext(NULL, 0, 0, classes, 0);
++ rccLoad(NULL, "zip");
++ rccInitDb4(NULL, NULL, 0);
++ }
++ initialized++;
++ pthread_mutex_unlock(&mutex);
++
++ ctx = rccCreateContext(NULL, 0, 0, classes, 0);
++ if (ctx) rccInitDb4(ctx, NULL, 0);
++ if (ctx) rccLoad(ctx, "zip");
++
++ return ctx;
++}
++
++
++void rcc_free(void *ctx) {
++ if (ctx) rccFreeContext((rcc_context)ctx);
++
++ pthread_mutex_lock(&mutex);
++ if (initialized == 1) rccFree();
++ initialized--;
++ pthread_mutex_unlock(&mutex);
++}
++
++
++char *rcc_read(void *ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, ARC_CLASS, OUT_CLASS, string, size, NULL);
++}
++
++char *rcc_write(rcc_context ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, OUT_CLASS, ARCOUT_CLASS, string, size, NULL);
++}
+diff -dPNur p7zip_4.65/C/rccrecode.h p7zip_4.65-new/C/rccrecode.h
+--- p7zip_4.65/C/rccrecode.h 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/C/rccrecode.h 2009-06-14 02:44:19.000000000 +0200
+@@ -0,0 +1,17 @@
++#ifndef _RCC_RECODE_H
++#define _RCC_RECODE_H
++
++# ifdef __cplusplus
++extern "C" {
++# endif
++
++ void *rcc_init();
++ void rcc_free(void *ctx);
++ char *rcc_read(void *ctx, const char *string, size_t size);
++ char *rcc_write(void *ctx, const char *string, size_t size);
++
++# ifdef __cplusplus
++}
++# endif
++
++#endif /* _RCC_RECODE_H */
+diff -dPNur p7zip_4.65/CPP/7zip/Archive/Zip/ZipIn.cpp p7zip_4.65-new/CPP/7zip/Archive/Zip/ZipIn.cpp
+--- p7zip_4.65/CPP/7zip/Archive/Zip/ZipIn.cpp 2008-11-28 23:03:44.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Archive/Zip/ZipIn.cpp 2009-06-14 02:47:28.000000000 +0200
+@@ -9,6 +9,8 @@
+ #include "../../Common/LimitedStreams.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ extern "C"
+ {
+ #include "../../../../C/CpuArch.h"
+@@ -23,6 +25,14 @@
+
+ // static const char kEndOfString = '\0';
+
++CInArchive::CInArchive() {
++ rccctx = rcc_init();
++}
++
++CInArchive::~CInArchive() {
++ rcc_free(rccctx);
++}
++
+ HRESULT CInArchive::Open(IInStream *stream, const UInt64 *searchHeaderSizeLimit)
+ {
+ Close();
+@@ -198,12 +208,21 @@
+
+ AString CInArchive::ReadFileName(UInt32 nameSize)
+ {
++ char *rccrec;
++
+ if (nameSize == 0)
+ return AString();
+ char *p = m_NameBuffer.GetBuffer(nameSize);
+ SafeReadBytes(p, nameSize);
+ p[nameSize] = 0;
+ m_NameBuffer.ReleaseBuffer();
++
++ rccrec = rcc_read(rccctx, (LPCSTR)m_NameBuffer, 0);
++ if (rccrec) {
++ m_NameBuffer = rccrec;
++ free(rccrec);
++ }
++
+ return m_NameBuffer;
+ }
+
+diff -dPNur p7zip_4.65/CPP/7zip/Archive/Zip/ZipIn.h p7zip_4.65-new/CPP/7zip/Archive/Zip/ZipIn.h
+--- p7zip_4.65/CPP/7zip/Archive/Zip/ZipIn.h 2008-08-14 11:11:13.000000000 +0200
++++ p7zip_4.65-new/CPP/7zip/Archive/Zip/ZipIn.h 2009-06-14 02:48:32.000000000 +0200
+@@ -108,6 +108,10 @@
+ ISequentialInStream *CreateLimitedStream(UInt64 position, UInt64 size);
+ IInStream* CreateStream();
+
++ void *rccctx;
++ CInArchive();
++ ~CInArchive();
++
+ bool IsOpen() const { return m_Stream != NULL; }
+ };
+
+diff -dPNur p7zip_4.65/CPP/7zip/Archive/Zip/ZipOut.cpp p7zip_4.65-new/CPP/7zip/Archive/Zip/ZipOut.cpp
+--- p7zip_4.65/CPP/7zip/Archive/Zip/ZipOut.cpp 2008-08-14 11:11:26.000000000 +0200
++++ p7zip_4.65-new/CPP/7zip/Archive/Zip/ZipOut.cpp 2009-06-14 02:44:19.000000000 +0200
+@@ -7,9 +7,19 @@
+ #include "../../Common/OffsetStream.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ namespace NArchive {
+ namespace NZip {
+
++COutArchive::COutArchive() {
++ rccctx = rcc_init();
++}
++
++COutArchive::~COutArchive() {
++ rcc_free(rccctx);
++}
++
+ void COutArchive::Create(IOutStream *outStream)
+ {
+ if (!m_OutBuffer.Create(1 << 16))
+@@ -112,6 +122,7 @@
+ {
+ SeekTo(m_BasePosition);
+
++ char *rccrec;
+ bool isZip64 = m_IsZip64 || item.PackSize >= 0xFFFFFFFF || item.UnPackSize >= 0xFFFFFFFF;
+
+ WriteUInt32(NSignature::kLocalFileHeader);
+@@ -130,6 +141,12 @@
+ throw CSystemException(E_FAIL);
+ }
+ WriteUInt16((UInt16)m_ExtraSize); // test it;
++ rccrec = rcc_write(rccctx, (const char *)item.Name, item.Name.Length());
++ if (rccrec) {
++ printf("%u, %s.\n", item.Name.Length(), rccrec);
++ WriteBytes(rccrec, strlen(rccrec));
++ free(rccrec);
++ } else
+ WriteBytes((const char *)item.Name, item.Name.Length());
+
+ UInt32 extraPos = 0;
+@@ -154,6 +171,7 @@
+
+ void COutArchive::WriteCentralHeader(const CItem &item)
+ {
++ char *rccrec;
+ bool isUnPack64 = item.UnPackSize >= 0xFFFFFFFF;
+ bool isPack64 = item.PackSize >= 0xFFFFFFFF;
+ bool isPosition64 = item.LocalHeaderPosition >= 0xFFFFFFFF;
+@@ -181,6 +199,13 @@
+ WriteUInt16(item.InternalAttributes);
+ WriteUInt32(item.ExternalAttributes);
+ WriteUInt32(isPosition64 ? 0xFFFFFFFF: (UInt32)item.LocalHeaderPosition);
++
++ rccrec = rcc_write(rccctx, (const char *)item.Name, item.Name.Length());
++ if (rccrec) {
++ printf("C: %u, %s.\n", item.Name.Length(), rccrec);
++ WriteBytes(rccrec, strlen(rccrec));
++ free(rccrec);
++ } else
+ WriteBytes((const char *)item.Name, item.Name.Length());
+ if (isZip64)
+ {
+diff -dPNur p7zip_4.65/CPP/7zip/Archive/Zip/ZipOut.h p7zip_4.65-new/CPP/7zip/Archive/Zip/ZipOut.h
+--- p7zip_4.65/CPP/7zip/Archive/Zip/ZipOut.h 2008-08-14 11:11:13.000000000 +0200
++++ p7zip_4.65-new/CPP/7zip/Archive/Zip/ZipOut.h 2009-06-14 02:44:19.000000000 +0200
+@@ -49,6 +49,11 @@
+ void CreateStreamForCompressing(IOutStream **outStream);
+ void CreateStreamForCopying(ISequentialOutStream **outStream);
+ void SeekToPackedDataPosition();
++
++ void *rccctx;
++ COutArchive();
++ ~COutArchive();
++
+ };
+
+ }}
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Alone/makefile p7zip_4.65-new/CPP/7zip/Bundles/Alone/makefile
+--- p7zip_4.65/CPP/7zip/Bundles/Alone/makefile 2009-02-07 19:39:04.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Alone/makefile 2009-06-14 02:44:19.000000000 +0200
+@@ -250,6 +250,7 @@
+ Sha256.o
+
+ OBJS=\
++rccrecode.o \
+ myGetTickCount.o \
+ wine_date_and_time.o \
+ myAddExeFlag.o \
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Alone/makefile.list p7zip_4.65-new/CPP/7zip/Bundles/Alone/makefile.list
+--- p7zip_4.65/CPP/7zip/Bundles/Alone/makefile.list 2009-02-09 21:04:57.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Alone/makefile.list 2009-06-14 02:51:45.000000000 +0200
+@@ -204,6 +204,7 @@
+ ../../Crypto/ZipStrong.cpp
+
+ SRCS_C=\
++ ../../../../C/rccrecode.c \
+ ../../../../C/Bra.c \
+ ../../../../C/Bra86.c \
+ ../../../../C/BraIA64.c \
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Format7zFree/makefile p7zip_4.65-new/CPP/7zip/Bundles/Format7zFree/makefile
+--- p7zip_4.65/CPP/7zip/Bundles/Format7zFree/makefile 2009-02-09 21:47:24.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Format7zFree/makefile 2009-06-14 03:00:06.000000000 +0200
+@@ -296,6 +296,7 @@
+ Sha256.o \
+
+ OBJS = \
++ rccrecode.o \
+ wine_date_and_time.o \
+ myGetTickCount.o \
+ $(COMMON_OBJS) \
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Format7zFree/makefile.list p7zip_4.65-new/CPP/7zip/Bundles/Format7zFree/makefile.list
+--- p7zip_4.65/CPP/7zip/Bundles/Format7zFree/makefile.list 2009-02-09 21:04:32.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Format7zFree/makefile.list 2009-06-14 03:00:39.000000000 +0200
+@@ -235,6 +235,7 @@
+ ../../Crypto/ZipStrong.cpp
+
+ SRCS_C=\
++ ../../../../C/rccrecode.c \
+ ../../../../C/Bra.c \
+ ../../../../C/Bra86.c \
+ ../../../../C/BraIA64.c \
+diff -dPNur p7zip_4.65/makefile.machine p7zip_4.65-new/makefile.machine
+--- p7zip_4.65/makefile.machine 2009-02-14 18:19:09.000000000 +0100
++++ p7zip_4.65-new/makefile.machine 2009-06-14 02:44:19.000000000 +0200
+@@ -14,7 +14,7 @@
+ CC_SHARED=-fPIC
+ LINK_SHARED=-fPIC -shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
+ OBJ_CRC32=$(OBJ_CRC32_C)
+diff -dPNur p7zip_4.65/makefile.rules p7zip_4.65-new/makefile.rules
+--- p7zip_4.65/makefile.rules 2009-02-09 21:03:16.000000000 +0100
++++ p7zip_4.65-new/makefile.rules 2009-06-14 02:52:48.000000000 +0200
+@@ -558,3 +558,5 @@
+ 7zCrcT8.o : ../../../../C/7zCrcT8.c
+ $(CC) $(CFLAGS) ../../../../C/7zCrcT8.c
+
++rccrecode.o : ../../../../C/rccrecode.c
++ $(CC) $(CFLAGS) ../../../../C/rccrecode.c
diff --git a/app-arch/p7zip/files/p7zip_4.65-libun7zip.patch b/app-arch/p7zip/files/p7zip_4.65-libun7zip.patch
new file mode 100644
index 0000000..7646c3f
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_4.65-libun7zip.patch
@@ -0,0 +1,550 @@
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Un7Zip/makefile p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/makefile
+--- p7zip_4.65/CPP/7zip/Bundles/Un7Zip/makefile 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/makefile 2009-06-14 23:15:12.000000000 +0200
+@@ -0,0 +1,137 @@
++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)
++
++SFX_CONSOLE_OBJS = \
++ Un7Zip.o
++
++CONSOLE_OBJS = \
++ ConsoleClose.o \
++ ExtractCallbackConsole.o \
++ ExtractCallbackNULL.o \
++ List.o \
++ OpenCallbackConsole.o \
++ UserInputUtils.o \
++
++# NewHandler.o
++COMMON_OBJS = \
++ CommandLineParser.o \
++ CRC.o \
++ IntToString.o \
++ StdInStream.o \
++ StdOutStream.o \
++ MyString.o \
++ MyWindows.o\
++ StringConvert.o \
++ MyVector.o \
++ Wildcard.o \
++
++# DLL.o
++WIN_OBJS = \
++ Error.o \
++ FileDir.o \
++ FileFind.o \
++ FileIO.o \
++ FileName.o \
++ PropVariant.o \
++ PropVariantConversions.o \
++ Synchronization.o \
++ System.o
++
++7ZIP_COMMON_OBJS = \
++ CreateCoder.o \
++ FilePathAutoRename.o \
++ FileStreams.o \
++ InBuffer.o \
++ FilterCoder.o \
++ LimitedStreams.o \
++ LockedStream.o \
++ OutBuffer.o \
++ ProgressUtils.o \
++ StreamBinder.o \
++ StreamObjects.o \
++ StreamUtils.o \
++ VirtThread.o \
++
++UI_COMMON_OBJS = \
++ ArchiveExtractCallback.o \
++ ArchiveOpenCallback.o \
++ DefaultName.o \
++ LoadCodecs.o \
++ Extract.o \
++ ExtractingFilePath.o \
++ OpenArchive.o \
++ PropIDUtils.o \
++
++AR_COMMON_OBJS = \
++ CoderMixer2.o \
++ CoderMixer2MT.o \
++ CrossThreadProgress.o \
++ ItemNameUtils.o \
++ OutStreamWithCRC.o \
++
++
++7Z_OBJS = \
++ 7zDecode.o \
++ 7zExtract.o \
++ 7zFolderOutStream.o \
++ 7zHandler.o \
++ 7zHeader.o \
++ 7zIn.o \
++ 7zRegister.o \
++
++COMPRESS_OBJS = \
++ BranchCoder.o \
++ Bcj2Coder.o \
++ Bcj2Register.o \
++ BcjCoder.o \
++ BcjRegister.o \
++ CopyCoder.o \
++ CopyRegister.o \
++ LzmaDecoder.o \
++ LzmaRegister.o \
++ PpmdDecoder.o \
++ PpmdRegister.o \
++
++CRYPTO_OBJS = \
++ 7zAes.o \
++ 7zAesRegister.o \
++ MyAes.o \
++
++# Alloc.o
++C_OBJS = \
++ Bra86.o \
++ LzmaDec.o \
++ Threads.o \
++ Aes.o \
++ Sha256.o \
++
++OBJS = \
++ myGetTickCount.o\
++ wine_date_and_time.o\
++ mySplitCommandLine.o\
++ $(SFX_CONSOLE_OBJS) \
++ $(CONSOLE_OBJS) \
++ $(COMMON_OBJS) \
++ $(WIN_OBJS) \
++ $(7ZIP_COMMON_OBJS) \
++ $(UI_COMMON_OBJS) \
++ $(AR_COMMON_OBJS) \
++ $(7Z_OBJS) \
++ $(COMPRESS_OBJS) \
++ $(CRYPTO_OBJS) \
++ $(C_OBJS) \
++ $(OBJ_CRC32)
++
++
++include ../../../../makefile.glb
++
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Un7Zip/makefile.depend p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/makefile.depend
+--- p7zip_4.65/CPP/7zip/Bundles/Un7Zip/makefile.depend 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/makefile.depend 2009-06-14 23:15:12.000000000 +0200
+@@ -0,0 +1 @@
++
+\ No newline at end of file
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Un7Zip/makefile.list p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/makefile.list
+--- p7zip_4.65/CPP/7zip/Bundles/Un7Zip/makefile.list 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/makefile.list 2009-06-14 23:16:37.000000000 +0200
+@@ -0,0 +1,10 @@
++CXXFLAGS += $(CC_SHARED)
++CFLAGS += $(CC_SHARED)
++
++include ../../../../makefile.rules
++
++ExtractCallbackNULL.o : ../../UI/Console/ExtractCallbackNULL.cpp
++ $(CXX) $(CFLAGS) ../../UI/Console/ExtractCallbackNULL.cpp
++
++Un7Zip.o : ./Un7Zip.cpp
++ $(CXX) $(CFLAGS) ./Un7Zip.cpp
+diff -dPNur p7zip_4.65/CPP/7zip/Bundles/Un7Zip/testlib.c p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/testlib.c
+--- p7zip_4.65/CPP/7zip/Bundles/Un7Zip/testlib.c 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/testlib.c 2009-06-14 23:15:12.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.65/CPP/7zip/Bundles/Un7Zip/u7zip.h p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/u7zip.h
+--- p7zip_4.65/CPP/7zip/Bundles/Un7Zip/u7zip.h 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/u7zip.h 2009-06-14 23:15:12.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.65/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp
+--- p7zip_4.65/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/Bundles/Un7Zip/Un7Zip.cpp 2009-06-14 23:15:12.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.IsDir())
++ 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, CIntVector(),
++ 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, CIntVector(),
++ v1, v2,
++ wildcardCensorHead,
++ true, false,
++ passwordEnabled,
++ password, numErrors);
++
++ if (result != S_OK)
++ return S_FALSE;;
++ }
++ }
++ return S_OK;
++}
+diff -dPNur p7zip_4.65/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp p7zip_4.65-new/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp
+--- p7zip_4.65/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/UI/Console/ExtractCallbackNULL.cpp 2009-06-14 23:15:12.000000000 +0200
+@@ -0,0 +1,130 @@
++// 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::kAutoRenameAll:
++ *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;
++ }
++ return StringToBstr(Password, password);
++}
++
++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.65/CPP/7zip/UI/Console/ExtractCallbackNULL.h p7zip_4.65-new/CPP/7zip/UI/Console/ExtractCallbackNULL.h
+--- p7zip_4.65/CPP/7zip/UI/Console/ExtractCallbackNULL.h 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_4.65-new/CPP/7zip/UI/Console/ExtractCallbackNULL.h 2009-06-14 23:15:12.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
diff --git a/app-arch/p7zip/files/p7zip_9.04-ds-rusxmms.patch b/app-arch/p7zip/files/p7zip_9.04-ds-rusxmms.patch
new file mode 100644
index 0000000..7678241
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_9.04-ds-rusxmms.patch
@@ -0,0 +1,294 @@
+diff -dPNur p7zip-9.04~dfsg.1/C/rccrecode.c p7zip-9.04~dfsg.1-ds/C/rccrecode.c
+--- p7zip-9.04~dfsg.1/C/rccrecode.c 1970-01-01 03:00:00.000000000 +0300
++++ p7zip-9.04~dfsg.1-ds/C/rccrecode.c 2009-10-28 03:29:23.000000000 +0300
+@@ -0,0 +1,71 @@
++#include <pthread.h>
++#include <librcc.h>
++
++static rcc_class_default_charset default_oem[] = {
++ { "ru", "IBM866" },
++ { NULL, NULL }
++};
++
++static rcc_class_default_charset default_iso[] = {
++ { "ru", "CP1251" },
++ { NULL, NULL }
++};
++
++#define ARC_CLASS 0
++#define OUT_CLASS 1
++#define ARCOUT_CLASS 0
++static rcc_class classes[] = {
++ { "oem", RCC_CLASS_STANDARD, NULL, default_oem, "OEM Encoding", 0 },
++ { "out", RCC_CLASS_STANDARD, "LC_CTYPE", NULL, "Output", 0 },
++ { NULL, RCC_CLASS_STANDARD, NULL, NULL, NULL, 0 }
++};
++
++static int initialized = 0;
++static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
++
++void *rcc_init() {
++ rcc_context ctx;
++
++ pthread_mutex_lock(&mutex);
++ if (!initialized) {
++ rccInit();
++ rccInitDefaultContext(NULL, 0, 0, classes, 0);
++ rccLoad(NULL, "zip");
++ rccInitDb4(NULL, NULL, 0);
++ }
++ initialized++;
++ pthread_mutex_unlock(&mutex);
++
++ ctx = rccCreateContext(NULL, 0, 0, classes, 0);
++ if (ctx) rccInitDb4(ctx, NULL, 0);
++ if (ctx) rccLoad(ctx, "zip");
++
++ return ctx;
++}
++
++
++void rcc_free(void *ctx) {
++ if (ctx) rccFreeContext((rcc_context)ctx);
++
++ pthread_mutex_lock(&mutex);
++ if (initialized == 1) rccFree();
++ initialized--;
++ pthread_mutex_unlock(&mutex);
++}
++
++
++char *rcc_read(void *ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, ARC_CLASS, OUT_CLASS, string, size, NULL);
++}
++
++char *rcc_write(rcc_context ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, OUT_CLASS, ARCOUT_CLASS, string, size, NULL);
++}
+diff -dPNur p7zip-9.04~dfsg.1/C/rccrecode.h p7zip-9.04~dfsg.1-ds/C/rccrecode.h
+--- p7zip-9.04~dfsg.1/C/rccrecode.h 1970-01-01 03:00:00.000000000 +0300
++++ p7zip-9.04~dfsg.1-ds/C/rccrecode.h 2009-10-28 03:29:23.000000000 +0300
+@@ -0,0 +1,17 @@
++#ifndef _RCC_RECODE_H
++#define _RCC_RECODE_H
++
++# ifdef __cplusplus
++extern "C" {
++# endif
++
++ void *rcc_init();
++ void rcc_free(void *ctx);
++ char *rcc_read(void *ctx, const char *string, size_t size);
++ char *rcc_write(void *ctx, const char *string, size_t size);
++
++# ifdef __cplusplus
++}
++# endif
++
++#endif /* _RCC_RECODE_H */
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipIn.cpp p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipIn.cpp
+--- p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipIn.cpp 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipIn.cpp 2009-10-28 03:49:06.000000000 +0300
+@@ -9,6 +9,8 @@
+ #include "../../Common/LimitedStreams.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ #include "ZipIn.h"
+
+ #define Get16(p) GetUi16(p)
+@@ -17,7 +19,17 @@
+
+ namespace NArchive {
+ namespace NZip {
+-
++
++CInArchive::CInArchive()
++{
++ rccctx = rcc_init();
++}
++
++CInArchive::~CInArchive()
++{
++ rcc_free(rccctx);
++}
++
+ HRESULT CInArchive::Open(IInStream *stream, const UInt64 *searchHeaderSizeLimit)
+ {
+ _inBufMode = false;
+@@ -200,12 +212,20 @@
+
+ void CInArchive::ReadFileName(UInt32 nameSize, AString &dest)
+ {
++ char *rccrec;
++
+ if (nameSize == 0)
+ dest.Empty();
+ char *p = dest.GetBuffer((int)nameSize);
+ SafeReadBytes(p, nameSize);
+ p[nameSize] = 0;
+ dest.ReleaseBuffer();
++
++ rccrec = rcc_read(rccctx, (LPCSTR)dest, 0);
++ if (rccrec) {
++ dest = rccrec;
++ free(rccrec);
++ }
+ }
+
+ void CInArchive::GetArchiveInfo(CInArchiveInfo &archiveInfo) const
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipIn.h p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipIn.h
+--- p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipIn.h 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipIn.h 2009-10-28 03:29:23.000000000 +0300
+@@ -114,6 +114,10 @@
+ ISequentialInStream *CreateLimitedStream(UInt64 position, UInt64 size);
+ IInStream* CreateStream();
+
++ void *rccctx;
++ CInArchive();
++ ~CInArchive();
++
+ bool IsOpen() const { return m_Stream != NULL; }
+ };
+
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipOut.h p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipOut.h
+--- p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipOut.h 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipOut.h 2009-10-28 05:49:05.000000000 +0300
+@@ -49,6 +49,11 @@
+ void CreateStreamForCompressing(IOutStream **outStream);
+ void CreateStreamForCopying(ISequentialOutStream **outStream);
+ void SeekToPackedDataPosition();
++
++ void *rccctx;
++ COutArchive();
++ ~COutArchive();
++ void Recode(CItem &item);
+ };
+
+ }}
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipUpdate.cpp p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipUpdate.cpp
+--- p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipUpdate.cpp 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipUpdate.cpp 2009-10-28 05:48:04.000000000 +0300
+@@ -87,6 +87,7 @@
+ item.NtfsATime = ui.NtfsATime;
+ item.NtfsCTime = ui.NtfsCTime;
+ item.NtfsTimeIsDefined = ui.NtfsTimeIsDefined;
++ archive.Recode(item);
+ }
+ else
+ isDir = item.IsDir();
+@@ -359,9 +360,11 @@
+ item.NtfsCTime = ui.NtfsCTime;
+ item.NtfsTimeIsDefined = ui.NtfsTimeIsDefined;
+
++ archive.Recode(item);
++
+ item.CentralExtra.RemoveUnknownSubBlocks();
+ item.LocalExtra.RemoveUnknownSubBlocks();
+-
++
+ archive.PrepareWriteCompressedData2((UInt16)item.Name.Length(), item.UnPackSize, item.PackSize, item.LocalExtra.HasWzAesField());
+ item.LocalHeaderPosition = archive.GetCurrentPosition();
+ archive.SeekToPackedDataPosition();
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Bundles/Alone/makefile p7zip-9.04~dfsg.1-ds/CPP/7zip/Bundles/Alone/makefile
+--- p7zip-9.04~dfsg.1/CPP/7zip/Bundles/Alone/makefile 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Bundles/Alone/makefile 2009-10-28 03:29:24.000000000 +0300
+@@ -244,6 +244,7 @@
+
+
+ OBJS=\
++rccrecode.o \
+ myGetTickCount.o \
+ wine_date_and_time.o \
+ myAddExeFlag.o \
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Bundles/Alone/makefile.list p7zip-9.04~dfsg.1-ds/CPP/7zip/Bundles/Alone/makefile.list
+--- p7zip-9.04~dfsg.1/CPP/7zip/Bundles/Alone/makefile.list 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Bundles/Alone/makefile.list 2009-10-28 03:40:17.000000000 +0300
+@@ -192,6 +192,7 @@
+ ../../Crypto/ZipStrong.cpp
+
+ SRCS_C=\
++ ../../../../C/rccrecode.c \
+ ../../../../C/Aes.c \
+ ../../../../C/7zStream.c \
+ ../../../../C/Bra.c \
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Bundles/Format7zFree/makefile p7zip-9.04~dfsg.1-ds/CPP/7zip/Bundles/Format7zFree/makefile
+--- p7zip-9.04~dfsg.1/CPP/7zip/Bundles/Format7zFree/makefile 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Bundles/Format7zFree/makefile 2009-10-28 03:29:24.000000000 +0300
+@@ -284,6 +284,7 @@
+
+
+ OBJS = \
++ rccrecode.o \
+ wine_date_and_time.o \
+ myGetTickCount.o \
+ $(COMMON_OBJS) \
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Bundles/Format7zFree/makefile.list p7zip-9.04~dfsg.1-ds/CPP/7zip/Bundles/Format7zFree/makefile.list
+--- p7zip-9.04~dfsg.1/CPP/7zip/Bundles/Format7zFree/makefile.list 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Bundles/Format7zFree/makefile.list 2009-10-28 03:34:02.000000000 +0300
+@@ -218,6 +218,7 @@
+ ../../Crypto/ZipStrong.cpp
+
+ SRCS_C=\
++ ../../../../C/rccrecode.c \
+ ../../../../C/7zBuf2.c \
+ ../../../../C/7zStream.c \
+ ../../../../C/Aes.c \
+diff -dPNur p7zip-9.04~dfsg.1/makefile.machine p7zip-9.04~dfsg.1-ds/makefile.machine
+--- p7zip-9.04~dfsg.1/makefile.machine 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/makefile.machine 2009-10-28 03:29:24.000000000 +0300
+@@ -14,7 +14,7 @@
+ CC_SHARED=-fPIC
+ LINK_SHARED=-fPIC -shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
+ OBJ_CRC32=$(OBJ_CRC32_C)
+diff -dPNur p7zip-9.04~dfsg.1/makefile.rules p7zip-9.04~dfsg.1-ds/makefile.rules
+--- p7zip-9.04~dfsg.1/makefile.rules 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/makefile.rules 2009-10-28 03:29:24.000000000 +0300
+@@ -586,3 +586,5 @@
+ 7zCrcT8.o : ../../../../C/7zCrcT8.c
+ $(CC) $(CFLAGS) ../../../../C/7zCrcT8.c
+
++rccrecode.o : ../../../../C/rccrecode.c
++ $(CC) $(CFLAGS) ../../../../C/rccrecode.c
+diff -dPNur p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipOut.cpp p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipOut.cpp
+--- p7zip-9.04~dfsg.1/CPP/7zip/Archive/Zip/ZipOut.cpp 2009-06-27 18:18:14.000000000 +0400
++++ p7zip-9.04~dfsg.1-ds/CPP/7zip/Archive/Zip/ZipOut.cpp 2009-10-28 05:49:01.000000000 +0300
+@@ -7,9 +7,24 @@
+ #include "../../Common/OffsetStream.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ namespace NArchive {
+ namespace NZip {
+
++COutArchive::COutArchive() {
++ rccctx = rcc_init();
++}
++
++COutArchive::~COutArchive() {
++ rcc_free(rccctx);
++}
++
++void COutArchive::Recode(CItem &item) {
++ char *rccrec = rcc_write(rccctx, (const char *)item.Name, item.Name.Length());
++ if (rccrec) item.Name = rccrec;
++}
++
+ void COutArchive::Create(IOutStream *outStream)
+ {
+ if (!m_OutBuffer.Create(1 << 16))
diff --git a/app-arch/p7zip/files/p7zip_9.13-ds-dynbuf.patch b/app-arch/p7zip/files/p7zip_9.13-ds-dynbuf.patch
new file mode 100644
index 0000000..7f16a3a
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_9.13-ds-dynbuf.patch
@@ -0,0 +1,12 @@
+diff -dPNur p7zip_9.13/CPP/Common/DynamicBuffer.h p7zip_9.13-ds/CPP/Common/DynamicBuffer.h
+--- p7zip_9.13/CPP/Common/DynamicBuffer.h 2008-08-25 21:40:32.000000000 +0200
++++ p7zip_9.13-ds/CPP/Common/DynamicBuffer.h 2013-07-14 01:31:24.000000000 +0200
+@@ -17,7 +17,7 @@
+ else
+ delta = 4;
+ delta = MyMax(delta, size);
+- SetCapacity(this->_capacity + delta);
++ this->SetCapacity(this->_capacity + delta);
+ }
+ public:
+ CDynamicBuffer(): CBuffer<T>() {};
diff --git a/app-arch/p7zip/files/p7zip_9.13-ds-rusxmms.patch b/app-arch/p7zip/files/p7zip_9.13-ds-rusxmms.patch
new file mode 100644
index 0000000..df27ac2
--- /dev/null
+++ b/app-arch/p7zip/files/p7zip_9.13-ds-rusxmms.patch
@@ -0,0 +1,307 @@
+diff -dPNur p7zip_9.13/C/rccrecode.c p7zip_9.13-rusxmms/C/rccrecode.c
+--- p7zip_9.13/C/rccrecode.c 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_9.13-rusxmms/C/rccrecode.c 2010-07-31 20:32:27.000000000 +0200
+@@ -0,0 +1,73 @@
++#include <pthread.h>
++#include <librcc.h>
++
++static rcc_class_default_charset default_oem[] = {
++ { "ru", "IBM866" },
++ { NULL, NULL }
++};
++
++static rcc_class_default_charset default_iso[] = {
++ { "ru", "CP1251" },
++ { NULL, NULL }
++};
++
++#define ARC_CLASS 0
++#define OUT_CLASS 1
++#define ARCOUT_CLASS 0
++static rcc_class classes[] = {
++ { "oem", RCC_CLASS_STANDARD, NULL, default_oem, "OEM Encoding", 0 },
++ { "out", RCC_CLASS_STANDARD, "LC_CTYPE", NULL, "Output", 0 },
++ { NULL, RCC_CLASS_STANDARD, NULL, NULL, NULL, 0 }
++};
++
++static int initialized = 0;
++static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
++
++void *rcc_init() {
++ rcc_context ctx;
++
++ pthread_mutex_lock(&mutex);
++ if (!initialized) {
++ rccInit();
++// rccInitDefaultContext(NULL, 0, 0, classes, 0);
++// rccInitDb4(NULL, NULL, 0);
++// rccLoad(NULL, "zip");
++ }
++ initialized++;
++ pthread_mutex_unlock(&mutex);
++
++ ctx = rccCreateContext(NULL, 0, 0, classes, 0);
++ if (ctx) {
++ rccInitDb4(ctx, NULL, 0);
++ rccLoad(ctx, "zip");
++ }
++
++ return ctx;
++}
++
++
++void rcc_free(void *ctx) {
++ if (ctx) rccFreeContext((rcc_context)ctx);
++
++ pthread_mutex_lock(&mutex);
++ if (initialized == 1) rccFree();
++ initialized--;
++ pthread_mutex_unlock(&mutex);
++}
++
++
++char *rcc_read(void *ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, ARC_CLASS, OUT_CLASS, string, size, NULL);
++}
++
++char *rcc_write(void *ctx, const char *string, size_t size) {
++ if (!initialized) {
++ rcc_init();
++ if (!initialized) return NULL;
++ }
++ return rccSizedRecode((rcc_context)ctx, OUT_CLASS, ARCOUT_CLASS, string, size, NULL);
++}
+diff -dPNur p7zip_9.13/C/rccrecode.h p7zip_9.13-rusxmms/C/rccrecode.h
+--- p7zip_9.13/C/rccrecode.h 1970-01-01 01:00:00.000000000 +0100
++++ p7zip_9.13-rusxmms/C/rccrecode.h 2010-07-31 14:07:34.000000000 +0200
+@@ -0,0 +1,17 @@
++#ifndef _RCC_RECODE_H
++#define _RCC_RECODE_H
++
++# ifdef __cplusplus
++extern "C" {
++# endif
++
++ void *rcc_init();
++ void rcc_free(void *ctx);
++ char *rcc_read(void *ctx, const char *string, size_t size);
++ char *rcc_write(void *ctx, const char *string, size_t size);
++
++# ifdef __cplusplus
++}
++# endif
++
++#endif /* _RCC_RECODE_H */
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipIn.cpp p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipIn.cpp
+--- p7zip_9.13/CPP/7zip/Archive/Zip/ZipIn.cpp 2010-04-25 17:14:42.000000000 +0200
++++ p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipIn.cpp 2010-07-31 20:33:42.000000000 +0200
+@@ -9,6 +9,8 @@
+ #include "../../Common/LimitedStreams.h"
+ #include "../../Common/StreamUtils.h"
+
++#include "../../../../C/rccrecode.h"
++
+ #include "ZipIn.h"
+
+ #define Get16(p) GetUi16(p)
+@@ -17,7 +19,17 @@
+
+ namespace NArchive {
+ namespace NZip {
+-
++
++CInArchive::CInArchive()
++{
++ rccctx = rcc_init();
++}
++
++CInArchive::~CInArchive()
++{
++ rcc_free(rccctx);
++}
++
+ HRESULT CInArchive::Open(IInStream *stream, const UInt64 *searchHeaderSizeLimit)
+ {
+ _inBufMode = false;
+@@ -200,12 +212,20 @@
+
+ void CInArchive::ReadFileName(UInt32 nameSize, AString &dest)
+ {
++ char *rccrec;
++
+ if (nameSize == 0)
+ dest.Empty();
+ char *p = dest.GetBuffer((int)nameSize);
+ SafeReadBytes(p, nameSize);
+ p[nameSize] = 0;
+ dest.ReleaseBuffer();
++
++ rccrec = rcc_read(rccctx, (LPCSTR)dest, 0);
++ if (rccrec) {
++ dest = rccrec;
++ free(rccrec);
++ }
+ }
+
+ void CInArchive::ReadExtra(UInt32 extraSize, CExtraBlock &extraBlock,
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipIn.cpp.orig p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipIn.cpp.orig
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipIn.h p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipIn.h
+--- p7zip_9.13/CPP/7zip/Archive/Zip/ZipIn.h 2010-04-25 17:14:27.000000000 +0200
++++ p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipIn.h 2010-07-31 20:33:42.000000000 +0200
+@@ -117,6 +117,10 @@
+ ISequentialInStream *CreateLimitedStream(UInt64 position, UInt64 size);
+ IInStream* CreateStream();
+
++ void *rccctx;
++ CInArchive();
++ ~CInArchive();
++
+ bool IsOpen() const { return m_Stream != NULL; }
+ };
+
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipIn.h.orig p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipIn.h.orig
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipOut.cpp p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipOut.cpp
+--- p7zip_9.13/CPP/7zip/Archive/Zip/ZipOut.cpp 2010-04-25 17:14:42.000000000 +0200
++++ p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipOut.cpp 2010-07-31 20:33:42.000000000 +0200
+@@ -6,9 +6,24 @@
+
+ #include "ZipOut.h"
+
++#include "../../../../C/rccrecode.h"
++
+ namespace NArchive {
+ namespace NZip {
+
++COutArchive::COutArchive() {
++ rccctx = rcc_init();
++}
++
++COutArchive::~COutArchive() {
++ rcc_free(rccctx);
++}
++
++void COutArchive::Recode(CItem &item) {
++ char *rccrec = rcc_write(rccctx, (const char *)item.Name, item.Name.Length());
++ if (rccrec) item.Name = rccrec;
++}
++
+ void COutArchive::Create(IOutStream *outStream)
+ {
+ if (!m_OutBuffer.Create(1 << 16))
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipOut.cpp.orig p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipOut.cpp.orig
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipOut.h p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipOut.h
+--- p7zip_9.13/CPP/7zip/Archive/Zip/ZipOut.h 2010-04-25 17:14:27.000000000 +0200
++++ p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipOut.h 2010-07-31 20:33:42.000000000 +0200
+@@ -49,6 +49,11 @@
+ void CreateStreamForCompressing(IOutStream **outStream);
+ void CreateStreamForCopying(ISequentialOutStream **outStream);
+ void SeekToPackedDataPosition();
++
++ void *rccctx;
++ COutArchive();
++ ~COutArchive();
++ void Recode(CItem &item);
+ };
+
+ }}
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipUpdate.cpp p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipUpdate.cpp
+--- p7zip_9.13/CPP/7zip/Archive/Zip/ZipUpdate.cpp 2010-04-25 17:25:47.000000000 +0200
++++ p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipUpdate.cpp 2010-07-31 20:33:42.000000000 +0200
+@@ -86,6 +86,7 @@
+ item.NtfsATime = ui.NtfsATime;
+ item.NtfsCTime = ui.NtfsCTime;
+ item.NtfsTimeIsDefined = ui.NtfsTimeIsDefined;
++ archive.Recode(item);
+ }
+ else
+ isDir = item.IsDir();
+@@ -358,9 +359,11 @@
+ item.NtfsCTime = ui.NtfsCTime;
+ item.NtfsTimeIsDefined = ui.NtfsTimeIsDefined;
+
++ archive.Recode(item);
++
+ item.CentralExtra.RemoveUnknownSubBlocks();
+ item.LocalExtra.RemoveUnknownSubBlocks();
+-
++
+ archive.PrepareWriteCompressedData2((UInt16)item.Name.Length(), item.UnPackSize, item.PackSize, item.LocalExtra.HasWzAesField());
+ item.LocalHeaderPosition = archive.GetCurrentPosition();
+ archive.SeekToPackedDataPosition();
+diff -dPNur p7zip_9.13/CPP/7zip/Archive/Zip/ZipUpdate.cpp.orig p7zip_9.13-rusxmms/CPP/7zip/Archive/Zip/ZipUpdate.cpp.orig
+diff -dPNur p7zip_9.13/CPP/7zip/Bundles/Alone/makefile p7zip_9.13-rusxmms/CPP/7zip/Bundles/Alone/makefile
+--- p7zip_9.13/CPP/7zip/Bundles/Alone/makefile 2010-03-16 20:15:59.000000000 +0100
++++ p7zip_9.13-rusxmms/CPP/7zip/Bundles/Alone/makefile 2010-07-31 20:33:42.000000000 +0200
+@@ -251,6 +251,7 @@
+
+
+ OBJS=\
++rccrecode.o \
+ myGetTickCount.o \
+ wine_date_and_time.o \
+ myAddExeFlag.o \
+diff -dPNur p7zip_9.13/CPP/7zip/Bundles/Alone/makefile.list p7zip_9.13-rusxmms/CPP/7zip/Bundles/Alone/makefile.list
+--- p7zip_9.13/CPP/7zip/Bundles/Alone/makefile.list 2010-03-16 20:17:05.000000000 +0100
++++ p7zip_9.13-rusxmms/CPP/7zip/Bundles/Alone/makefile.list 2010-07-31 20:33:42.000000000 +0200
+@@ -194,6 +194,7 @@
+ ../../Crypto/ZipStrong.cpp
+
+ SRCS_C=\
++ ../../../../C/rccrecode.c \
+ ../../../../C/Aes.c \
+ ../../../../C/7zStream.c \
+ ../../../../C/Alloc.c \
+diff -dPNur p7zip_9.13/CPP/7zip/Bundles/Alone/makefile.list.orig p7zip_9.13-rusxmms/CPP/7zip/Bundles/Alone/makefile.list.orig
+diff -dPNur p7zip_9.13/CPP/7zip/Bundles/Alone/makefile.orig p7zip_9.13-rusxmms/CPP/7zip/Bundles/Alone/makefile.orig
+diff -dPNur p7zip_9.13/CPP/7zip/Bundles/Format7zFree/makefile p7zip_9.13-rusxmms/CPP/7zip/Bundles/Format7zFree/makefile
+--- p7zip_9.13/CPP/7zip/Bundles/Format7zFree/makefile 2010-03-16 20:49:21.000000000 +0100
++++ p7zip_9.13-rusxmms/CPP/7zip/Bundles/Format7zFree/makefile 2010-07-31 20:33:42.000000000 +0200
+@@ -298,6 +298,7 @@
+
+
+ OBJS = \
++ rccrecode.o \
+ wine_date_and_time.o \
+ myGetTickCount.o \
+ $(COMMON_OBJS) \
+diff -dPNur p7zip_9.13/CPP/7zip/Bundles/Format7zFree/makefile.list p7zip_9.13-rusxmms/CPP/7zip/Bundles/Format7zFree/makefile.list
+--- p7zip_9.13/CPP/7zip/Bundles/Format7zFree/makefile.list 2010-03-16 20:50:11.000000000 +0100
++++ p7zip_9.13-rusxmms/CPP/7zip/Bundles/Format7zFree/makefile.list 2010-07-31 20:33:42.000000000 +0200
+@@ -224,6 +224,7 @@
+ ../../Crypto/ZipStrong.cpp
+
+ SRCS_C=\
++ ../../../../C/rccrecode.c \
+ ../../../../C/7zBuf2.c \
+ ../../../../C/7zStream.c \
+ ../../../../C/Aes.c \
+diff -dPNur p7zip_9.13/CPP/7zip/Bundles/Format7zFree/makefile.list.orig p7zip_9.13-rusxmms/CPP/7zip/Bundles/Format7zFree/makefile.list.orig
+diff -dPNur p7zip_9.13/CPP/7zip/Bundles/Format7zFree/makefile.orig p7zip_9.13-rusxmms/CPP/7zip/Bundles/Format7zFree/makefile.orig
+diff -dPNur p7zip_9.13/makefile.machine p7zip_9.13-rusxmms/makefile.machine
+--- p7zip_9.13/makefile.machine 2010-05-30 10:33:48.000000000 +0200
++++ p7zip_9.13-rusxmms/makefile.machine 2010-07-31 20:33:42.000000000 +0200
+@@ -15,7 +15,7 @@
+ CC_SHARED=-fPIC
+ LINK_SHARED=-fPIC -shared
+
+-LOCAL_LIBS=-lpthread
++LOCAL_LIBS=-lpthread -lrcc
+ LOCAL_LIBS_DLL=$(LOCAL_LIBS) -ldl
+
+ OBJ_CRC32=$(OBJ_CRC32_C)
+diff -dPNur p7zip_9.13/makefile.machine.orig p7zip_9.13-rusxmms/makefile.machine.orig
+diff -dPNur p7zip_9.13/makefile.rules p7zip_9.13-rusxmms/makefile.rules
+--- p7zip_9.13/makefile.rules 2010-03-16 20:18:44.000000000 +0100
++++ p7zip_9.13-rusxmms/makefile.rules 2010-07-31 20:33:42.000000000 +0200
+@@ -655,3 +655,5 @@
+ LangUtils.o : ../../UI/FileManager/LangUtils.cpp
+ $(CXX) $(CXXFLAGS) ../../UI/FileManager/LangUtils.cpp
+
++rccrecode.o : ../../../../C/rccrecode.c
++ $(CC) $(CFLAGS) ../../../../C/rccrecode.c
+diff -dPNur p7zip_9.13/makefile.rules.orig p7zip_9.13-rusxmms/makefile.rules.orig
+diff -dPNur p7zip_9.13/p7zip_9.04-ds-rusxmms.patch p7zip_9.13-rusxmms/p7zip_9.04-ds-rusxmms.patch