├── ask.ico ├── no.ico ├── yes.ico ├── upx ├── upx.exe └── LICENSE ├── libs ├── iso │ ├── iso.h │ ├── iso_wincmd.h │ └── iso_read.txt ├── cab │ ├── REDIST.TXT │ ├── LIB │ │ └── FDI.LIB │ ├── EULA.txt │ └── README.TXT ├── zlib │ ├── contrib │ │ ├── README.contrib │ │ └── minizip │ │ │ ├── crypt.h │ │ │ ├── ioapi.h │ │ │ └── ioapi.c │ ├── inffast.h │ ├── gzclose.c │ ├── uncompr.c │ ├── compress.c │ ├── inftrees.h │ ├── gzguts.h │ ├── README │ ├── adler32.c │ ├── inffixed.h │ ├── inflate.h │ ├── zutil.h │ ├── zutil.c │ └── trees.h ├── readme.txt ├── bzip2 │ ├── mk251.c │ ├── LICENSE │ ├── randtable.c │ ├── crctable.c │ ├── bzlib.h │ └── huffman.c ├── inifile │ ├── IniFile.h │ └── Readme.html ├── unrarlib │ └── unrarlib.h └── tar │ └── src │ └── tar.h ├── DiskDirExtended.cpp ├── DiskDirExtended.opt ├── distrib └── wcx_DiskDirExtended_1.68.zip ├── wcx.def ├── inilocator.h ├── api_totalcmd.h ├── DiskDirExtended.dsw ├── defs.h ├── DirTree.h ├── resource.h ├── DiskDirExtended.sln ├── DirTreeNode.h ├── resrc1.h ├── .gitignore ├── settings.h ├── DirTree.cpp ├── README.md ├── wcxhead.h ├── DirTreeNode.cpp ├── inilocator.cpp └── DiskDirExtended.rc /ask.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrePe0/diskdir-extended/HEAD/ask.ico -------------------------------------------------------------------------------- /no.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrePe0/diskdir-extended/HEAD/no.ico -------------------------------------------------------------------------------- /yes.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrePe0/diskdir-extended/HEAD/yes.ico -------------------------------------------------------------------------------- /upx/upx.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrePe0/diskdir-extended/HEAD/upx/upx.exe -------------------------------------------------------------------------------- /libs/iso/iso.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrePe0/diskdir-extended/HEAD/libs/iso/iso.h -------------------------------------------------------------------------------- /DiskDirExtended.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrePe0/diskdir-extended/HEAD/DiskDirExtended.cpp -------------------------------------------------------------------------------- /DiskDirExtended.opt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrePe0/diskdir-extended/HEAD/DiskDirExtended.opt -------------------------------------------------------------------------------- /libs/cab/REDIST.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrePe0/diskdir-extended/HEAD/libs/cab/REDIST.TXT -------------------------------------------------------------------------------- /libs/cab/LIB/FDI.LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrePe0/diskdir-extended/HEAD/libs/cab/LIB/FDI.LIB -------------------------------------------------------------------------------- /libs/zlib/contrib/README.contrib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrePe0/diskdir-extended/HEAD/libs/zlib/contrib/README.contrib -------------------------------------------------------------------------------- /distrib/wcx_DiskDirExtended_1.68.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrePe0/diskdir-extended/HEAD/distrib/wcx_DiskDirExtended_1.68.zip -------------------------------------------------------------------------------- /libs/readme.txt: -------------------------------------------------------------------------------- 1 | This directory contains just PORTIONS of actual libraries. 2 | They are here in order to make my sources compilable/linkable without changes. 3 | Peter Trebaticky 4 | -------------------------------------------------------------------------------- /wcx.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | OpenArchive 3 | ReadHeader 4 | ReadHeaderEx 5 | ProcessFile 6 | CloseArchive 7 | DeleteFiles 8 | SetChangeVolProc 9 | SetProcessDataProc 10 | GetPackerCaps 11 | PackFiles 12 | ConfigurePacker 13 | -------------------------------------------------------------------------------- /inilocator.h: -------------------------------------------------------------------------------- 1 | #ifndef INILOCATOR_H 2 | #define INILOCATOR_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "libs/inifile/IniFile.h" 9 | using namespace std; 10 | 11 | extern string get_wincmd_ini_location(); 12 | 13 | #endif -------------------------------------------------------------------------------- /libs/zlib/inffast.h: -------------------------------------------------------------------------------- 1 | /* inffast.h -- header to use inffast.c 2 | * Copyright (C) 1995-2003, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); 12 | -------------------------------------------------------------------------------- /api_totalcmd.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include "wcxhead.h" 3 | 4 | /* mandatory functions */ 5 | typedef HANDLE (__stdcall *fOpenArchive)(tOpenArchiveData *ArchiveData); 6 | typedef int (__stdcall *fReadHeader)(HANDLE hArcData, tHeaderData *HeaderData); 7 | typedef int (__stdcall *fProcessFile)(HANDLE hArcData, int Operation, char *DestPath, char *DestName); 8 | typedef int (__stdcall *fCloseArchive)(HANDLE hArcData); 9 | 10 | /* optional function */ 11 | typedef int (__stdcall *fGetPackerCaps)(void); 12 | typedef BOOL (__stdcall *fCanYouHandleThisFile)(char *FileName); 13 | typedef int (__stdcall *fReadHeaderEx)(HANDLE hArcData, tHeaderDataEx *HeaderData); 14 | -------------------------------------------------------------------------------- /DiskDirExtended.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "DiskDirExtended"=.\DiskDirExtended.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /libs/iso/iso_wincmd.h: -------------------------------------------------------------------------------- 1 | #include "../../wcxhead.h" 2 | 3 | // File Attributes 4 | #define FA_READONLY 0x1 //Read-only file 5 | #define FA_HIDDEN 0x2 //Hidden file 6 | #define FA_SYSTEM 0x4 //System file 7 | #define FA_VOLUME_ID 0x8 //Volume ID file 8 | #define FA_DIRECTORY 0x10 //Directory 9 | #define FA_ARCHIVE 0x20 //Archive file 10 | #define FA_ANY 0x3F //Any file 11 | 12 | // modified by TrePe 13 | extern HANDLE __stdcall ISO_OpenArchive( tOpenArchiveData* ArchiveData ); 14 | extern int __stdcall ISO_ReadHeaderEx( HANDLE hArcData, tHeaderDataEx* HeaderData ); 15 | extern int __stdcall ISO_ProcessFile(HANDLE hArcData); 16 | extern int __stdcall ISO_CloseArchive( HANDLE hArcData ); -------------------------------------------------------------------------------- /libs/zlib/gzclose.c: -------------------------------------------------------------------------------- 1 | /* gzclose.c -- zlib gzclose() function 2 | * Copyright (C) 2004, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #include "gzguts.h" 7 | 8 | /* gzclose() is in a separate file so that it is linked in only if it is used. 9 | That way the other gzclose functions can be used instead to avoid linking in 10 | unneeded compression or decompression routines. */ 11 | int ZEXPORT gzclose(file) 12 | gzFile file; 13 | { 14 | #ifndef NO_GZCOMPRESS 15 | gz_statep state; 16 | 17 | if (file == NULL) 18 | return Z_STREAM_ERROR; 19 | state = (gz_statep)file; 20 | 21 | return state->mode == GZ_READ ? gzclose_r(file) : gzclose_w(file); 22 | #else 23 | return gzclose_r(file); 24 | #endif 25 | } 26 | -------------------------------------------------------------------------------- /defs.h: -------------------------------------------------------------------------------- 1 | // (c) 2006 Peter Trebaticky 2 | // Last change: 2006/12/24 3 | 4 | #ifndef DEFS_H 5 | #define DEFS_H 6 | 7 | #include 8 | #include 9 | 10 | enum FILE_TYPE_ENUM { 11 | FILE_TYPE_REGULAR, 12 | FILE_TYPE_DIRECTORY, 13 | FILE_TYPE_ACE, 14 | FILE_TYPE_ARJ, 15 | FILE_TYPE_CAB, 16 | FILE_TYPE_JAR, 17 | FILE_TYPE_RAR, 18 | FILE_TYPE_TAR, 19 | FILE_TYPE_TBZ, 20 | FILE_TYPE_TGZ, 21 | FILE_TYPE_ZIP, 22 | FILE_TYPE_ISO, 23 | FILE_TYPE_BY_WCX, 24 | FILE_TYPE_LAST 25 | }; 26 | 27 | enum LIST_OPTION_ENUM { 28 | LIST_YES, 29 | LIST_NO, 30 | LIST_ASK 31 | }; 32 | 33 | struct FILE_TYPE_ELEM { 34 | FILE_TYPE_ENUM fileType; 35 | std::map >::iterator which_wcx; 36 | LIST_OPTION_ENUM list_this; 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /DirTree.h: -------------------------------------------------------------------------------- 1 | // (c) 2004 Peter Trebaticky 2 | // Last change: 2004/02/07 3 | // 2005/12/26 4 | 5 | #ifndef DIR_TREE_H 6 | #define DIR_TREE_H 7 | 8 | #include "DirTreeNode.h" 9 | #include "wcxhead.h" 10 | 11 | class DirTree { 12 | private: 13 | char fDestName[MAX_FULL_PATH_LEN]; // whole file name (curDestPath + fName) 14 | DirTreeNode *firstLevel; // points to first element on first level, or NULL 15 | public: 16 | DirTree(); 17 | ~DirTree(); 18 | bool insert(const char* curDestPath, const char* fName, const unsigned long long fSize, const unsigned fTime, const int fType); 19 | bool remove(const char* fName); 20 | void writeOut(FILE* fout, char* curPath); 21 | void finalize(); // makes all nodes explicit, i.e. forced = false 22 | void doNotListAsDirLastInserted() { 23 | DirTreeNode::setDoNotListAsDirForLastInserted(); 24 | } 25 | }; 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by DiskDirExtended.rc 4 | // 5 | #define IDC_STATIC -1 6 | #define IDD_SETTINGS 101 7 | #define IDC_INFO 1000 8 | #define IDC_ACE 1001 9 | #define IDC_ARJ 1002 10 | #define IDC_CAB 1003 11 | #define IDC_JAR 1004 12 | #define IDC_RAR 1005 13 | #define IDC_ZIP 1006 14 | 15 | // Next default values for new objects 16 | // 17 | #ifdef APSTUDIO_INVOKED 18 | #ifndef APSTUDIO_READONLY_SYMBOLS 19 | #define _APS_NO_MFC 1 20 | #define _APS_NEXT_RESOURCE_VALUE 101 21 | #define _APS_NEXT_COMMAND_VALUE 40001 22 | #define _APS_NEXT_CONTROL_VALUE 1007 23 | #define _APS_NEXT_SYMED_VALUE 101 24 | #endif 25 | #endif 26 | -------------------------------------------------------------------------------- /DiskDirExtended.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 10.00 3 | # Visual C++ Express 2008 4 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DiskDirExtended", "DiskDirExtended.vcproj", "{5C931FC7-9B48-4EC3-8B4D-790BE87028FC}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Win32 = Debug|Win32 9 | Release|Win32 = Release|Win32 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {5C931FC7-9B48-4EC3-8B4D-790BE87028FC}.Debug|Win32.ActiveCfg = Debug|Win32 13 | {5C931FC7-9B48-4EC3-8B4D-790BE87028FC}.Debug|Win32.Build.0 = Debug|Win32 14 | {5C931FC7-9B48-4EC3-8B4D-790BE87028FC}.Release|Win32.ActiveCfg = Release|Win32 15 | {5C931FC7-9B48-4EC3-8B4D-790BE87028FC}.Release|Win32.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /libs/bzip2/mk251.c: -------------------------------------------------------------------------------- 1 | 2 | /* Spew out a long sequence of the byte 251. When fed to bzip2 3 | versions 1.0.0 or 1.0.1, causes it to die with internal error 4 | 1007 in blocksort.c. This assertion misses an extremely rare 5 | case, which is fixed in this version (1.0.2) and above. 6 | */ 7 | 8 | /* ------------------------------------------------------------------ 9 | This file is part of bzip2/libbzip2, a program and library for 10 | lossless, block-sorting data compression. 11 | 12 | bzip2/libbzip2 version 1.0.5 of 10 December 2007 13 | Copyright (C) 1996-2007 Julian Seward 14 | 15 | Please read the WARNING, DISCLAIMER and PATENTS sections in the 16 | README file. 17 | 18 | This program is released under the terms of the license contained 19 | in the file LICENSE. 20 | ------------------------------------------------------------------ */ 21 | 22 | 23 | #include 24 | 25 | int main () 26 | { 27 | int i; 28 | for (i = 0; i < 48500000 ; i++) 29 | putchar(251); 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /DirTreeNode.h: -------------------------------------------------------------------------------- 1 | #ifndef DIR_TREE_NODE_H 2 | #define DIR_TREE_NODE_H 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | class DirTreeNode { 9 | private: 10 | char* name; 11 | int type; 12 | unsigned long long size; 13 | unsigned time; 14 | DirTreeNode *next; 15 | DirTreeNode *firstChild; 16 | bool forced; // whether this node was created implicitly - if yes, it can be overwritten without affecting its children 17 | static DirTreeNode *lastInserted; // pointer to last inserted node 18 | public: 19 | bool do_not_list_as_dir; // treat this file as regular file even when it has backslash at the end 20 | DirTreeNode(const char* fName, const unsigned long long fSize, const unsigned fTime, const int fType); 21 | ~DirTreeNode(); 22 | void setNext(DirTreeNode *next); 23 | void setForced(bool bln); 24 | DirTreeNode* getNext(); 25 | char* getName(); 26 | bool insert(char* fName, const unsigned long long fSize, const unsigned fTime, const int fType); 27 | bool remove(const char* fName); 28 | void writeOut(FILE* fout, char* curPath); 29 | void finalize(); // makes this node and all its children explicit, i.e. forced = false 30 | static void setDoNotListAsDirForLastInserted() { 31 | if (lastInserted != NULL) lastInserted->do_not_list_as_dir = true; 32 | } 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /libs/cab/EULA.txt: -------------------------------------------------------------------------------- 1 | THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS 2 | PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS 3 | ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES 4 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO 5 | EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR 6 | ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, 7 | CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF 8 | MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE 9 | POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION 10 | OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES 11 | SO THE FOREGOING LIMITATION MAY NOT APPLY. 12 | 13 | MICROSOFT DOES NOT WARRANT THAT THE FUNCTIONS FOR THE LICENSED SOFTWARE 14 | OR CODE CONTAINED IN THE KNOWLEDGE BASE WILL MEET YOUR REQUIREMENTS, OR 15 | THAT THE OPERATION OF THE LICENSED SOFTWARE OR CODE WILL BE UNINTERRUPTED 16 | OR ERROR-FREE, OR THAT DEFECTS IN THE LICENSED SOFTWARE OR CODE CAN BE 17 | CORRECTED. FURTHERMORE, MICROSOFT DOES NOT WARRANT OR MAKE ANY 18 | REPRESENTATIONS REGARDING THE USE OR THE RESULTS OF THE USE OF THE LICENSED 19 | SOFTWARE, CODE OR RELATED DOCUMENTATION IN TERMS OF THEIR CORRECTNESS, 20 | ACCURACY, RELIABILITY, OR OTHERWISE. NO ORAL OR WRITTEN INFORMATION OR ADVICE 21 | GIVEN BY MICROSOFT OR ITS AUTHORIZED REPRESENTATIVES SHALL CREATE A WARRANTY 22 | OR IN ANY WAY INCREASE THE SCOPE OF THIS WARRANTY. SHOULD THE LICENSED 23 | SOFTWARE OR CODE PROVE DEFECTIVE AFTER MICROSOFT HAS DELIVERED THE SAME, 24 | YOU, AND YOU ALONE, SHALL ASSUME THE ENTIRE COST ASSOCIATED WITH ALL 25 | NECESSARY SERVICING, REPAIR OR CORRECTION. 26 | 27 | 28 | -------------------------------------------------------------------------------- /libs/bzip2/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------- 3 | 4 | This program, "bzip2", the associated library "libbzip2", and all 5 | documentation, are copyright (C) 1996-2007 Julian R Seward. All 6 | rights reserved. 7 | 8 | Redistribution and use in source and binary forms, with or without 9 | modification, are permitted provided that the following conditions 10 | are met: 11 | 12 | 1. Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | 15 | 2. The origin of this software must not be misrepresented; you must 16 | not claim that you wrote the original software. If you use this 17 | software in a product, an acknowledgment in the product 18 | documentation would be appreciated but is not required. 19 | 20 | 3. Altered source versions must be plainly marked as such, and must 21 | not be misrepresented as being the original software. 22 | 23 | 4. The name of the author may not be used to endorse or promote 24 | products derived from this software without specific prior written 25 | permission. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS 28 | OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 29 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 30 | ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY 31 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 32 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 33 | GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 34 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 35 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 36 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 37 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | Julian Seward, jseward@bzip.org 40 | bzip2/libbzip2 version 1.0.5 of 10 December 2007 41 | 42 | -------------------------------------------------------------------------- 43 | -------------------------------------------------------------------------------- /libs/zlib/uncompr.c: -------------------------------------------------------------------------------- 1 | /* uncompr.c -- decompress a memory buffer 2 | * Copyright (C) 1995-2003, 2010 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Decompresses the source buffer into the destination buffer. sourceLen is 13 | the byte length of the source buffer. Upon entry, destLen is the total 14 | size of the destination buffer, which must be large enough to hold the 15 | entire uncompressed data. (The size of the uncompressed data must have 16 | been saved previously by the compressor and transmitted to the decompressor 17 | by some mechanism outside the scope of this compression library.) 18 | Upon exit, destLen is the actual size of the compressed buffer. 19 | 20 | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not 21 | enough memory, Z_BUF_ERROR if there was not enough room in the output 22 | buffer, or Z_DATA_ERROR if the input data was corrupted. 23 | */ 24 | int ZEXPORT uncompress (dest, destLen, source, sourceLen) 25 | Bytef *dest; 26 | uLongf *destLen; 27 | const Bytef *source; 28 | uLong sourceLen; 29 | { 30 | z_stream stream; 31 | int err; 32 | 33 | stream.next_in = (Bytef*)source; 34 | stream.avail_in = (uInt)sourceLen; 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | 45 | err = inflateInit(&stream); 46 | if (err != Z_OK) return err; 47 | 48 | err = inflate(&stream, Z_FINISH); 49 | if (err != Z_STREAM_END) { 50 | inflateEnd(&stream); 51 | if (err == Z_NEED_DICT || (err == Z_BUF_ERROR && stream.avail_in == 0)) 52 | return Z_DATA_ERROR; 53 | return err; 54 | } 55 | *destLen = stream.total_out; 56 | 57 | err = inflateEnd(&stream); 58 | return err; 59 | } 60 | -------------------------------------------------------------------------------- /resrc1.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by DiskDirExtended.rc 4 | // 5 | #define IDD_LIST_FILE 102 6 | #define IDI_YES 104 7 | #define IDI_NO 105 8 | #define IDI_ASK 106 9 | #define IDS_LIST_COLUMNS_QUERY 109 10 | #define IDS_ADDITIONAL_INFO 110 11 | #define IDS_ADDITIONAL_INFO_TITLE 111 12 | #define IDS_ERROR_CREATE_INI 112 13 | #define IDS_LIST_COLUMNS_TITLE 113 14 | #define IDC_YES_FORALL 1001 15 | #define IDC_NO_FORALL 1002 16 | #define IDC_FILE_NAME 1004 17 | #define IDC_TAR 1007 18 | #define IDC_TGZ 1008 19 | #define IDC_TBZ 1009 20 | #define IDC_RAR2 1010 21 | #define IDC_ISO 1010 22 | #define IDC_EMPTY 1015 23 | #define IDC_LIST 1017 24 | #define IDC_LIST_ARCHIVES 1017 25 | #define IDC_RADIO1 1018 26 | #define IDC_RADIO2 1019 27 | #define IDC_RADIO3 1020 28 | #define IDC_RADIO4 1021 29 | #define IDC_RADIO5 1022 30 | #define IDC_RADIO6 1023 31 | #define IDC_RADIO7 1024 32 | #define IDC_RADIO8 1025 33 | #define IDC_CHECK1 1026 34 | #define IDC_CHECK2 1027 35 | #define IDC_CHECK3 1028 36 | #define IDC_CHECK4 1029 37 | #define IDC_CHECK5 1030 38 | #define IDC_CHECK6 1031 39 | #define IDC_CHECK7 1032 40 | #define IDC_STATIC_LIST_ARCHIVES 1033 41 | 42 | // Next default values for new objects 43 | // 44 | #ifdef APSTUDIO_INVOKED 45 | #ifndef APSTUDIO_READONLY_SYMBOLS 46 | #define _APS_NEXT_RESOURCE_VALUE 110 47 | #define _APS_NEXT_COMMAND_VALUE 40001 48 | #define _APS_NEXT_CONTROL_VALUE 1034 49 | #define _APS_NEXT_SYMED_VALUE 101 50 | #endif 51 | #endif 52 | -------------------------------------------------------------------------------- /libs/zlib/compress.c: -------------------------------------------------------------------------------- 1 | /* compress.c -- compress a memory buffer 2 | * Copyright (C) 1995-2005 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #define ZLIB_INTERNAL 9 | #include "zlib.h" 10 | 11 | /* =========================================================================== 12 | Compresses the source buffer into the destination buffer. The level 13 | parameter has the same meaning as in deflateInit. sourceLen is the byte 14 | length of the source buffer. Upon entry, destLen is the total size of the 15 | destination buffer, which must be at least 0.1% larger than sourceLen plus 16 | 12 bytes. Upon exit, destLen is the actual size of the compressed buffer. 17 | 18 | compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough 19 | memory, Z_BUF_ERROR if there was not enough room in the output buffer, 20 | Z_STREAM_ERROR if the level parameter is invalid. 21 | */ 22 | int ZEXPORT compress2 (dest, destLen, source, sourceLen, level) 23 | Bytef *dest; 24 | uLongf *destLen; 25 | const Bytef *source; 26 | uLong sourceLen; 27 | int level; 28 | { 29 | z_stream stream; 30 | int err; 31 | 32 | stream.next_in = (Bytef*)source; 33 | stream.avail_in = (uInt)sourceLen; 34 | #ifdef MAXSEG_64K 35 | /* Check for source > 64K on 16-bit machine: */ 36 | if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR; 37 | #endif 38 | stream.next_out = dest; 39 | stream.avail_out = (uInt)*destLen; 40 | if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; 41 | 42 | stream.zalloc = (alloc_func)0; 43 | stream.zfree = (free_func)0; 44 | stream.opaque = (voidpf)0; 45 | 46 | err = deflateInit(&stream, level); 47 | if (err != Z_OK) return err; 48 | 49 | err = deflate(&stream, Z_FINISH); 50 | if (err != Z_STREAM_END) { 51 | deflateEnd(&stream); 52 | return err == Z_OK ? Z_BUF_ERROR : err; 53 | } 54 | *destLen = stream.total_out; 55 | 56 | err = deflateEnd(&stream); 57 | return err; 58 | } 59 | 60 | /* =========================================================================== 61 | */ 62 | int ZEXPORT compress (dest, destLen, source, sourceLen) 63 | Bytef *dest; 64 | uLongf *destLen; 65 | const Bytef *source; 66 | uLong sourceLen; 67 | { 68 | return compress2(dest, destLen, source, sourceLen, Z_DEFAULT_COMPRESSION); 69 | } 70 | 71 | /* =========================================================================== 72 | If the default memLevel or windowBits for deflateInit() is changed, then 73 | this function needs to be updated. 74 | */ 75 | uLong ZEXPORT compressBound (sourceLen) 76 | uLong sourceLen; 77 | { 78 | return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) + 79 | (sourceLen >> 25) + 13; 80 | } 81 | -------------------------------------------------------------------------------- /libs/zlib/inftrees.h: -------------------------------------------------------------------------------- 1 | /* inftrees.h -- header to use inftrees.c 2 | * Copyright (C) 1995-2005, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* Structure for decoding tables. Each entry provides either the 12 | information needed to do the operation requested by the code that 13 | indexed that table entry, or it provides a pointer to another 14 | table that indexes more bits of the code. op indicates whether 15 | the entry is a pointer to another table, a literal, a length or 16 | distance, an end-of-block, or an invalid code. For a table 17 | pointer, the low four bits of op is the number of index bits of 18 | that table. For a length or distance, the low four bits of op 19 | is the number of extra bits to get after the code. bits is 20 | the number of bits in this code or part of the code to drop off 21 | of the bit buffer. val is the actual byte to output in the case 22 | of a literal, the base length or distance, or the offset from 23 | the current table to the next table. Each entry is four bytes. */ 24 | typedef struct { 25 | unsigned char op; /* operation, extra bits, table bits */ 26 | unsigned char bits; /* bits in this part of the code */ 27 | unsigned short val; /* offset in table or code value */ 28 | } code; 29 | 30 | /* op values as set by inflate_table(): 31 | 00000000 - literal 32 | 0000tttt - table link, tttt != 0 is the number of table index bits 33 | 0001eeee - length or distance, eeee is the number of extra bits 34 | 01100000 - end of block 35 | 01000000 - invalid code 36 | */ 37 | 38 | /* Maximum size of the dynamic table. The maximum number of code structures is 39 | 1444, which is the sum of 852 for literal/length codes and 592 for distance 40 | codes. These values were found by exhaustive searches using the program 41 | examples/enough.c found in the zlib distribtution. The arguments to that 42 | program are the number of symbols, the initial root table size, and the 43 | maximum bit length of a code. "enough 286 9 15" for literal/length codes 44 | returns returns 852, and "enough 30 6 15" for distance codes returns 592. 45 | The initial root table size (9 or 6) is found in the fifth argument of the 46 | inflate_table() calls in inflate.c and infback.c. If the root table size is 47 | changed, then these maximum sizes would be need to be recalculated and 48 | updated. */ 49 | #define ENOUGH_LENS 852 50 | #define ENOUGH_DISTS 592 51 | #define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) 52 | 53 | /* Type of code to build for inflate_table() */ 54 | typedef enum { 55 | CODES, 56 | LENS, 57 | DISTS 58 | } codetype; 59 | 60 | int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens, 61 | unsigned codes, code FAR * FAR *table, 62 | unsigned FAR *bits, unsigned short FAR *work)); 63 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.sln.docstates 8 | 9 | # Build results 10 | [Dd]ebug/ 11 | [Dd]ebugPublic/ 12 | [Rr]elease/ 13 | [Rr]eleases/ 14 | x64/ 15 | x86/ 16 | build/ 17 | bld/ 18 | [Bb]in/ 19 | [Oo]bj/ 20 | 21 | # Roslyn cache directories 22 | *.ide/ 23 | 24 | # MSTest test Results 25 | [Tt]est[Rr]esult*/ 26 | [Bb]uild[Ll]og.* 27 | 28 | #NUNIT 29 | *.VisualState.xml 30 | TestResult.xml 31 | 32 | # Build Results of an ATL Project 33 | [Dd]ebugPS/ 34 | [Rr]eleasePS/ 35 | dlldata.c 36 | 37 | *_i.c 38 | *_p.c 39 | *_i.h 40 | *.ilk 41 | *.meta 42 | *.obj 43 | *.pch 44 | *.pdb 45 | *.pgc 46 | *.pgd 47 | *.rsp 48 | *.sbr 49 | *.tlb 50 | *.tli 51 | *.tlh 52 | *.tmp 53 | *.tmp_proj 54 | *.log 55 | *.vspscc 56 | *.vssscc 57 | .builds 58 | *.pidb 59 | *.svclog 60 | *.scc 61 | 62 | # Chutzpah Test files 63 | _Chutzpah* 64 | 65 | # Visual C++ cache files 66 | ipch/ 67 | *.aps 68 | *.ncb 69 | *.opensdf 70 | *.sdf 71 | *.cachefile 72 | 73 | # Visual Studio profiler 74 | *.psess 75 | *.vsp 76 | *.vspx 77 | 78 | # TFS 2012 Local Workspace 79 | $tf/ 80 | 81 | # Guidance Automation Toolkit 82 | *.gpState 83 | 84 | # ReSharper is a .NET coding add-in 85 | _ReSharper*/ 86 | *.[Rr]e[Ss]harper 87 | *.DotSettings.user 88 | 89 | # JustCode is a .NET coding addin-in 90 | .JustCode 91 | 92 | # TeamCity is a build add-in 93 | _TeamCity* 94 | 95 | # DotCover is a Code Coverage Tool 96 | *.dotCover 97 | 98 | # NCrunch 99 | _NCrunch_* 100 | .*crunch*.local.xml 101 | 102 | # MightyMoose 103 | *.mm.* 104 | AutoTest.Net/ 105 | 106 | # Web workbench (sass) 107 | .sass-cache/ 108 | 109 | # Installshield output folder 110 | [Ee]xpress/ 111 | 112 | # DocProject is a documentation generator add-in 113 | DocProject/buildhelp/ 114 | DocProject/Help/*.HxT 115 | DocProject/Help/*.HxC 116 | DocProject/Help/*.hhc 117 | DocProject/Help/*.hhk 118 | DocProject/Help/*.hhp 119 | DocProject/Help/Html2 120 | DocProject/Help/html 121 | 122 | # Click-Once directory 123 | publish/ 124 | 125 | # Publish Web Output 126 | *.[Pp]ublish.xml 127 | *.azurePubxml 128 | # TODO: Comment the next line if you want to checkin your web deploy settings 129 | # but database connection strings (with potential passwords) will be unencrypted 130 | *.pubxml 131 | *.publishproj 132 | 133 | # NuGet Packages 134 | *.nupkg 135 | # The packages folder can be ignored because of Package Restore 136 | **/packages/* 137 | # except build/, which is used as an MSBuild target. 138 | !**/packages/build/ 139 | # If using the old MSBuild-Integrated Package Restore, uncomment this: 140 | #!**/packages/repositories.config 141 | 142 | # Windows Azure Build Output 143 | csx/ 144 | *.build.csdef 145 | 146 | # Windows Store app package directory 147 | AppPackages/ 148 | 149 | # Others 150 | sql/ 151 | *.Cache 152 | ClientBin/ 153 | [Ss]tyle[Cc]op.* 154 | ~$* 155 | *~ 156 | *.dbmdl 157 | *.dbproj.schemaview 158 | *.pfx 159 | *.publishsettings 160 | node_modules/ 161 | 162 | # RIA/Silverlight projects 163 | Generated_Code/ 164 | 165 | # Backup & report files from converting an old project file 166 | # to a newer Visual Studio version. Backup files are not needed, 167 | # because we have git ;-) 168 | _UpgradeReport_Files/ 169 | Backup*/ 170 | UpgradeLog*.XML 171 | UpgradeLog*.htm 172 | 173 | # SQL Server files 174 | *.mdf 175 | *.ldf 176 | 177 | # Business Intelligence projects 178 | *.rdl.data 179 | *.bim.layout 180 | *.bim_*.settings 181 | 182 | # Microsoft Fakes 183 | FakesAssemblies/ 184 | -------------------------------------------------------------------------------- /settings.h: -------------------------------------------------------------------------------- 1 | #ifndef __SETTINGS_H 2 | #define __SETTINGS_H 3 | 4 | #include "inilocator.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "libs/inifile/IniFile.h" 10 | #include "defs.h" 11 | #include "api_totalcmd.h" 12 | 13 | using namespace std; 14 | 15 | class Settings { 16 | char iniFileName[MAX_FULL_PATH_LEN]; 17 | 18 | vector equivalent_ext; // as lines from DiskDirExtended.ini 19 | 20 | string lineFormat; 21 | 22 | bool listArchives; 23 | bool tryCanYouHandleThisFile; 24 | bool listEmptyFile; 25 | bool listOnlyDirectories; 26 | 27 | // how many columns to list: 1..8 = (name, size, years, months, days, hours, minutes, seconds) 28 | int listColumns; 29 | bool zerosInDays; 30 | bool zerosInMonths; 31 | bool zerosInHours; 32 | bool zerosInMinutes; 33 | bool zerosInSeconds; 34 | 35 | bool DetermineCanHandleThisFileCapability(const char*); 36 | 37 | public: 38 | map > wcxmap; // mapping extension -> (wcx, can use CanYouHandleThisFile - 0 not determined, 1 can, 2 cannot) 39 | map >::iterator which_wcx; // iterator for wcxmap 40 | map fileTypeMap; 41 | map ::iterator fileTypeMapIt; 42 | set wcxHandleableSet; 43 | set ::iterator wcxHandleableSetIt; 44 | 45 | Settings() { 46 | iniFileName[0] = '\0'; 47 | setDefaults(); 48 | } 49 | 50 | void setDefaults() { 51 | wcxmap.clear(); 52 | fileTypeMap.clear(); 53 | equivalent_ext.clear(); 54 | 55 | tryCanYouHandleThisFile = false; 56 | listArchives = true; 57 | listEmptyFile = false; 58 | listOnlyDirectories = false; 59 | 60 | listColumns = 8; 61 | zerosInMonths = false; 62 | zerosInDays = false; 63 | zerosInHours = false; 64 | zerosInMinutes = false; 65 | zerosInSeconds = false; 66 | lineFormat.empty(); 67 | getLineFormat(); 68 | } 69 | 70 | void setIniLocation(HINSTANCE); 71 | 72 | const char* getIniFileName() {return iniFileName;} 73 | 74 | const bool getTryCanYouHandleThisFile() {return tryCanYouHandleThisFile;} 75 | bool getCanYouHandleThisFile(map >::iterator); 76 | const bool getListArchives() {return listArchives;} 77 | const bool getListEmptyFile() {return listEmptyFile;} 78 | const bool getListOnlyDirectories() {return listOnlyDirectories;} 79 | 80 | const bool getZerosInMonths() {return zerosInMonths;} 81 | const bool getZerosInDays() {return zerosInDays;} 82 | const bool getZerosInHours() {return zerosInHours;} 83 | const bool getZerosInMinutes() {return zerosInMinutes;} 84 | const bool getZerosInSeconds() {return zerosInSeconds;} 85 | 86 | const int getListColumns() {return listColumns;} 87 | 88 | const char* getLineFormat(); 89 | 90 | void readConfig(); 91 | bool saveConfig(); 92 | 93 | void setTryCanYouHandleThisFile(bool val) {tryCanYouHandleThisFile = val;} 94 | void setListArchives(bool val) {listArchives = val;} 95 | void setListEmptyFile(bool val) {listEmptyFile = val;} 96 | void setListOnlyDirectories(bool val) {listOnlyDirectories = val;} 97 | 98 | void setListColumns(int val) {if (val < 1 || val > 8) val = 8; listColumns = val; lineFormat.clear();} 99 | void setZerosInMonths(bool val) {zerosInMonths = val; lineFormat.clear();} 100 | void setZerosInDays(bool val) {zerosInDays = val; lineFormat.clear();} 101 | void setZerosInHours(bool val) {zerosInHours = val; lineFormat.clear();} 102 | void setZerosInMinutes(bool val) {zerosInMinutes = val; lineFormat.clear();} 103 | void setZerosInSeconds(bool val) {zerosInSeconds = val; lineFormat.clear();} 104 | }; 105 | 106 | extern Settings settings; 107 | 108 | #endif -------------------------------------------------------------------------------- /libs/inifile/IniFile.h: -------------------------------------------------------------------------------- 1 | /************************************************************************ 2 | T h e O p e n W i n d o w s P r o j e c t 3 | ------------------------------------------------------------------------ 4 | Filename : IniFile.h 5 | Author(s) : Carsten Breuer 6 | ------------------------------------------------------------------------ 7 | Copyright (c) 2000 by Carsten Breuer (CBreuer@openwin.de) 8 | /************************************************************************/ 9 | 10 | #ifndef INIFILE_H 11 | #define INIFILE_H 12 | 13 | #ifndef OWP_DONT_DEF_FALSE 14 | #ifndef FALSE 15 | #define FALSE 0 16 | #endif 17 | #endif 18 | 19 | #ifndef OWP_DONT_DEF_TRUE 20 | #ifndef TRUE 21 | #define TRUE 1 22 | #endif 23 | #endif 24 | 25 | 26 | #ifndef OWP_DONT_DEF_BOOL 27 | #ifndef BOOL 28 | #define BOOL int 29 | #endif 30 | #endif 31 | 32 | #ifndef OWP_DONT_DEF_CCHR 33 | #ifndef CCHR 34 | #define CCHR const char 35 | #endif 36 | #endif 37 | 38 | #ifndef OWP_DONT_DEF_UCHR 39 | #ifndef UCHR 40 | #define UCHR unsigned char 41 | #endif 42 | #endif 43 | 44 | #ifndef OWP_DONT_DEF_UCCHR 45 | #ifndef UCCHR 46 | #define UCCHR const unsigned char 47 | #endif 48 | #endif 49 | 50 | #ifndef OWP_DONT_DEF_UINT 51 | #ifndef UINT 52 | #define UINT unsigned int 53 | #endif 54 | #endif 55 | 56 | #ifndef OWP_DONT_DEF_WORD 57 | #ifndef WORD 58 | #define WORD unsigned short 59 | #endif 60 | #endif 61 | 62 | #ifdef LINUX /* Remove CR, on unix systems. */ 63 | #define INI_REMOVE_CR 64 | #define DONT_HAVE_STRUPR 65 | #endif 66 | 67 | 68 | #define tpNULL 0 69 | #define tpSECTION 1 70 | #define tpKEYVALUE 2 71 | #define tpCOMMENT 3 72 | 73 | struct ENTRY 74 | { 75 | char Type; 76 | char *pText; 77 | struct ENTRY *pPrev; 78 | struct ENTRY *pNext; 79 | }; 80 | 81 | typedef struct 82 | { 83 | struct ENTRY *pSec; 84 | struct ENTRY *pKey; 85 | char KeyText [8192]; 86 | char ValText [8192]; 87 | char Comment [8192]; 88 | } EFIND; 89 | 90 | /* Macros */ 91 | #define ArePtrValid(Sec,Key,Val) ((Sec!=NULL)&&(Key!=NULL)&&(Val!=NULL)) 92 | 93 | class CIniFile 94 | { 95 | public: 96 | CIniFile (void); 97 | ~CIniFile (void); 98 | UINT GetVersion (void); 99 | BOOL OpenIniFile (CCHR *pFileName); 100 | BOOL ReadBool (CCHR *pSection, CCHR *pKey, BOOL Default); 101 | int ReadInt (CCHR *pSection, CCHR *pKey, int Default); 102 | double ReadDouble (CCHR *pSection, CCHR *pKey, double Default); 103 | CCHR *ReadString (CCHR *pSection, CCHR *pKey, CCHR *pDefault); 104 | 105 | void WriteBool (CCHR *pSection, CCHR *pKey, bool Value); 106 | void WriteInt (CCHR *pSection, CCHR *pKey, int Value); 107 | void WriteDouble (CCHR *pSection, CCHR *pKey, double Value); 108 | void WriteString (CCHR *pSection, CCHR *pKey, CCHR *pValue); 109 | 110 | void CloseIniFile (); 111 | bool WriteIniFile (CCHR *pFileName); 112 | bool DeleteKey (CCHR *pSection, CCHR *pKey); 113 | struct ENTRY *FindSection (CCHR *pSection); 114 | 115 | protected: 116 | struct ENTRY *m_pEntry; 117 | struct ENTRY *m_pCurEntry; 118 | char m_result [8192]; 119 | FILE *m_pIniFile; 120 | void AddKey (struct ENTRY *pEntry, CCHR *pKey, CCHR *pValue); 121 | BOOL AddItem (char Type, CCHR *pText); 122 | bool AddItemAt (struct ENTRY *pEntryAt, char Mode, CCHR *pText); 123 | void FreeMem (void *pPtr); 124 | void FreeAllMem (void); 125 | bool FindKey (CCHR *pSection, CCHR *pKey, EFIND *pList); 126 | bool AddSectionAndKey (CCHR *pSection, CCHR *pKey, CCHR *pValue); 127 | struct ENTRY *MakeNewEntry (void); 128 | private: 129 | }; 130 | 131 | #endif 132 | 133 | 134 | -------------------------------------------------------------------------------- /libs/cab/README.TXT: -------------------------------------------------------------------------------- 1 | 2 | Cabinet Software Development Kit 3 | March 20, 1997 4 | ------------------------------ 5 | 6 | The Cabinet Software Development Kit provides developers with the 7 | components needed to utilize Microsoft's cabinet file technology 8 | within other applications, or to build cabinet file management tools. 9 | Microsoft is committed to making cabinet files an open technology. 10 | 11 | This release of the Cabinet Software Development Kit (formerly called 12 | the Cabinet Resource Kit) provides complete documentation of cabinet 13 | file internals and the various data compression formats used in 14 | cabinet files, including the new LZX data compression technology. 15 | 16 | The executable and library files in this release are for Microsoft 17 | Windows 95 and Microsoft (R) Windows (R) NT on Intel (R) i386 (tm) 18 | platforms. Some libraries for 16-bit applications on Intel x86 19 | platforms and other 32-bit Windows NT platforms are available. 20 | 21 | This package will be updated periodically. Check for the latest at: 22 | 23 | http://www.microsoft.com/workshop/prog/cab 24 | 25 | Microsoft also offer cabinet file classes for JAVA (tm) applications. 26 | The cabinet file package and sample applications are provided in the 27 | Microsoft SDK for JAVA. 28 | 29 | Refer to the file REDIST.TXT for the license agreement for the 30 | Cabinet Software Development Kit including redistribution rights. 31 | 32 | README.TXT This file 33 | REDIST.TXT The Cabinet SDK License Agreement 34 | 35 | BIN\ Cabinet file utilities 36 | CABARC.EXE Basic cabinet file create/view/extract utility 37 | MAKECAB.EXE More-powerful cabinet file creation tool 38 | EXTRACT.EXE Cabinet file extract utility 39 | CABINET.DLL Cabinet create/extract libraries in a DLL 40 | 41 | LIB\ 42 | FCI.LIB File Compression Interface library 43 | FDI.LIB File Decompression Interface library 44 | 45 | INCLUDE\ 46 | FCI.H File Compression Interface header 47 | FDI.H File Decompression Interface header 48 | 49 | DOCS\ 50 | CABARC.DOC User's Guide for CABARC.EXE 51 | MAKECAB.DOC User's Guide for MAKECAB.EXE 52 | FCI-FDI.DOC FCI/FDI Library Description 53 | CABFMT.DOC Cabinet File Format 54 | MSZIPFMT.DOC MSZIP Data Compression Format 55 | LZXFMT.DOC LZX Data Compression Format 56 | 57 | SAMPLES\ 58 | DLL\ Sample DLL interface functions 59 | TESTFCI\ Sample file compression application 60 | TESTFDI\ Sample file decompression application 61 | 62 | The DLL interface functions allow an application to utilize 63 | CABINET.DLL, dynamically loading/unloading the DLL as FCI or FDI 64 | library functions are used. 65 | 66 | The TESTFCI sample creates a cabinet file (set) from a collection of 67 | files named on the command line. TESTFCI limits each .CAB file to 68 | 300K compressed, to demonstrate files spanning across multiple 69 | cabinet or multiple diskettes. 70 | 71 | The TESTFDI sample extracts the files from a cabinet, including files 72 | that span multiple cabinets. It provides details on the handling the 73 | callback messages from FDI. 74 | 75 | Comments and questions may be sent via email addressed to 76 | javacab@microsoft.com. 77 | 78 | Microsoft, MS, and MS-DOS are registered trademarks, and Windows, 79 | Windows NT, Win32, and Visual C++ are trademarks of Microsoft 80 | Corporation in the USA and other countries. Intel is a registered 81 | trademark, and i386 is a trademark of Intel Corporation. Unicode is 82 | a trademark of Unicode, Incorporated. JAVA is a trademark of Sun 83 | Microsystems, Inc. 84 | -------------------------------------------------------------------------------- /libs/bzip2/randtable.c: -------------------------------------------------------------------------------- 1 | 2 | /*-------------------------------------------------------------*/ 3 | /*--- Table for randomising repetitive blocks ---*/ 4 | /*--- randtable.c ---*/ 5 | /*-------------------------------------------------------------*/ 6 | 7 | /* ------------------------------------------------------------------ 8 | This file is part of bzip2/libbzip2, a program and library for 9 | lossless, block-sorting data compression. 10 | 11 | bzip2/libbzip2 version 1.0.5 of 10 December 2007 12 | Copyright (C) 1996-2007 Julian Seward 13 | 14 | Please read the WARNING, DISCLAIMER and PATENTS sections in the 15 | README file. 16 | 17 | This program is released under the terms of the license contained 18 | in the file LICENSE. 19 | ------------------------------------------------------------------ */ 20 | 21 | 22 | #include "bzlib_private.h" 23 | 24 | 25 | /*---------------------------------------------*/ 26 | Int32 BZ2_rNums[512] = { 27 | 619, 720, 127, 481, 931, 816, 813, 233, 566, 247, 28 | 985, 724, 205, 454, 863, 491, 741, 242, 949, 214, 29 | 733, 859, 335, 708, 621, 574, 73, 654, 730, 472, 30 | 419, 436, 278, 496, 867, 210, 399, 680, 480, 51, 31 | 878, 465, 811, 169, 869, 675, 611, 697, 867, 561, 32 | 862, 687, 507, 283, 482, 129, 807, 591, 733, 623, 33 | 150, 238, 59, 379, 684, 877, 625, 169, 643, 105, 34 | 170, 607, 520, 932, 727, 476, 693, 425, 174, 647, 35 | 73, 122, 335, 530, 442, 853, 695, 249, 445, 515, 36 | 909, 545, 703, 919, 874, 474, 882, 500, 594, 612, 37 | 641, 801, 220, 162, 819, 984, 589, 513, 495, 799, 38 | 161, 604, 958, 533, 221, 400, 386, 867, 600, 782, 39 | 382, 596, 414, 171, 516, 375, 682, 485, 911, 276, 40 | 98, 553, 163, 354, 666, 933, 424, 341, 533, 870, 41 | 227, 730, 475, 186, 263, 647, 537, 686, 600, 224, 42 | 469, 68, 770, 919, 190, 373, 294, 822, 808, 206, 43 | 184, 943, 795, 384, 383, 461, 404, 758, 839, 887, 44 | 715, 67, 618, 276, 204, 918, 873, 777, 604, 560, 45 | 951, 160, 578, 722, 79, 804, 96, 409, 713, 940, 46 | 652, 934, 970, 447, 318, 353, 859, 672, 112, 785, 47 | 645, 863, 803, 350, 139, 93, 354, 99, 820, 908, 48 | 609, 772, 154, 274, 580, 184, 79, 626, 630, 742, 49 | 653, 282, 762, 623, 680, 81, 927, 626, 789, 125, 50 | 411, 521, 938, 300, 821, 78, 343, 175, 128, 250, 51 | 170, 774, 972, 275, 999, 639, 495, 78, 352, 126, 52 | 857, 956, 358, 619, 580, 124, 737, 594, 701, 612, 53 | 669, 112, 134, 694, 363, 992, 809, 743, 168, 974, 54 | 944, 375, 748, 52, 600, 747, 642, 182, 862, 81, 55 | 344, 805, 988, 739, 511, 655, 814, 334, 249, 515, 56 | 897, 955, 664, 981, 649, 113, 974, 459, 893, 228, 57 | 433, 837, 553, 268, 926, 240, 102, 654, 459, 51, 58 | 686, 754, 806, 760, 493, 403, 415, 394, 687, 700, 59 | 946, 670, 656, 610, 738, 392, 760, 799, 887, 653, 60 | 978, 321, 576, 617, 626, 502, 894, 679, 243, 440, 61 | 680, 879, 194, 572, 640, 724, 926, 56, 204, 700, 62 | 707, 151, 457, 449, 797, 195, 791, 558, 945, 679, 63 | 297, 59, 87, 824, 713, 663, 412, 693, 342, 606, 64 | 134, 108, 571, 364, 631, 212, 174, 643, 304, 329, 65 | 343, 97, 430, 751, 497, 314, 983, 374, 822, 928, 66 | 140, 206, 73, 263, 980, 736, 876, 478, 430, 305, 67 | 170, 514, 364, 692, 829, 82, 855, 953, 676, 246, 68 | 369, 970, 294, 750, 807, 827, 150, 790, 288, 923, 69 | 804, 378, 215, 828, 592, 281, 565, 555, 710, 82, 70 | 896, 831, 547, 261, 524, 462, 293, 465, 502, 56, 71 | 661, 821, 976, 991, 658, 869, 905, 758, 745, 193, 72 | 768, 550, 608, 933, 378, 286, 215, 979, 792, 961, 73 | 61, 688, 793, 644, 986, 403, 106, 366, 905, 644, 74 | 372, 567, 466, 434, 645, 210, 389, 550, 919, 135, 75 | 780, 773, 635, 389, 707, 100, 626, 958, 165, 504, 76 | 920, 176, 193, 713, 857, 265, 203, 50, 668, 108, 77 | 645, 990, 626, 197, 510, 357, 358, 850, 858, 364, 78 | 936, 638 79 | }; 80 | 81 | 82 | /*-------------------------------------------------------------*/ 83 | /*--- end randtable.c ---*/ 84 | /*-------------------------------------------------------------*/ 85 | -------------------------------------------------------------------------------- /DirTree.cpp: -------------------------------------------------------------------------------- 1 | // (c) 2004 Peter Trebaticky 2 | // Last change: 2004/02/08 3 | 4 | #include "defs.h" 5 | #include "DirTree.h" 6 | #include 7 | #include 8 | 9 | DirTree::DirTree() { 10 | firstLevel = NULL; 11 | } 12 | DirTree::~DirTree() { 13 | for (DirTreeNode *p = firstLevel; p != NULL; ) { 14 | DirTreeNode *q = p->getNext(); 15 | delete p; 16 | p = q; 17 | } 18 | } 19 | bool DirTree::insert(const char* curDestPath, const char* fName, const unsigned long long fSize, const unsigned fTime, const int fType) { 20 | strcpy(fDestName, curDestPath); 21 | strcat(fDestName, fName); 22 | // rem will be pointer to remainder of path, or NULL if no remainder 23 | char* rem = (char*) strchr(fDestName, '\\'); 24 | int fNameLen; 25 | if (rem != NULL) { 26 | if (rem[1] == '\0') { 27 | fNameLen = (int)strlen(fDestName); 28 | rem = NULL; 29 | } else { 30 | fNameLen = (int)(rem - fDestName) + 1; 31 | rem++; 32 | } 33 | } else { 34 | fNameLen = (int)strlen(fDestName); 35 | } 36 | 37 | bool exists = false; 38 | DirTreeNode *q = firstLevel; 39 | for (DirTreeNode *p = firstLevel; p != NULL; q = p, p = p->getNext()) { 40 | if (strncmp(p->getName(), fDestName, fNameLen) == 0 && strlen(p->getName()) == fNameLen) { 41 | exists = p->insert(rem, fSize, fTime, fType); 42 | if (exists == false) return false; // error while inserting 43 | exists = true; 44 | break; 45 | } 46 | } 47 | if (exists == false) { // new element 48 | if (rem != NULL) { // has remainder (directory which was not added before) 49 | char z = fDestName[fNameLen]; 50 | fDestName[fNameLen] = '\0'; 51 | DirTreeNode *a = new DirTreeNode(fDestName, 0, fTime, FILE_TYPE_DIRECTORY); 52 | if (q == NULL) { 53 | firstLevel = a; 54 | } else { 55 | q->setNext(a); 56 | } 57 | fDestName[fNameLen] = z; 58 | a->insert(rem, fSize, fTime, fType); 59 | a->setForced(true); // created implicitly 60 | } else { 61 | DirTreeNode *a = new DirTreeNode(fDestName, fSize, fTime, fType); 62 | if (q == NULL) { 63 | firstLevel = a; 64 | } else { 65 | q->setNext(a); 66 | } 67 | } 68 | } 69 | return true; 70 | } 71 | 72 | bool DirTree::remove(const char* fName) { 73 | // rem will be pointer to remainder of path, or NULL if no remainder 74 | char* rem = (char*) strchr(fName, '\\'); 75 | int fNameLen; 76 | if (rem != NULL) { 77 | if (rem[1] == '\0') { 78 | fNameLen = (int)strlen(fName); 79 | rem = NULL; 80 | } else { 81 | fNameLen = (int)(rem - fName) + 1; 82 | rem++; 83 | } 84 | } else { 85 | fNameLen = (int)strlen(fName); 86 | } 87 | 88 | bool exists = false; 89 | DirTreeNode *q = firstLevel; 90 | for (DirTreeNode *p = firstLevel; p != NULL; q = p, p = p->getNext()) { 91 | if (strncmp(p->getName(), fName, fNameLen) == 0 && strlen(p->getName()) == fNameLen) { 92 | exists = p->remove(rem); 93 | if (exists == false) return true; // do not remove this 94 | exists = true; 95 | // we are going to remove p 96 | if (p == firstLevel) { 97 | firstLevel = p->getNext(); 98 | } else { 99 | q->setNext(p->getNext()); 100 | } 101 | delete p; 102 | break; 103 | } 104 | } 105 | if (exists == false) return false; 106 | return true; 107 | } 108 | 109 | void DirTree::writeOut(FILE* fout, char* curPath) { 110 | // first non directories 111 | for (DirTreeNode *p = firstLevel; p != NULL; p = p->getNext()) { 112 | if (p->do_not_list_as_dir || p->getName()[strlen(p->getName()) - 1] != '\\') { 113 | if (p->getName()[strlen(p->getName()) - 1] == '\\') p->getName()[strlen(p->getName()) - 1] = '\0'; 114 | p->writeOut(fout, curPath); 115 | } 116 | } 117 | // now directories 118 | for (DirTreeNode *p = firstLevel; p != NULL; p = p->getNext()) { 119 | if (!p->do_not_list_as_dir && p->getName()[strlen(p->getName()) - 1] == '\\') 120 | p->writeOut(fout, curPath); 121 | } 122 | } 123 | 124 | void DirTree::finalize() { 125 | for (DirTreeNode *p = firstLevel; p != NULL; p = p->getNext()) { 126 | p->finalize(); 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | DiskDir Extended 1.68 (2013-09-18) - plugin for Total Commander 2 | ================ 3 | 4 | The same as DiskDir - creates a list file with all selected files and directories, 5 | including subdirs - but also lists contents of archive files 6 | internally: 7 | ARJ, ACE, CAB, JAR, RAR, ZIP, TAR, TGZ (TAR.GZ), TBZ (TBZ2, TAR.BZ, TAR.BZ2) and 8 | ISO (NRG, IMG, BIN). 9 | Also lists all the other archive files recognised by installed TC plugins. 10 | You can choose which archive types to list and whether to try to determine unknown 11 | archive type using installed TC plugins. 12 | Format is fully compatible with DiskDir, i.e. this plugin can display DiskDir 13 | files, as well as DiskDir can display this plugin's files. 14 | 15 | It creates plain text list files which can be opened in Word, Excel or other 16 | office tools which can format TAB-delimited files, and then be formatted for 17 | printing. It can also be used as a catalog tool: You can scan your CDs with it, 18 | each to a file, and then search in these catalogs using the Search command with 19 | the option "Search in archives". 20 | 21 | Installation (TotalCommander 6.5 and later): 22 | 23 | 1. View contents of wcx_DiskDirExtended_1.68.zip within TotalCommander 24 | 2. Follow instructions 25 | 26 | Installation (TotalCommander prior to 6.5): 27 | 28 | 1. Unzip the DiskDirExtended.wcx to any directory 29 | 2. In Total Commander, choose Configuration - Options 30 | 3. Open the 'Packer' page 31 | 4. Click 'Configure packer extension WCXs' 32 | 5. Type any extension, e.g. "lst" 33 | 6. Click 'New type', and select the DiskDirExtended.wcx 34 | 7. Click OK 35 | 36 | How to use: 37 | 38 | 1. Select folders and files that you want to list 39 | 2. Select destination directory in opposite panel 40 | 3. Press Pack (Alt+F5). Select your chosen extension (e.g. "lst"). 41 | 4. You can 'Configure' this packer. You can choose which archive types contents 42 | to list, or to be asked whether to list particular archive during "packing". 43 | This configuration is stored in DiskDirExtended.ini in the same directory as 44 | DiskDirExtended.wcx. See DiskDirExtended.ini for more configuration options. 45 | 5. Press OK. 46 | 47 | This is free software and is provided "as-is" - no warranty whatsoever. 48 | 49 | Peter Trebaticky 50 | Bratislava (Slovakia) 51 | mailto: peter.trebaticky@gmail.com 52 | 53 | Changelog: 54 | **1.68** 55 | updated ISO library 56 | 57 | **1.67** 58 | 59 | * fix for TotalCommander 7.55 - in combination with some plugins could cause 60 | instability 61 | * updated used unpack libraries 62 | 63 | **1.65** 64 | 65 | * added possibility to not list any archive 66 | * added possibility to choose (in DiskDirExtended.ini) on which extensions 67 | to try CanYouHandleThisFile for other installed plugins 68 | 69 | **1.60** 70 | 71 | * added possibility to list only directories 72 | * fixed case sensitivity of file extensions 73 | * fixed creation of directory by F7 74 | * fixed off by one error in reported file size for files > 4GB 75 | 76 | **1.55** 77 | 78 | * added possibility to list not all information (size, date, time) 79 | * added possibility to add leading zeros for date/time 80 | * fixed listing file names containing international characters obtained from 81 | plugins 82 | * fixed option ListEmptyArchives from ini file (yes meant no and vice versa ;)) 83 | * fixed listing file sizes of iso files 84 | 85 | **1.52** 86 | fixed crash with longer lines in ini file (wincmd.ini or DiskDirExtended.ini) 87 | 88 | **1.51** 89 | 90 | * update for new TC7 and above API for packer plugins, huge files (> 4GB) are 91 | also displayed correctly (only in TC7 and above) 92 | * fixed bug from version 1.5 eventually causing infinite loop 93 | 94 | **1.5** 95 | 96 | * added support for iso (nrg, bin, img) 97 | * added support for all other extensions recognised by TC plugins 98 | * it is possible to define (in DiskDirExtended.ini) which extensions belong to 99 | the same type of archive - e.g. zip=ear,war,ip 100 | * it is possible to choose (in DiskDirExtended.ini) whether to list archives 101 | that appear to be empty (resulting in empty directories) - default is no 102 | * fixed packing files from "Search result" panel 103 | 104 | **1.4** 105 | 106 | * added possibility to modify the list file 107 | * better handling of 'Cancel' button 108 | * huge files (> 4GB) are internally handled correctly, but the user sees their 109 | sizes incorrectly due to limitations of TotalCmd API for packer plugins 110 | 111 | **1.32** 112 | the time of the directories is stored correctly 113 | 114 | **1.31** 115 | fixed displaying file names containing international characters 116 | 117 | **1.3** 118 | Pressing F3 (view) or F5 (copy) on a file inside list file now works if the 119 | original source is available - e.g. if you made list of CD and that CD is in 120 | drive. Only works with files that are not inside some archive (no actual 121 | unpacking). 122 | 123 | **1.2** 124 | added support for 125 | 126 | * tar 127 | * tgz (tar.gz) 128 | * tbz (tbz2, tar.bz, tar.bz2) 129 | 130 | **1.1** 131 | added configuration dialog 132 | 133 | **1.0** 134 | supports 135 | ace, arj, cab, jar, rar, zip 136 | -------------------------------------------------------------------------------- /libs/bzip2/crctable.c: -------------------------------------------------------------------------------- 1 | 2 | /*-------------------------------------------------------------*/ 3 | /*--- Table for doing CRCs ---*/ 4 | /*--- crctable.c ---*/ 5 | /*-------------------------------------------------------------*/ 6 | 7 | /* ------------------------------------------------------------------ 8 | This file is part of bzip2/libbzip2, a program and library for 9 | lossless, block-sorting data compression. 10 | 11 | bzip2/libbzip2 version 1.0.5 of 10 December 2007 12 | Copyright (C) 1996-2007 Julian Seward 13 | 14 | Please read the WARNING, DISCLAIMER and PATENTS sections in the 15 | README file. 16 | 17 | This program is released under the terms of the license contained 18 | in the file LICENSE. 19 | ------------------------------------------------------------------ */ 20 | 21 | 22 | #include "bzlib_private.h" 23 | 24 | /*-- 25 | I think this is an implementation of the AUTODIN-II, 26 | Ethernet & FDDI 32-bit CRC standard. Vaguely derived 27 | from code by Rob Warnock, in Section 51 of the 28 | comp.compression FAQ. 29 | --*/ 30 | 31 | UInt32 BZ2_crc32Table[256] = { 32 | 33 | /*-- Ugly, innit? --*/ 34 | 35 | 0x00000000L, 0x04c11db7L, 0x09823b6eL, 0x0d4326d9L, 36 | 0x130476dcL, 0x17c56b6bL, 0x1a864db2L, 0x1e475005L, 37 | 0x2608edb8L, 0x22c9f00fL, 0x2f8ad6d6L, 0x2b4bcb61L, 38 | 0x350c9b64L, 0x31cd86d3L, 0x3c8ea00aL, 0x384fbdbdL, 39 | 0x4c11db70L, 0x48d0c6c7L, 0x4593e01eL, 0x4152fda9L, 40 | 0x5f15adacL, 0x5bd4b01bL, 0x569796c2L, 0x52568b75L, 41 | 0x6a1936c8L, 0x6ed82b7fL, 0x639b0da6L, 0x675a1011L, 42 | 0x791d4014L, 0x7ddc5da3L, 0x709f7b7aL, 0x745e66cdL, 43 | 0x9823b6e0L, 0x9ce2ab57L, 0x91a18d8eL, 0x95609039L, 44 | 0x8b27c03cL, 0x8fe6dd8bL, 0x82a5fb52L, 0x8664e6e5L, 45 | 0xbe2b5b58L, 0xbaea46efL, 0xb7a96036L, 0xb3687d81L, 46 | 0xad2f2d84L, 0xa9ee3033L, 0xa4ad16eaL, 0xa06c0b5dL, 47 | 0xd4326d90L, 0xd0f37027L, 0xddb056feL, 0xd9714b49L, 48 | 0xc7361b4cL, 0xc3f706fbL, 0xceb42022L, 0xca753d95L, 49 | 0xf23a8028L, 0xf6fb9d9fL, 0xfbb8bb46L, 0xff79a6f1L, 50 | 0xe13ef6f4L, 0xe5ffeb43L, 0xe8bccd9aL, 0xec7dd02dL, 51 | 0x34867077L, 0x30476dc0L, 0x3d044b19L, 0x39c556aeL, 52 | 0x278206abL, 0x23431b1cL, 0x2e003dc5L, 0x2ac12072L, 53 | 0x128e9dcfL, 0x164f8078L, 0x1b0ca6a1L, 0x1fcdbb16L, 54 | 0x018aeb13L, 0x054bf6a4L, 0x0808d07dL, 0x0cc9cdcaL, 55 | 0x7897ab07L, 0x7c56b6b0L, 0x71159069L, 0x75d48ddeL, 56 | 0x6b93dddbL, 0x6f52c06cL, 0x6211e6b5L, 0x66d0fb02L, 57 | 0x5e9f46bfL, 0x5a5e5b08L, 0x571d7dd1L, 0x53dc6066L, 58 | 0x4d9b3063L, 0x495a2dd4L, 0x44190b0dL, 0x40d816baL, 59 | 0xaca5c697L, 0xa864db20L, 0xa527fdf9L, 0xa1e6e04eL, 60 | 0xbfa1b04bL, 0xbb60adfcL, 0xb6238b25L, 0xb2e29692L, 61 | 0x8aad2b2fL, 0x8e6c3698L, 0x832f1041L, 0x87ee0df6L, 62 | 0x99a95df3L, 0x9d684044L, 0x902b669dL, 0x94ea7b2aL, 63 | 0xe0b41de7L, 0xe4750050L, 0xe9362689L, 0xedf73b3eL, 64 | 0xf3b06b3bL, 0xf771768cL, 0xfa325055L, 0xfef34de2L, 65 | 0xc6bcf05fL, 0xc27dede8L, 0xcf3ecb31L, 0xcbffd686L, 66 | 0xd5b88683L, 0xd1799b34L, 0xdc3abdedL, 0xd8fba05aL, 67 | 0x690ce0eeL, 0x6dcdfd59L, 0x608edb80L, 0x644fc637L, 68 | 0x7a089632L, 0x7ec98b85L, 0x738aad5cL, 0x774bb0ebL, 69 | 0x4f040d56L, 0x4bc510e1L, 0x46863638L, 0x42472b8fL, 70 | 0x5c007b8aL, 0x58c1663dL, 0x558240e4L, 0x51435d53L, 71 | 0x251d3b9eL, 0x21dc2629L, 0x2c9f00f0L, 0x285e1d47L, 72 | 0x36194d42L, 0x32d850f5L, 0x3f9b762cL, 0x3b5a6b9bL, 73 | 0x0315d626L, 0x07d4cb91L, 0x0a97ed48L, 0x0e56f0ffL, 74 | 0x1011a0faL, 0x14d0bd4dL, 0x19939b94L, 0x1d528623L, 75 | 0xf12f560eL, 0xf5ee4bb9L, 0xf8ad6d60L, 0xfc6c70d7L, 76 | 0xe22b20d2L, 0xe6ea3d65L, 0xeba91bbcL, 0xef68060bL, 77 | 0xd727bbb6L, 0xd3e6a601L, 0xdea580d8L, 0xda649d6fL, 78 | 0xc423cd6aL, 0xc0e2d0ddL, 0xcda1f604L, 0xc960ebb3L, 79 | 0xbd3e8d7eL, 0xb9ff90c9L, 0xb4bcb610L, 0xb07daba7L, 80 | 0xae3afba2L, 0xaafbe615L, 0xa7b8c0ccL, 0xa379dd7bL, 81 | 0x9b3660c6L, 0x9ff77d71L, 0x92b45ba8L, 0x9675461fL, 82 | 0x8832161aL, 0x8cf30badL, 0x81b02d74L, 0x857130c3L, 83 | 0x5d8a9099L, 0x594b8d2eL, 0x5408abf7L, 0x50c9b640L, 84 | 0x4e8ee645L, 0x4a4ffbf2L, 0x470cdd2bL, 0x43cdc09cL, 85 | 0x7b827d21L, 0x7f436096L, 0x7200464fL, 0x76c15bf8L, 86 | 0x68860bfdL, 0x6c47164aL, 0x61043093L, 0x65c52d24L, 87 | 0x119b4be9L, 0x155a565eL, 0x18197087L, 0x1cd86d30L, 88 | 0x029f3d35L, 0x065e2082L, 0x0b1d065bL, 0x0fdc1becL, 89 | 0x3793a651L, 0x3352bbe6L, 0x3e119d3fL, 0x3ad08088L, 90 | 0x2497d08dL, 0x2056cd3aL, 0x2d15ebe3L, 0x29d4f654L, 91 | 0xc5a92679L, 0xc1683bceL, 0xcc2b1d17L, 0xc8ea00a0L, 92 | 0xd6ad50a5L, 0xd26c4d12L, 0xdf2f6bcbL, 0xdbee767cL, 93 | 0xe3a1cbc1L, 0xe760d676L, 0xea23f0afL, 0xeee2ed18L, 94 | 0xf0a5bd1dL, 0xf464a0aaL, 0xf9278673L, 0xfde69bc4L, 95 | 0x89b8fd09L, 0x8d79e0beL, 0x803ac667L, 0x84fbdbd0L, 96 | 0x9abc8bd5L, 0x9e7d9662L, 0x933eb0bbL, 0x97ffad0cL, 97 | 0xafb010b1L, 0xab710d06L, 0xa6322bdfL, 0xa2f33668L, 98 | 0xbcb4666dL, 0xb8757bdaL, 0xb5365d03L, 0xb1f740b4L 99 | }; 100 | 101 | 102 | /*-------------------------------------------------------------*/ 103 | /*--- end crctable.c ---*/ 104 | /*-------------------------------------------------------------*/ 105 | -------------------------------------------------------------------------------- /libs/zlib/gzguts.h: -------------------------------------------------------------------------------- 1 | /* gzguts.h -- zlib internal header definitions for gz* operations 2 | * Copyright (C) 2004, 2005, 2010 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | #ifdef _LARGEFILE64_SOURCE 7 | # ifndef _LARGEFILE_SOURCE 8 | # define _LARGEFILE_SOURCE 1 9 | # endif 10 | # ifdef _FILE_OFFSET_BITS 11 | # undef _FILE_OFFSET_BITS 12 | # endif 13 | #endif 14 | 15 | #if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ) 16 | # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) 17 | #else 18 | # define ZLIB_INTERNAL 19 | #endif 20 | 21 | #include 22 | #include "zlib.h" 23 | #ifdef STDC 24 | # include 25 | # include 26 | # include 27 | #endif 28 | #include 29 | 30 | #ifdef NO_DEFLATE /* for compatibility with old definition */ 31 | # define NO_GZCOMPRESS 32 | #endif 33 | 34 | #ifdef _MSC_VER 35 | # include 36 | # define vsnprintf _vsnprintf 37 | #endif 38 | 39 | #ifndef local 40 | # define local static 41 | #endif 42 | /* compile with -Dlocal if your debugger can't find static symbols */ 43 | 44 | /* gz* functions always use library allocation functions */ 45 | #ifndef STDC 46 | extern voidp malloc OF((uInt size)); 47 | extern void free OF((voidpf ptr)); 48 | #endif 49 | 50 | /* get errno and strerror definition */ 51 | #if defined UNDER_CE 52 | # include 53 | # define zstrerror() gz_strwinerror((DWORD)GetLastError()) 54 | #else 55 | # ifdef STDC 56 | # include 57 | # define zstrerror() strerror(errno) 58 | # else 59 | # define zstrerror() "stdio error (consult errno)" 60 | # endif 61 | #endif 62 | 63 | /* provide prototypes for these when building zlib without LFS */ 64 | #if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 65 | ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); 66 | ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); 67 | ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); 68 | ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); 69 | #endif 70 | 71 | /* default i/o buffer size -- double this for output when reading */ 72 | #define GZBUFSIZE 8192 73 | 74 | /* gzip modes, also provide a little integrity check on the passed structure */ 75 | #define GZ_NONE 0 76 | #define GZ_READ 7247 77 | #define GZ_WRITE 31153 78 | #define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */ 79 | 80 | /* values for gz_state how */ 81 | #define LOOK 0 /* look for a gzip header */ 82 | #define COPY 1 /* copy input directly */ 83 | #define GZIP 2 /* decompress a gzip stream */ 84 | 85 | /* internal gzip file state data structure */ 86 | typedef struct { 87 | /* used for both reading and writing */ 88 | int mode; /* see gzip modes above */ 89 | int fd; /* file descriptor */ 90 | char *path; /* path or fd for error messages */ 91 | z_off64_t pos; /* current position in uncompressed data */ 92 | unsigned size; /* buffer size, zero if not allocated yet */ 93 | unsigned want; /* requested buffer size, default is GZBUFSIZE */ 94 | unsigned char *in; /* input buffer */ 95 | unsigned char *out; /* output buffer (double-sized when reading) */ 96 | unsigned char *next; /* next output data to deliver or write */ 97 | /* just for reading */ 98 | unsigned have; /* amount of output data unused at next */ 99 | int eof; /* true if end of input file reached */ 100 | z_off64_t start; /* where the gzip data started, for rewinding */ 101 | z_off64_t raw; /* where the raw data started, for seeking */ 102 | int how; /* 0: get header, 1: copy, 2: decompress */ 103 | int direct; /* true if last read direct, false if gzip */ 104 | /* just for writing */ 105 | int level; /* compression level */ 106 | int strategy; /* compression strategy */ 107 | /* seek request */ 108 | z_off64_t skip; /* amount to skip (already rewound if backwards) */ 109 | int seek; /* true if seek request pending */ 110 | /* error information */ 111 | int err; /* error code */ 112 | char *msg; /* error message */ 113 | /* zlib inflate or deflate stream */ 114 | z_stream strm; /* stream structure in-place (not a pointer) */ 115 | } gz_state; 116 | typedef gz_state FAR *gz_statep; 117 | 118 | /* shared functions */ 119 | void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *)); 120 | #if defined UNDER_CE 121 | char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error)); 122 | #endif 123 | 124 | /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t 125 | value -- needed when comparing unsigned to z_off64_t, which is signed 126 | (possible z_off64_t types off_t, off64_t, and long are all signed) */ 127 | #ifdef INT_MAX 128 | # define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX) 129 | #else 130 | unsigned ZLIB_INTERNAL gz_intmax OF((void)); 131 | # define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) 132 | #endif 133 | -------------------------------------------------------------------------------- /libs/inifile/Readme.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | CIniFile 11 | C++ Class Library  12 |
13 |

14 | Description

15 | The CIniFile class library is a simple C++ class 16 | to read and write ini files like 17 |
the microsoft ini files. The CIniFile package 18 | contains both, the C++ and the 19 |
C version. 20 | 21 |

CIniFile translates the hole ini file in a structure, 22 | so it works best when a set 23 |
of entrys (more then one) have to be read or 24 | write. 25 | 26 |

CIniFile is writen by Carsten Breuer (C.Breuer@openwin.de). 27 |

28 | License

29 | LGPL (Free for private and comercial use). 30 | 31 |

This program is free software; you can redistribute it and/or modify 32 | it under 33 |
the terms of the GNU Lesser General Public License as published by 34 | the 35 |
Free Software Foundation; either version 2 of the License, or (at your 36 | option) 37 |
any later version. 38 | 39 |

This program is distributed in the hope that it will be useful, but 40 | WITHOUT 41 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 42 |
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General 43 |
Public License for more details. 44 | 45 |

You should have received a copy of the GNU Lesser General Public License 46 |
along with this program; if not, write to the Free Software Foundation, 47 | Inc., 48 |
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 49 |

50 | Methods

51 | CIniFile 52 | (void); 53 | 54 |

~CIniFile 55 | (void); 56 | 57 |

UINT 58 | GetVersion (void); 59 | 60 |

BOOL 61 | OpenIniFile (CCHR *pFileName); 62 | 63 |

BOOL 64 | ReadBool (CCHR *pSection, CCHR *pKey, BOOL Default); 65 | 66 |

int 67 | ReadInt (CCHR *pSection, CCHR *pKey, int Default); 68 | 69 |

double 70 | ReadDouble (CCHR *pSection, CCHR *pKey, double Default); 71 | 72 |

CCHR 73 | *ReadString (CCHR *pSection, CCHR *pKey, CCHR *pDefault); 74 | 75 |

void 76 | WriteBool (CCHR *pSection, CCHR *pKey, bool Value); 77 | 78 |

void 79 | WriteInt (CCHR *pSection, CCHR *pKey, int Value); 80 | 81 |

void 82 | WriteDouble (CCHR *pSection, CCHR *pKey, double Value); 83 | 84 |

void 85 | WriteString (CCHR *pSection, CCHR *pKey, CCHR *pValue); 86 | 87 |

bool 88 | DeleteKey (CCHR *pSection, CCHR *pKey); 89 | 90 |

void 91 | CloseIniFile (); 92 | 93 |

bool 94 | WriteIniFile (CCHR *pFileName); 95 | 96 |

97 |


98 |
To have our freedom:  99 |
THIS SITE contains only material for EDUCATIONAL PURPOSE. 100 | We dissociate ourself from any 101 |
link we have set here. Every TRADEMARK ARE TRADEMARKS 102 | OF THE RESPECTIVE OWNER! 103 |
This SITE IS BUILD WITH THE PURPOSE TO HELP PEOPLE. 104 | 105 | 106 | -------------------------------------------------------------------------------- /libs/zlib/contrib/minizip/crypt.h: -------------------------------------------------------------------------------- 1 | /* crypt.h -- base code for crypt/uncrypt ZIPfile 2 | 3 | 4 | Version 1.01e, February 12th, 2005 5 | 6 | Copyright (C) 1998-2005 Gilles Vollant 7 | 8 | This code is a modified version of crypting code in Infozip distribution 9 | 10 | The encryption/decryption parts of this source code (as opposed to the 11 | non-echoing password parts) were originally written in Europe. The 12 | whole source package can be freely distributed, including from the USA. 13 | (Prior to January 2000, re-export from the US was a violation of US law.) 14 | 15 | This encryption code is a direct transcription of the algorithm from 16 | Roger Schlafly, described by Phil Katz in the file appnote.txt. This 17 | file (appnote.txt) is distributed with the PKZIP program (even in the 18 | version without encryption capabilities). 19 | 20 | If you don't need crypting in your application, just define symbols 21 | NOCRYPT and NOUNCRYPT. 22 | 23 | This code support the "Traditional PKWARE Encryption". 24 | 25 | The new AES encryption added on Zip format by Winzip (see the page 26 | http://www.winzip.com/aes_info.htm ) and PKWare PKZip 5.x Strong 27 | Encryption is not supported. 28 | */ 29 | 30 | #define CRC32(c, b) ((*(pcrc_32_tab+(((int)(c) ^ (b)) & 0xff))) ^ ((c) >> 8)) 31 | 32 | /*********************************************************************** 33 | * Return the next byte in the pseudo-random sequence 34 | */ 35 | static int decrypt_byte(unsigned long* pkeys, const unsigned long* pcrc_32_tab) 36 | { 37 | unsigned temp; /* POTENTIAL BUG: temp*(temp^1) may overflow in an 38 | * unpredictable manner on 16-bit systems; not a problem 39 | * with any known compiler so far, though */ 40 | 41 | temp = ((unsigned)(*(pkeys+2)) & 0xffff) | 2; 42 | return (int)(((temp * (temp ^ 1)) >> 8) & 0xff); 43 | } 44 | 45 | /*********************************************************************** 46 | * Update the encryption keys with the next byte of plain text 47 | */ 48 | static int update_keys(unsigned long* pkeys,const unsigned long* pcrc_32_tab,int c) 49 | { 50 | (*(pkeys+0)) = CRC32((*(pkeys+0)), c); 51 | (*(pkeys+1)) += (*(pkeys+0)) & 0xff; 52 | (*(pkeys+1)) = (*(pkeys+1)) * 134775813L + 1; 53 | { 54 | register int keyshift = (int)((*(pkeys+1)) >> 24); 55 | (*(pkeys+2)) = CRC32((*(pkeys+2)), keyshift); 56 | } 57 | return c; 58 | } 59 | 60 | 61 | /*********************************************************************** 62 | * Initialize the encryption keys and the random header according to 63 | * the given password. 64 | */ 65 | static void init_keys(const char* passwd,unsigned long* pkeys,const unsigned long* pcrc_32_tab) 66 | { 67 | *(pkeys+0) = 305419896L; 68 | *(pkeys+1) = 591751049L; 69 | *(pkeys+2) = 878082192L; 70 | while (*passwd != '\0') { 71 | update_keys(pkeys,pcrc_32_tab,(int)*passwd); 72 | passwd++; 73 | } 74 | } 75 | 76 | #define zdecode(pkeys,pcrc_32_tab,c) \ 77 | (update_keys(pkeys,pcrc_32_tab,c ^= decrypt_byte(pkeys,pcrc_32_tab))) 78 | 79 | #define zencode(pkeys,pcrc_32_tab,c,t) \ 80 | (t=decrypt_byte(pkeys,pcrc_32_tab), update_keys(pkeys,pcrc_32_tab,c), t^(c)) 81 | 82 | #ifdef INCLUDECRYPTINGCODE_IFCRYPTALLOWED 83 | 84 | #define RAND_HEAD_LEN 12 85 | /* "last resort" source for second part of crypt seed pattern */ 86 | # ifndef ZCR_SEED2 87 | # define ZCR_SEED2 3141592654UL /* use PI as default pattern */ 88 | # endif 89 | 90 | static int crypthead(const char* passwd, /* password string */ 91 | unsigned char* buf, /* where to write header */ 92 | int bufSize, 93 | unsigned long* pkeys, 94 | const unsigned long* pcrc_32_tab, 95 | unsigned long crcForCrypting) 96 | { 97 | int n; /* index in random header */ 98 | int t; /* temporary */ 99 | int c; /* random byte */ 100 | unsigned char header[RAND_HEAD_LEN-2]; /* random header */ 101 | static unsigned calls = 0; /* ensure different random header each time */ 102 | 103 | if (bufSize> 7) & 0xff; 118 | header[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, c, t); 119 | } 120 | /* Encrypt random header (last two bytes is high word of crc) */ 121 | init_keys(passwd, pkeys, pcrc_32_tab); 122 | for (n = 0; n < RAND_HEAD_LEN-2; n++) 123 | { 124 | buf[n] = (unsigned char)zencode(pkeys, pcrc_32_tab, header[n], t); 125 | } 126 | buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 16) & 0xff, t); 127 | buf[n++] = (unsigned char)zencode(pkeys, pcrc_32_tab, (int)(crcForCrypting >> 24) & 0xff, t); 128 | return n; 129 | } 130 | 131 | #endif 132 | -------------------------------------------------------------------------------- /wcxhead.h: -------------------------------------------------------------------------------- 1 | /* Contents of file wcxhead.h */ 2 | /* It contains definitions of error codes, flags and callbacks */ 3 | #ifndef WCXHEAD_H 4 | #define WCXHEAD_H 5 | 6 | #include 7 | 8 | #define MAX_FILE_NAME_LEN 260 9 | #define MAX_FILE_NAME_LEN_EX 1024 10 | #define MAX_FULL_PATH_LEN 8192 11 | 12 | /* Error codes returned to calling application */ 13 | #define E_END_ARCHIVE 10 /* No more files in archive */ 14 | #define E_NO_MEMORY 11 /* Not enough memory */ 15 | #define E_BAD_DATA 12 /* Data is bad */ 16 | #define E_BAD_ARCHIVE 13 /* CRC error in archive data */ 17 | #define E_UNKNOWN_FORMAT 14 /* Archive format unknown */ 18 | #define E_EOPEN 15 /* Cannot open existing file */ 19 | #define E_ECREATE 16 /* Cannot create file */ 20 | #define E_ECLOSE 17 /* Error closing file */ 21 | #define E_EREAD 18 /* Error reading from file */ 22 | #define E_EWRITE 19 /* Error writing to file */ 23 | #define E_SMALL_BUF 20 /* Buffer too small */ 24 | #define E_EABORTED 21 /* Function aborted by user */ 25 | #define E_NO_FILES 22 /* No files found */ 26 | #define E_TOO_MANY_FILES 23 /* Too many files to pack */ 27 | #define E_NOT_SUPPORTED 24 /* Function not supported */ 28 | 29 | /* flags for unpacking */ 30 | #define PK_OM_LIST 0 31 | #define PK_OM_EXTRACT 1 32 | 33 | /* flags for ProcessFile */ 34 | #define PK_SKIP 0 /* Skip this file */ 35 | #define PK_TEST 1 /* Test file integrity */ 36 | #define PK_EXTRACT 2 /* Extract to disk */ 37 | 38 | /* Flags passed through ChangeVolProc */ 39 | #define PK_VOL_ASK 0 /* Ask user for location of next volume */ 40 | #define PK_VOL_NOTIFY 1 /* Notify app that next volume will be unpacked */ 41 | 42 | /* Flags for packing */ 43 | 44 | /* For PackFiles */ 45 | #define PK_PACK_MOVE_FILES 1 /* Delete original after packing */ 46 | #define PK_PACK_SAVE_PATHS 2 /* Save path names of files */ 47 | #define PK_PACK_ENCRYPT 4 /* Ask user for password, then encrypt */ 48 | 49 | /* Returned by GetPackCaps */ 50 | #define PK_CAPS_NEW 1 /* Can create new archives */ 51 | #define PK_CAPS_MODIFY 2 /* Can modify exisiting archives */ 52 | #define PK_CAPS_MULTIPLE 4 /* Archive can contain multiple files */ 53 | #define PK_CAPS_DELETE 8 /* Can delete files */ 54 | #define PK_CAPS_OPTIONS 16 /* Has options dialog */ 55 | #define PK_CAPS_MEMPACK 32 /* Supports packing in memory */ 56 | #define PK_CAPS_BY_CONTENT 64 /* Detect archive type by content */ 57 | #define PK_CAPS_SEARCHTEXT 128 /* Allow searching for text in archives */ 58 | /* created with this plugin} */ 59 | #define PK_CAPS_HIDE 256 /* Show as normal files (hide packer */ 60 | /* icon), open with Ctrl+PgDn, not Enter*/ 61 | #define PK_CAPS_ENCRYPT 512 /* Plugin supports PK_PACK_ENCRYPT option*/ 62 | 63 | /* Flags for packing in memory */ 64 | #define MEM_OPTIONS_WANTHEADERS 1 /* Return archive headers with packed data */ 65 | 66 | /* Errors returned by PackToMem */ 67 | #define MEMPACK_OK 0 /* Function call finished OK, but there is more data */ 68 | #define MEMPACK_DONE 1 /* Function call finished OK, there is no more data */ 69 | 70 | typedef struct { 71 | char ArcName[MAX_FILE_NAME_LEN]; 72 | char FileName[MAX_FILE_NAME_LEN]; 73 | int Flags; 74 | int PackSize; 75 | int UnpSize; 76 | int HostOS; 77 | int FileCRC; 78 | int FileTime; 79 | int UnpVer; 80 | int Method; 81 | int FileAttr; 82 | char* CmtBuf; 83 | int CmtBufSize; 84 | int CmtSize; 85 | int CmtState; 86 | } tHeaderData; 87 | 88 | typedef struct { 89 | char ArcName[MAX_FILE_NAME_LEN_EX]; 90 | char FileName[MAX_FILE_NAME_LEN_EX]; 91 | int Flags; 92 | int PackSize; 93 | int PackSizeHigh; 94 | int UnpSize; 95 | int UnpSizeHigh; 96 | int HostOS; 97 | int FileCRC; 98 | int FileTime; 99 | int UnpVer; 100 | int Method; 101 | int FileAttr; 102 | char* CmtBuf; 103 | int CmtBufSize; 104 | int CmtSize; 105 | int CmtState; 106 | char Reserved[1024]; 107 | } tHeaderDataEx; 108 | 109 | typedef struct { 110 | char* ArcName; 111 | int OpenMode; 112 | int OpenResult; 113 | char* CmtBuf; 114 | int CmtBufSize; 115 | int CmtSize; 116 | int CmtState; 117 | } tOpenArchiveData; 118 | 119 | typedef struct { 120 | int size; 121 | DWORD PluginInterfaceVersionLow; 122 | DWORD PluginInterfaceVersionHi; 123 | char DefaultIniName[MAX_PATH]; 124 | } PackDefaultParamStruct; 125 | 126 | /* Definition of callback functions called by the DLL 127 | Ask to swap disk for multi-volume archive */ 128 | typedef int (__stdcall *tChangeVolProc)(char *ArcName,int Mode); 129 | /* Notify that data is processed - used for progress dialog */ 130 | typedef int (__stdcall *tProcessDataProc)(char *FileName,int Size); 131 | 132 | #endif WCXHEAD_H 133 | -------------------------------------------------------------------------------- /libs/zlib/README: -------------------------------------------------------------------------------- 1 | ZLIB DATA COMPRESSION LIBRARY 2 | 3 | zlib 1.2.5 is a general purpose data compression library. All the code is 4 | thread safe. The data format used by the zlib library is described by RFCs 5 | (Request for Comments) 1950 to 1952 in the files 6 | http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format) 7 | and rfc1952.txt (gzip format). 8 | 9 | All functions of the compression library are documented in the file zlib.h 10 | (volunteer to write man pages welcome, contact zlib@gzip.org). A usage example 11 | of the library is given in the file example.c which also tests that the library 12 | is working correctly. Another example is given in the file minigzip.c. The 13 | compression library itself is composed of all source files except example.c and 14 | minigzip.c. 15 | 16 | To compile all files and run the test program, follow the instructions given at 17 | the top of Makefile.in. In short "./configure; make test", and if that goes 18 | well, "make install" should work for most flavors of Unix. For Windows, use one 19 | of the special makefiles in win32/ or contrib/vstudio/ . For VMS, use 20 | make_vms.com. 21 | 22 | Questions about zlib should be sent to , or to Gilles Vollant 23 | for the Windows DLL version. The zlib home page is 24 | http://zlib.net/ . Before reporting a problem, please check this site to 25 | verify that you have the latest version of zlib; otherwise get the latest 26 | version and check whether the problem still exists or not. 27 | 28 | PLEASE read the zlib FAQ http://zlib.net/zlib_faq.html before asking for help. 29 | 30 | Mark Nelson wrote an article about zlib for the Jan. 1997 31 | issue of Dr. Dobb's Journal; a copy of the article is available at 32 | http://marknelson.us/1997/01/01/zlib-engine/ . 33 | 34 | The changes made in version 1.2.5 are documented in the file ChangeLog. 35 | 36 | Unsupported third party contributions are provided in directory contrib/ . 37 | 38 | zlib is available in Java using the java.util.zip package, documented at 39 | http://java.sun.com/developer/technicalArticles/Programming/compression/ . 40 | 41 | A Perl interface to zlib written by Paul Marquess is available 42 | at CPAN (Comprehensive Perl Archive Network) sites, including 43 | http://search.cpan.org/~pmqs/IO-Compress-Zlib/ . 44 | 45 | A Python interface to zlib written by A.M. Kuchling is 46 | available in Python 1.5 and later versions, see 47 | http://www.python.org/doc/lib/module-zlib.html . 48 | 49 | zlib is built into tcl: http://wiki.tcl.tk/4610 . 50 | 51 | An experimental package to read and write files in .zip format, written on top 52 | of zlib by Gilles Vollant , is available in the 53 | contrib/minizip directory of zlib. 54 | 55 | 56 | Notes for some targets: 57 | 58 | - For Windows DLL versions, please see win32/DLL_FAQ.txt 59 | 60 | - For 64-bit Irix, deflate.c must be compiled without any optimization. With 61 | -O, one libpng test fails. The test works in 32 bit mode (with the -n32 62 | compiler flag). The compiler bug has been reported to SGI. 63 | 64 | - zlib doesn't work with gcc 2.6.3 on a DEC 3000/300LX under OSF/1 2.1 it works 65 | when compiled with cc. 66 | 67 | - On Digital Unix 4.0D (formely OSF/1) on AlphaServer, the cc option -std1 is 68 | necessary to get gzprintf working correctly. This is done by configure. 69 | 70 | - zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works with 71 | other compilers. Use "make test" to check your compiler. 72 | 73 | - gzdopen is not supported on RISCOS or BEOS. 74 | 75 | - For PalmOs, see http://palmzlib.sourceforge.net/ 76 | 77 | 78 | Acknowledgments: 79 | 80 | The deflate format used by zlib was defined by Phil Katz. The deflate and 81 | zlib specifications were written by L. Peter Deutsch. Thanks to all the 82 | people who reported problems and suggested various improvements in zlib; they 83 | are too numerous to cite here. 84 | 85 | Copyright notice: 86 | 87 | (C) 1995-2010 Jean-loup Gailly and Mark Adler 88 | 89 | This software is provided 'as-is', without any express or implied 90 | warranty. In no event will the authors be held liable for any damages 91 | arising from the use of this software. 92 | 93 | Permission is granted to anyone to use this software for any purpose, 94 | including commercial applications, and to alter it and redistribute it 95 | freely, subject to the following restrictions: 96 | 97 | 1. The origin of this software must not be misrepresented; you must not 98 | claim that you wrote the original software. If you use this software 99 | in a product, an acknowledgment in the product documentation would be 100 | appreciated but is not required. 101 | 2. Altered source versions must be plainly marked as such, and must not be 102 | misrepresented as being the original software. 103 | 3. This notice may not be removed or altered from any source distribution. 104 | 105 | Jean-loup Gailly Mark Adler 106 | jloup@gzip.org madler@alumni.caltech.edu 107 | 108 | If you use the zlib library in a product, we would appreciate *not* receiving 109 | lengthy legal documents to sign. The sources are provided for free but without 110 | warranty of any kind. The library has been entirely written by Jean-loup 111 | Gailly and Mark Adler; it does not include third-party code. 112 | 113 | If you redistribute modified sources, we would appreciate that you include in 114 | the file ChangeLog history information documenting your changes. Please read 115 | the FAQ for more information on the distribution of modified source versions. 116 | -------------------------------------------------------------------------------- /libs/zlib/adler32.c: -------------------------------------------------------------------------------- 1 | /* adler32.c -- compute the Adler-32 checksum of a data stream 2 | * Copyright (C) 1995-2007 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #include "zutil.h" 9 | 10 | #define local static 11 | 12 | local uLong adler32_combine_(uLong adler1, uLong adler2, z_off64_t len2); 13 | 14 | #define BASE 65521UL /* largest prime smaller than 65536 */ 15 | #define NMAX 5552 16 | /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ 17 | 18 | #define DO1(buf,i) {adler += (buf)[i]; sum2 += adler;} 19 | #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); 20 | #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); 21 | #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); 22 | #define DO16(buf) DO8(buf,0); DO8(buf,8); 23 | 24 | /* use NO_DIVIDE if your processor does not do division in hardware */ 25 | #ifdef NO_DIVIDE 26 | # define MOD(a) \ 27 | do { \ 28 | if (a >= (BASE << 16)) a -= (BASE << 16); \ 29 | if (a >= (BASE << 15)) a -= (BASE << 15); \ 30 | if (a >= (BASE << 14)) a -= (BASE << 14); \ 31 | if (a >= (BASE << 13)) a -= (BASE << 13); \ 32 | if (a >= (BASE << 12)) a -= (BASE << 12); \ 33 | if (a >= (BASE << 11)) a -= (BASE << 11); \ 34 | if (a >= (BASE << 10)) a -= (BASE << 10); \ 35 | if (a >= (BASE << 9)) a -= (BASE << 9); \ 36 | if (a >= (BASE << 8)) a -= (BASE << 8); \ 37 | if (a >= (BASE << 7)) a -= (BASE << 7); \ 38 | if (a >= (BASE << 6)) a -= (BASE << 6); \ 39 | if (a >= (BASE << 5)) a -= (BASE << 5); \ 40 | if (a >= (BASE << 4)) a -= (BASE << 4); \ 41 | if (a >= (BASE << 3)) a -= (BASE << 3); \ 42 | if (a >= (BASE << 2)) a -= (BASE << 2); \ 43 | if (a >= (BASE << 1)) a -= (BASE << 1); \ 44 | if (a >= BASE) a -= BASE; \ 45 | } while (0) 46 | # define MOD4(a) \ 47 | do { \ 48 | if (a >= (BASE << 4)) a -= (BASE << 4); \ 49 | if (a >= (BASE << 3)) a -= (BASE << 3); \ 50 | if (a >= (BASE << 2)) a -= (BASE << 2); \ 51 | if (a >= (BASE << 1)) a -= (BASE << 1); \ 52 | if (a >= BASE) a -= BASE; \ 53 | } while (0) 54 | #else 55 | # define MOD(a) a %= BASE 56 | # define MOD4(a) a %= BASE 57 | #endif 58 | 59 | /* ========================================================================= */ 60 | uLong ZEXPORT adler32(adler, buf, len) 61 | uLong adler; 62 | const Bytef *buf; 63 | uInt len; 64 | { 65 | unsigned long sum2; 66 | unsigned n; 67 | 68 | /* split Adler-32 into component sums */ 69 | sum2 = (adler >> 16) & 0xffff; 70 | adler &= 0xffff; 71 | 72 | /* in case user likes doing a byte at a time, keep it fast */ 73 | if (len == 1) { 74 | adler += buf[0]; 75 | if (adler >= BASE) 76 | adler -= BASE; 77 | sum2 += adler; 78 | if (sum2 >= BASE) 79 | sum2 -= BASE; 80 | return adler | (sum2 << 16); 81 | } 82 | 83 | /* initial Adler-32 value (deferred check for len == 1 speed) */ 84 | if (buf == Z_NULL) 85 | return 1L; 86 | 87 | /* in case short lengths are provided, keep it somewhat fast */ 88 | if (len < 16) { 89 | while (len--) { 90 | adler += *buf++; 91 | sum2 += adler; 92 | } 93 | if (adler >= BASE) 94 | adler -= BASE; 95 | MOD4(sum2); /* only added so many BASE's */ 96 | return adler | (sum2 << 16); 97 | } 98 | 99 | /* do length NMAX blocks -- requires just one modulo operation */ 100 | while (len >= NMAX) { 101 | len -= NMAX; 102 | n = NMAX / 16; /* NMAX is divisible by 16 */ 103 | do { 104 | DO16(buf); /* 16 sums unrolled */ 105 | buf += 16; 106 | } while (--n); 107 | MOD(adler); 108 | MOD(sum2); 109 | } 110 | 111 | /* do remaining bytes (less than NMAX, still just one modulo) */ 112 | if (len) { /* avoid modulos if none remaining */ 113 | while (len >= 16) { 114 | len -= 16; 115 | DO16(buf); 116 | buf += 16; 117 | } 118 | while (len--) { 119 | adler += *buf++; 120 | sum2 += adler; 121 | } 122 | MOD(adler); 123 | MOD(sum2); 124 | } 125 | 126 | /* return recombined sums */ 127 | return adler | (sum2 << 16); 128 | } 129 | 130 | /* ========================================================================= */ 131 | local uLong adler32_combine_(adler1, adler2, len2) 132 | uLong adler1; 133 | uLong adler2; 134 | z_off64_t len2; 135 | { 136 | unsigned long sum1; 137 | unsigned long sum2; 138 | unsigned rem; 139 | 140 | /* the derivation of this formula is left as an exercise for the reader */ 141 | rem = (unsigned)(len2 % BASE); 142 | sum1 = adler1 & 0xffff; 143 | sum2 = rem * sum1; 144 | MOD(sum2); 145 | sum1 += (adler2 & 0xffff) + BASE - 1; 146 | sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem; 147 | if (sum1 >= BASE) sum1 -= BASE; 148 | if (sum1 >= BASE) sum1 -= BASE; 149 | if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1); 150 | if (sum2 >= BASE) sum2 -= BASE; 151 | return sum1 | (sum2 << 16); 152 | } 153 | 154 | /* ========================================================================= */ 155 | uLong ZEXPORT adler32_combine(adler1, adler2, len2) 156 | uLong adler1; 157 | uLong adler2; 158 | z_off_t len2; 159 | { 160 | return adler32_combine_(adler1, adler2, len2); 161 | } 162 | 163 | uLong ZEXPORT adler32_combine64(adler1, adler2, len2) 164 | uLong adler1; 165 | uLong adler2; 166 | z_off64_t len2; 167 | { 168 | return adler32_combine_(adler1, adler2, len2); 169 | } 170 | -------------------------------------------------------------------------------- /upx/LICENSE: -------------------------------------------------------------------------------- 1 | -----BEGIN PGP SIGNED MESSAGE----- 2 | 3 | 4 | ooooo ooo ooooooooo. ooooooo ooooo 5 | `888' `8' `888 `Y88. `8888 d8' 6 | 888 8 888 .d88' Y888..8P 7 | 888 8 888ooo88P' `8888' 8 | 888 8 888 .8PY888. 9 | `88. .8' 888 d8' `888b 10 | `YbodP' o888o o888o o88888o 11 | 12 | 13 | The Ultimate Packer for eXecutables 14 | Copyright (c) 1996-2000 Markus Oberhumer & Laszlo Molnar 15 | http://wildsau.idv.uni-linz.ac.at/mfx/upx.html 16 | http://www.nexus.hu/upx 17 | http://upx.tsx.org 18 | 19 | 20 | PLEASE CAREFULLY READ THIS LICENSE AGREEMENT, ESPECIALLY IF YOU PLAN 21 | TO MODIFY THE UPX SOURCE CODE OR USE A MODIFIED UPX VERSION. 22 | 23 | 24 | ABSTRACT 25 | ======== 26 | 27 | UPX and UCL are copyrighted software distributed under the terms 28 | of the GNU General Public License (hereinafter the "GPL"). 29 | 30 | The stub which is imbedded in each UPX compressed program is part 31 | of UPX and UCL, and contains code that is under our copyright. The 32 | terms of the GNU General Public License still apply as compressing 33 | a program is a special form of linking with our stub. 34 | 35 | As a special exception we grant the free usage of UPX for all 36 | executables, including commercial programs. 37 | See below for details and restrictions. 38 | 39 | 40 | COPYRIGHT 41 | ========= 42 | 43 | UPX and UCL are copyrighted software. All rights remain with the authors. 44 | 45 | UPX is Copyright (C) 1996-2000 Markus Franz Xaver Johannes Oberhumer 46 | UPX is Copyright (C) 1996-2000 Laszlo Molnar 47 | 48 | UCL is Copyright (C) 1996-2000 Markus Franz Xaver Johannes Oberhumer 49 | 50 | 51 | GNU GENERAL PUBLIC LICENSE 52 | ========================== 53 | 54 | UPX and the UCL library are free software; you can redistribute them 55 | and/or modify them under the terms of the GNU General Public License as 56 | published by the Free Software Foundation; either version 2 of 57 | the License, or (at your option) any later version. 58 | 59 | UPX and UCL are distributed in the hope that they will be useful, 60 | but WITHOUT ANY WARRANTY; without even the implied warranty of 61 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 62 | GNU General Public License for more details. 63 | 64 | You should have received a copy of the GNU General Public License 65 | along with this program; see the file COPYING. 66 | 67 | 68 | SPECIAL EXCEPTION FOR COMPRESSED EXECUTABLES 69 | ============================================ 70 | 71 | The stub which is imbedded in each UPX compressed program is part 72 | of UPX and UCL, and contains code that is under our copyright. The 73 | terms of the GNU General Public License still apply as compressing 74 | a program is a special form of linking with our stub. 75 | 76 | Hereby Markus F.X.J. Oberhumer and Laszlo Molnar grant you special 77 | permission to freely use and distribute all UPX compressed programs 78 | (including commercial ones), subject to the following restrictions: 79 | 80 | 1. You must compress your program with a completely unmodified UPX 81 | version; either with our precompiled version, or (at your option) 82 | with a self compiled version of the unmodified UPX sources as 83 | distributed by us. 84 | 2. This also implies that the UPX stub must be completely unmodfied, i.e. 85 | the stub imbedded in your compressed program must be byte-identical 86 | to the stub that is produced by the official unmodified UPX version. 87 | 3. The decompressor and any other code from the stub must exclusively get 88 | used by the unmodified UPX stub for decompressing your program at 89 | program startup. No portion of the stub may get read, copied, 90 | called or otherwise get used or accessed by your program. 91 | 92 | 93 | ANNOTATIONS 94 | =========== 95 | 96 | - You can use a modified UPX version or modified UPX stub only for 97 | programs that are compatible with the GNU General Public License. 98 | 99 | - We grant you special permission to freely use and distribute all UPX 100 | compressed programs. But any modification of the UPX stub (such as, 101 | but not limited to, removing our copyright string or making your 102 | program non-decompressible) will immediately revoke your right to 103 | use and distribute a UPX compressed program. 104 | 105 | - UPX is not a software protection tool; by requiring that you use 106 | the unmodified UPX version for your proprietary programs we 107 | make sure that any user can decompress your program. This protects 108 | both you and your users as nobody can hide malicious code - 109 | any program that cannot be decompressed is highly suspicious 110 | by definition. 111 | 112 | - You can integrate all or part of UPX and UCL into projects that 113 | are compatible with the GNU GPL, but obviously you cannot grant 114 | any special exceptions beyond the GPL for our code in your project. 115 | 116 | - We want to actively support manufacturers of virus scanners and 117 | similar security software. Please contact us if you would like to 118 | incorporate parts of UPX or UCL into such a product. 119 | 120 | 121 | 122 | Markus F.X.J. Oberhumer Laszlo Molnar 123 | markus.oberhumer@jk.uni-linz.ac.at ml1050@cdata.tvnet.hu 124 | 125 | Linz, Austria, 25 Feb 2000 126 | 127 | 128 | 129 | -----BEGIN PGP SIGNATURE----- 130 | Version: 2.6.3ia 131 | Charset: noconv 132 | 133 | iQCVAwUBOLaLS210fyLu8beJAQFYVAP/ShzENWKLTvedLCjZbDcwaBEHfUVcrGMI 134 | wE7frMkbWT2zmkdv9hW90WmjMhOBu7yhUplvN8BKOtLiolEnZmLCYu8AGCwr5wBf 135 | dfLoClxnzfTtgQv5axF1awp4RwCUH3hf4cDrOVqmAsWXKPHtm4hx96jF6L4oHhjx 136 | OO03+ojZdO8= 137 | =CS52 138 | -----END PGP SIGNATURE----- 139 | -------------------------------------------------------------------------------- /DirTreeNode.cpp: -------------------------------------------------------------------------------- 1 | #include "DirTreeNode.h" 2 | #include "defs.h" 3 | #include "settings.h" 4 | 5 | DirTreeNode* DirTreeNode::lastInserted = NULL; 6 | 7 | DirTreeNode::DirTreeNode(const char* fName, const unsigned long long fSize, const unsigned fTime, const int fType) { 8 | this->name = strdup(fName); 9 | this->type = fType; 10 | this->size = fSize; 11 | this->time = fTime; 12 | this->forced = false; 13 | this->do_not_list_as_dir = false; 14 | lastInserted = (DirTreeNode *)this; 15 | next = NULL; 16 | firstChild = NULL; 17 | } 18 | DirTreeNode::~DirTreeNode() { 19 | for (DirTreeNode *p = firstChild; p != NULL; ) { 20 | DirTreeNode *q = p->getNext(); 21 | delete p; 22 | p = q; 23 | } 24 | free(name); 25 | } 26 | void DirTreeNode::setNext(DirTreeNode *next) { 27 | this->next = next; 28 | } 29 | void DirTreeNode::setForced(bool bln) { 30 | this->forced = bln; 31 | } 32 | DirTreeNode* DirTreeNode::getNext() { 33 | return next; 34 | } 35 | char* DirTreeNode::getName() { 36 | return name; 37 | } 38 | // modifies firstChild, if new or replacing 39 | bool DirTreeNode::insert(char* fName, const unsigned long long fSize, const unsigned fTime, const int fType) { 40 | if (fName == NULL) { // we are replacing, so free all children (if this was not created implicitly) 41 | if (this->forced == false) { 42 | for (DirTreeNode *p = firstChild; p != NULL; ) { 43 | DirTreeNode *q = p->getNext(); 44 | delete p; 45 | p = q; 46 | } 47 | firstChild = NULL; 48 | } 49 | this->size = fSize; 50 | this->time = fTime; 51 | this->type = fType; 52 | this->forced = false; 53 | lastInserted = this; 54 | return true; 55 | } 56 | 57 | // rem will be pointer to remainder of path, or NULL if no remainder 58 | char* rem = (char*) strchr(fName, '\\'); 59 | int fNameLen; 60 | if (rem != NULL) { 61 | if (rem[1] == '\0') { 62 | fNameLen = (int)strlen(fName); 63 | rem = NULL; 64 | } else { 65 | fNameLen = (int)(rem - fName) + 1; 66 | rem++; 67 | } 68 | } else { 69 | fNameLen = (int)strlen(fName); 70 | } 71 | 72 | bool exists = false; 73 | DirTreeNode *q = firstChild; 74 | for (DirTreeNode *p = firstChild; p != NULL; q = p, p = p->getNext()) { 75 | if (strncmp(p->getName(), fName, fNameLen) == 0 && strlen(p->getName()) == fNameLen) { 76 | exists = p->insert(rem, fSize, fTime, fType); 77 | if (exists == false) return false; // error while inserting 78 | exists = true; 79 | break; 80 | } 81 | } 82 | if (exists == false) { // new element 83 | if (rem != NULL) { // has remainder (directory which was not added before) 84 | char z = fName[fNameLen]; 85 | fName[fNameLen] = '\0'; 86 | DirTreeNode *a = new DirTreeNode(fName, 0, fTime, FILE_TYPE_DIRECTORY); 87 | if (q == NULL) { 88 | firstChild = a; 89 | } else { 90 | q->setNext(a); 91 | } 92 | fName[fNameLen] = z; 93 | a->insert(rem, fSize, fTime, fType); 94 | a->setForced(true); // created implicitly 95 | } else { 96 | DirTreeNode *a = new DirTreeNode(fName, fSize, fTime, fType); 97 | if (q == NULL) { 98 | firstChild = a; 99 | } else { 100 | q->setNext(a); 101 | } 102 | } 103 | } 104 | return true; 105 | } 106 | // modifies firstChild, if new or replacing 107 | bool DirTreeNode::remove(const char* fName) { 108 | if (fName == NULL) { // we found it, so return true, the deletion will take place later 109 | return true; 110 | } 111 | 112 | // rem will be pointer to remainder of path, or NULL if no remainder 113 | char* rem = (char*) strchr(fName, '\\'); 114 | int fNameLen; 115 | if (rem != NULL) { 116 | if (rem[1] == '\0') { 117 | fNameLen = (int)strlen(fName); 118 | rem = NULL; 119 | } else { 120 | fNameLen = (int)(rem - fName) + 1; 121 | rem++; 122 | } 123 | } else { 124 | fNameLen = (int)strlen(fName); 125 | } 126 | 127 | bool exists = false; 128 | DirTreeNode *q = firstChild; 129 | for (DirTreeNode *p = firstChild; p != NULL; q = p, p = p->getNext()) { 130 | if (strncmp(p->getName(), fName, fNameLen) == 0 && strlen(p->getName()) == fNameLen) { 131 | exists = p->remove(rem); 132 | if (exists == false) return false; // do not remove this 133 | exists = false; 134 | // we are going to remove p 135 | if (p == firstChild) { 136 | firstChild = p->getNext(); 137 | } else { 138 | q->setNext(p->getNext()); 139 | } 140 | delete p; 141 | break; 142 | } 143 | } 144 | if (exists == false) return false; 145 | return true; 146 | } 147 | void DirTreeNode::writeOut(FILE* fout, char* curPath) { 148 | int year = (this->time >> 25) + 1980; 149 | int month = (this->time & 0x1FFFFFF) >> 21; 150 | int day = (this->time & 0x1FFFFF) >> 16; 151 | int hour = (this->time & 0xFFFF) >> 11; 152 | int minute = (this->time & 0x7FF) >> 5; 153 | int second = (this->time & 0x1F) * 2; 154 | 155 | // do not write c:\, g:\, etc. as directories 156 | if (this->name[1] == ':' && this->name[2] == '\\' && this->name[3] == '\0') ; // nothing 157 | else { 158 | if (this->name[strlen(this->name) - 1] == '\\') fprintf(fout, "%s", curPath); 159 | fprintf(fout, settings.getLineFormat(), 160 | this->name, this->size, year, month, day, hour, minute, second); 161 | } 162 | 163 | if (firstChild != NULL) { 164 | int lenOrig = strlen(curPath); 165 | strcat(curPath, this->name); 166 | // first non directories 167 | for (DirTreeNode *p = firstChild; p != NULL; p = p->getNext()) { 168 | if (p->do_not_list_as_dir || p->getName()[strlen(p->getName()) - 1] != '\\') { 169 | if (p->getName()[strlen(p->getName()) - 1] == '\\') p->getName()[strlen(p->getName()) - 1] = '\0'; 170 | p->writeOut(fout, curPath); 171 | } 172 | } 173 | // now directories 174 | for (DirTreeNode *p = firstChild; p != NULL; p = p->getNext()) { 175 | if (!p->do_not_list_as_dir && p->getName()[strlen(p->getName()) - 1] == '\\') 176 | p->writeOut(fout, curPath); 177 | } 178 | curPath[lenOrig] = '\0'; 179 | } 180 | } 181 | 182 | void DirTreeNode::finalize() { 183 | this->forced = false; 184 | for (DirTreeNode *p = firstChild; p != NULL; p = p->getNext()) { 185 | p->finalize(); 186 | } 187 | } 188 | -------------------------------------------------------------------------------- /libs/zlib/inffixed.h: -------------------------------------------------------------------------------- 1 | /* inffixed.h -- table for decoding fixed codes 2 | * Generated automatically by makefixed(). 3 | */ 4 | 5 | /* WARNING: this file should *not* be used by applications. It 6 | is part of the implementation of the compression library and 7 | is subject to change. Applications should only use zlib.h. 8 | */ 9 | 10 | static const code lenfix[512] = { 11 | {96,7,0},{0,8,80},{0,8,16},{20,8,115},{18,7,31},{0,8,112},{0,8,48}, 12 | {0,9,192},{16,7,10},{0,8,96},{0,8,32},{0,9,160},{0,8,0},{0,8,128}, 13 | {0,8,64},{0,9,224},{16,7,6},{0,8,88},{0,8,24},{0,9,144},{19,7,59}, 14 | {0,8,120},{0,8,56},{0,9,208},{17,7,17},{0,8,104},{0,8,40},{0,9,176}, 15 | {0,8,8},{0,8,136},{0,8,72},{0,9,240},{16,7,4},{0,8,84},{0,8,20}, 16 | {21,8,227},{19,7,43},{0,8,116},{0,8,52},{0,9,200},{17,7,13},{0,8,100}, 17 | {0,8,36},{0,9,168},{0,8,4},{0,8,132},{0,8,68},{0,9,232},{16,7,8}, 18 | {0,8,92},{0,8,28},{0,9,152},{20,7,83},{0,8,124},{0,8,60},{0,9,216}, 19 | {18,7,23},{0,8,108},{0,8,44},{0,9,184},{0,8,12},{0,8,140},{0,8,76}, 20 | {0,9,248},{16,7,3},{0,8,82},{0,8,18},{21,8,163},{19,7,35},{0,8,114}, 21 | {0,8,50},{0,9,196},{17,7,11},{0,8,98},{0,8,34},{0,9,164},{0,8,2}, 22 | {0,8,130},{0,8,66},{0,9,228},{16,7,7},{0,8,90},{0,8,26},{0,9,148}, 23 | {20,7,67},{0,8,122},{0,8,58},{0,9,212},{18,7,19},{0,8,106},{0,8,42}, 24 | {0,9,180},{0,8,10},{0,8,138},{0,8,74},{0,9,244},{16,7,5},{0,8,86}, 25 | {0,8,22},{64,8,0},{19,7,51},{0,8,118},{0,8,54},{0,9,204},{17,7,15}, 26 | {0,8,102},{0,8,38},{0,9,172},{0,8,6},{0,8,134},{0,8,70},{0,9,236}, 27 | {16,7,9},{0,8,94},{0,8,30},{0,9,156},{20,7,99},{0,8,126},{0,8,62}, 28 | {0,9,220},{18,7,27},{0,8,110},{0,8,46},{0,9,188},{0,8,14},{0,8,142}, 29 | {0,8,78},{0,9,252},{96,7,0},{0,8,81},{0,8,17},{21,8,131},{18,7,31}, 30 | {0,8,113},{0,8,49},{0,9,194},{16,7,10},{0,8,97},{0,8,33},{0,9,162}, 31 | {0,8,1},{0,8,129},{0,8,65},{0,9,226},{16,7,6},{0,8,89},{0,8,25}, 32 | {0,9,146},{19,7,59},{0,8,121},{0,8,57},{0,9,210},{17,7,17},{0,8,105}, 33 | {0,8,41},{0,9,178},{0,8,9},{0,8,137},{0,8,73},{0,9,242},{16,7,4}, 34 | {0,8,85},{0,8,21},{16,8,258},{19,7,43},{0,8,117},{0,8,53},{0,9,202}, 35 | {17,7,13},{0,8,101},{0,8,37},{0,9,170},{0,8,5},{0,8,133},{0,8,69}, 36 | {0,9,234},{16,7,8},{0,8,93},{0,8,29},{0,9,154},{20,7,83},{0,8,125}, 37 | {0,8,61},{0,9,218},{18,7,23},{0,8,109},{0,8,45},{0,9,186},{0,8,13}, 38 | {0,8,141},{0,8,77},{0,9,250},{16,7,3},{0,8,83},{0,8,19},{21,8,195}, 39 | {19,7,35},{0,8,115},{0,8,51},{0,9,198},{17,7,11},{0,8,99},{0,8,35}, 40 | {0,9,166},{0,8,3},{0,8,131},{0,8,67},{0,9,230},{16,7,7},{0,8,91}, 41 | {0,8,27},{0,9,150},{20,7,67},{0,8,123},{0,8,59},{0,9,214},{18,7,19}, 42 | {0,8,107},{0,8,43},{0,9,182},{0,8,11},{0,8,139},{0,8,75},{0,9,246}, 43 | {16,7,5},{0,8,87},{0,8,23},{64,8,0},{19,7,51},{0,8,119},{0,8,55}, 44 | {0,9,206},{17,7,15},{0,8,103},{0,8,39},{0,9,174},{0,8,7},{0,8,135}, 45 | {0,8,71},{0,9,238},{16,7,9},{0,8,95},{0,8,31},{0,9,158},{20,7,99}, 46 | {0,8,127},{0,8,63},{0,9,222},{18,7,27},{0,8,111},{0,8,47},{0,9,190}, 47 | {0,8,15},{0,8,143},{0,8,79},{0,9,254},{96,7,0},{0,8,80},{0,8,16}, 48 | {20,8,115},{18,7,31},{0,8,112},{0,8,48},{0,9,193},{16,7,10},{0,8,96}, 49 | {0,8,32},{0,9,161},{0,8,0},{0,8,128},{0,8,64},{0,9,225},{16,7,6}, 50 | {0,8,88},{0,8,24},{0,9,145},{19,7,59},{0,8,120},{0,8,56},{0,9,209}, 51 | {17,7,17},{0,8,104},{0,8,40},{0,9,177},{0,8,8},{0,8,136},{0,8,72}, 52 | {0,9,241},{16,7,4},{0,8,84},{0,8,20},{21,8,227},{19,7,43},{0,8,116}, 53 | {0,8,52},{0,9,201},{17,7,13},{0,8,100},{0,8,36},{0,9,169},{0,8,4}, 54 | {0,8,132},{0,8,68},{0,9,233},{16,7,8},{0,8,92},{0,8,28},{0,9,153}, 55 | {20,7,83},{0,8,124},{0,8,60},{0,9,217},{18,7,23},{0,8,108},{0,8,44}, 56 | {0,9,185},{0,8,12},{0,8,140},{0,8,76},{0,9,249},{16,7,3},{0,8,82}, 57 | {0,8,18},{21,8,163},{19,7,35},{0,8,114},{0,8,50},{0,9,197},{17,7,11}, 58 | {0,8,98},{0,8,34},{0,9,165},{0,8,2},{0,8,130},{0,8,66},{0,9,229}, 59 | {16,7,7},{0,8,90},{0,8,26},{0,9,149},{20,7,67},{0,8,122},{0,8,58}, 60 | {0,9,213},{18,7,19},{0,8,106},{0,8,42},{0,9,181},{0,8,10},{0,8,138}, 61 | {0,8,74},{0,9,245},{16,7,5},{0,8,86},{0,8,22},{64,8,0},{19,7,51}, 62 | {0,8,118},{0,8,54},{0,9,205},{17,7,15},{0,8,102},{0,8,38},{0,9,173}, 63 | {0,8,6},{0,8,134},{0,8,70},{0,9,237},{16,7,9},{0,8,94},{0,8,30}, 64 | {0,9,157},{20,7,99},{0,8,126},{0,8,62},{0,9,221},{18,7,27},{0,8,110}, 65 | {0,8,46},{0,9,189},{0,8,14},{0,8,142},{0,8,78},{0,9,253},{96,7,0}, 66 | {0,8,81},{0,8,17},{21,8,131},{18,7,31},{0,8,113},{0,8,49},{0,9,195}, 67 | {16,7,10},{0,8,97},{0,8,33},{0,9,163},{0,8,1},{0,8,129},{0,8,65}, 68 | {0,9,227},{16,7,6},{0,8,89},{0,8,25},{0,9,147},{19,7,59},{0,8,121}, 69 | {0,8,57},{0,9,211},{17,7,17},{0,8,105},{0,8,41},{0,9,179},{0,8,9}, 70 | {0,8,137},{0,8,73},{0,9,243},{16,7,4},{0,8,85},{0,8,21},{16,8,258}, 71 | {19,7,43},{0,8,117},{0,8,53},{0,9,203},{17,7,13},{0,8,101},{0,8,37}, 72 | {0,9,171},{0,8,5},{0,8,133},{0,8,69},{0,9,235},{16,7,8},{0,8,93}, 73 | {0,8,29},{0,9,155},{20,7,83},{0,8,125},{0,8,61},{0,9,219},{18,7,23}, 74 | {0,8,109},{0,8,45},{0,9,187},{0,8,13},{0,8,141},{0,8,77},{0,9,251}, 75 | {16,7,3},{0,8,83},{0,8,19},{21,8,195},{19,7,35},{0,8,115},{0,8,51}, 76 | {0,9,199},{17,7,11},{0,8,99},{0,8,35},{0,9,167},{0,8,3},{0,8,131}, 77 | {0,8,67},{0,9,231},{16,7,7},{0,8,91},{0,8,27},{0,9,151},{20,7,67}, 78 | {0,8,123},{0,8,59},{0,9,215},{18,7,19},{0,8,107},{0,8,43},{0,9,183}, 79 | {0,8,11},{0,8,139},{0,8,75},{0,9,247},{16,7,5},{0,8,87},{0,8,23}, 80 | {64,8,0},{19,7,51},{0,8,119},{0,8,55},{0,9,207},{17,7,15},{0,8,103}, 81 | {0,8,39},{0,9,175},{0,8,7},{0,8,135},{0,8,71},{0,9,239},{16,7,9}, 82 | {0,8,95},{0,8,31},{0,9,159},{20,7,99},{0,8,127},{0,8,63},{0,9,223}, 83 | {18,7,27},{0,8,111},{0,8,47},{0,9,191},{0,8,15},{0,8,143},{0,8,79}, 84 | {0,9,255} 85 | }; 86 | 87 | static const code distfix[32] = { 88 | {16,5,1},{23,5,257},{19,5,17},{27,5,4097},{17,5,5},{25,5,1025}, 89 | {21,5,65},{29,5,16385},{16,5,3},{24,5,513},{20,5,33},{28,5,8193}, 90 | {18,5,9},{26,5,2049},{22,5,129},{64,5,0},{16,5,2},{23,5,385}, 91 | {19,5,25},{27,5,6145},{17,5,7},{25,5,1537},{21,5,97},{29,5,24577}, 92 | {16,5,4},{24,5,769},{20,5,49},{28,5,12289},{18,5,13},{26,5,3073}, 93 | {22,5,193},{64,5,0} 94 | }; 95 | -------------------------------------------------------------------------------- /libs/zlib/inflate.h: -------------------------------------------------------------------------------- 1 | /* inflate.h -- internal inflate state definition 2 | * Copyright (C) 1995-2009 Mark Adler 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* define NO_GZIP when compiling if you want to disable gzip header and 12 | trailer decoding by inflate(). NO_GZIP would be used to avoid linking in 13 | the crc code when it is not needed. For shared libraries, gzip decoding 14 | should be left enabled. */ 15 | #ifndef NO_GZIP 16 | # define GUNZIP 17 | #endif 18 | 19 | /* Possible inflate modes between inflate() calls */ 20 | typedef enum { 21 | HEAD, /* i: waiting for magic header */ 22 | FLAGS, /* i: waiting for method and flags (gzip) */ 23 | TIME, /* i: waiting for modification time (gzip) */ 24 | OS, /* i: waiting for extra flags and operating system (gzip) */ 25 | EXLEN, /* i: waiting for extra length (gzip) */ 26 | EXTRA, /* i: waiting for extra bytes (gzip) */ 27 | NAME, /* i: waiting for end of file name (gzip) */ 28 | COMMENT, /* i: waiting for end of comment (gzip) */ 29 | HCRC, /* i: waiting for header crc (gzip) */ 30 | DICTID, /* i: waiting for dictionary check value */ 31 | DICT, /* waiting for inflateSetDictionary() call */ 32 | TYPE, /* i: waiting for type bits, including last-flag bit */ 33 | TYPEDO, /* i: same, but skip check to exit inflate on new block */ 34 | STORED, /* i: waiting for stored size (length and complement) */ 35 | COPY_, /* i/o: same as COPY below, but only first time in */ 36 | COPY, /* i/o: waiting for input or output to copy stored block */ 37 | TABLE, /* i: waiting for dynamic block table lengths */ 38 | LENLENS, /* i: waiting for code length code lengths */ 39 | CODELENS, /* i: waiting for length/lit and distance code lengths */ 40 | LEN_, /* i: same as LEN below, but only first time in */ 41 | LEN, /* i: waiting for length/lit/eob code */ 42 | LENEXT, /* i: waiting for length extra bits */ 43 | DIST, /* i: waiting for distance code */ 44 | DISTEXT, /* i: waiting for distance extra bits */ 45 | MATCH, /* o: waiting for output space to copy string */ 46 | LIT, /* o: waiting for output space to write literal */ 47 | CHECK, /* i: waiting for 32-bit check value */ 48 | LENGTH, /* i: waiting for 32-bit length (gzip) */ 49 | DONE, /* finished check, done -- remain here until reset */ 50 | BAD, /* got a data error -- remain here until reset */ 51 | MEM, /* got an inflate() memory error -- remain here until reset */ 52 | SYNC /* looking for synchronization bytes to restart inflate() */ 53 | } inflate_mode; 54 | 55 | /* 56 | State transitions between above modes - 57 | 58 | (most modes can go to BAD or MEM on error -- not shown for clarity) 59 | 60 | Process header: 61 | HEAD -> (gzip) or (zlib) or (raw) 62 | (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT -> 63 | HCRC -> TYPE 64 | (zlib) -> DICTID or TYPE 65 | DICTID -> DICT -> TYPE 66 | (raw) -> TYPEDO 67 | Read deflate blocks: 68 | TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK 69 | STORED -> COPY_ -> COPY -> TYPE 70 | TABLE -> LENLENS -> CODELENS -> LEN_ 71 | LEN_ -> LEN 72 | Read deflate codes in fixed or dynamic block: 73 | LEN -> LENEXT or LIT or TYPE 74 | LENEXT -> DIST -> DISTEXT -> MATCH -> LEN 75 | LIT -> LEN 76 | Process trailer: 77 | CHECK -> LENGTH -> DONE 78 | */ 79 | 80 | /* state maintained between inflate() calls. Approximately 10K bytes. */ 81 | struct inflate_state { 82 | inflate_mode mode; /* current inflate mode */ 83 | int last; /* true if processing last block */ 84 | int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ 85 | int havedict; /* true if dictionary provided */ 86 | int flags; /* gzip header method and flags (0 if zlib) */ 87 | unsigned dmax; /* zlib header max distance (INFLATE_STRICT) */ 88 | unsigned long check; /* protected copy of check value */ 89 | unsigned long total; /* protected copy of output count */ 90 | gz_headerp head; /* where to save gzip header information */ 91 | /* sliding window */ 92 | unsigned wbits; /* log base 2 of requested window size */ 93 | unsigned wsize; /* window size or zero if not using window */ 94 | unsigned whave; /* valid bytes in the window */ 95 | unsigned wnext; /* window write index */ 96 | unsigned char FAR *window; /* allocated sliding window, if needed */ 97 | /* bit accumulator */ 98 | unsigned long hold; /* input bit accumulator */ 99 | unsigned bits; /* number of bits in "in" */ 100 | /* for string and stored block copying */ 101 | unsigned length; /* literal or length of data to copy */ 102 | unsigned offset; /* distance back to copy string from */ 103 | /* for table and code decoding */ 104 | unsigned extra; /* extra bits needed */ 105 | /* fixed and dynamic code tables */ 106 | code const FAR *lencode; /* starting table for length/literal codes */ 107 | code const FAR *distcode; /* starting table for distance codes */ 108 | unsigned lenbits; /* index bits for lencode */ 109 | unsigned distbits; /* index bits for distcode */ 110 | /* dynamic table building */ 111 | unsigned ncode; /* number of code length code lengths */ 112 | unsigned nlen; /* number of length code lengths */ 113 | unsigned ndist; /* number of distance code lengths */ 114 | unsigned have; /* number of code lengths in lens[] */ 115 | code FAR *next; /* next available space in codes[] */ 116 | unsigned short lens[320]; /* temporary storage for code lengths */ 117 | unsigned short work[288]; /* work area for code table building */ 118 | code codes[ENOUGH]; /* space for code tables */ 119 | int sane; /* if false, allow invalid distance too far */ 120 | int back; /* bits back of last unprocessed length/lit */ 121 | unsigned was; /* initial length of match */ 122 | }; 123 | -------------------------------------------------------------------------------- /libs/iso/iso_read.txt: -------------------------------------------------------------------------------- 1 | iso plugin for Total Commander (read CD-ROM images) version 1.7.6 2 | 3 | Official Polish ISO.WCX plugin website, with tutorials and FAQ 4 | can be found at http://cdrlab.pl 5 | 6 | installation: 7 | 8 | 1. unzip the iso.wcx to your Total Commander installation directory 9 | 2. choose the menu configuration - options 10 | 3. choose the packer tab 11 | 4. click the configure packer extension dlls button 12 | 5. type ISO as new extension 13 | 6. click new type, and select iso.wcx 14 | 7. click ok 15 | skip step 8 if you have TC version over 5.5 16 | 8. repeat steps 2-7 for BIN, IMG and NRG extensions 17 | 18 | Author: Sergey Oblomov 19 | or secondary e-mail hoopoepg@mail.ru 20 | ICQ 12411939 21 | 22 | =================================================================== 23 | 24 | Changes: 25 | 2002.03.20 Support for WinOnCD c2d image format. Author: Oliver von Bueren 26 | 2003.04.06 Added support for: 27 | - BIN/CUE images 28 | - IMG (CloneCD) images 29 | - NRG (Nero) images 30 | - Large (>4GB) images (that is, DVD images with ISO Bridge format) 31 | - Open by Content (Ctrl+PgDn) enabled 32 | - File Search enabled 33 | - Mode2/Form2 (S/VCD & XCD) extraction (emulates Windows behaviour) 34 | Author: DeXT 35 | 2003.07.23 version 1.5 36 | - redesign of code 37 | - now plugin works MUCH faster 38 | 2003.08.19 version 1.5.2 (Oliver von Bueren) 39 | - changed detection function for VolumeDescriptor, tested with 40 | c2d (WinOnCD 3.8) and nrg (Nero 6.x) files, should work with 41 | most other formats without changes. 42 | 2003.09.17 version 1.5.2 43 | - fixed bug with reading last file or folder in directory (it was nor read 44 | if length of name was 1 symbol) 45 | 2003.10.09 version 1.5.4 46 | - fixed bug with reading .iso images without Jouliet extention: 47 | in some cases files were named like "filename.ext;1" instead 48 | of "filename.ext" 49 | 2003.29.10 version 1.6 50 | - added supporting boot images: now boot images may be extracted from 51 | iso image as regular file 52 | - updated algorithm for scanning signature of CD images 53 | - unfortunately i lost most of test images, so, if you found some 54 | degradation of plugin - let me know (if possible, with link to file) 55 | 2003.31.10 version 1.6.1 56 | - fixed potential bug in detecting size of sector 57 | - fixed critical bug with reading large images 58 | - special thanks vmb2003 and SoBal(sobal@cdrinfo.pl) 59 | 2003.03.11 version 1.6.2 60 | - fixed minor bug: on some images boot image was not detected 61 | 2003.16.12 version 1.6.3 62 | - added support of some strange nero format :) 63 | 2004.02.04 version 1.6.4 64 | - fixed minor bug: some non-ISO images were detected as ISO images with 65 | empty content 66 | 2004.02.09 version 1.6.5 67 | - fixed bug: some ISO-like images (,nrg...) couldn't be read by plugin, 68 | there was some regression from version 1.6.2 69 | - added official Polish website for plugin :) 70 | - fixed extraction bug: file date/time was set incorrectly 71 | 2004.02.10 version 1.6.6 72 | - fixed bug: files 0-size could not be extracted 73 | 2004.02.24 version 1.6.7 74 | - fixed bug: some non comopressed rar images with included .iso images 75 | were detected as native .iso images 76 | 2004.02.27 version 1.6.8 77 | - feature request: check for canceling operation (user pressed "Cancel" 78 | button) every few kbytes of extraction 79 | 2004.04.08 version 1.6.9 80 | - changed compilation flags: removed flag -Gs (to prevent fails on some 81 | systems) 82 | 2004.04.23 version 1.6.10 83 | - fixed serious bug: on some images plugin may enter to infinite loop - 84 | TC may halt. Highly recommend to upgrade from older versions 85 | 2004.05.21 version 1.6.11 86 | - try to use user's system locale to convert filenames from unicode to 87 | ACP codepage... no chance to test - but it should work :)... 88 | if doesn't work - please, let me know. thanks 89 | 2004.06.28 version 1.7b 90 | - try to implement processing of multisession images... actually processed 91 | .iso images only (i have no idea about .nrg & other .iso clones files) 92 | 2004.09.24 version 1.7.b2 93 | - fixed bug in detection of Jouliet extension (some images with this 94 | extension was detected as single ISO9669 images, without extension) 95 | 2004.10.05 version 1.7.b3 96 | - fixed critical bug in file extraction: files with large size in native 97 | iso images (ISO9660 or Jouliet ext.) was extraxted incorrectly. Highly 98 | recommended upgrade from previous betas 99 | 2004.11.01 version 1.7 100 | - no changes since 1.7b3 - just change status to Release 101 | - changed my primary e-mail to hoopoepg@gmail.com 102 | 2004.11.04 version 1.7.2 103 | - changed extension for floppy boot images (now it will have extension .ima) 104 | 2005.03.14 version 1.7.3 beta 105 | - added support of XBOX iso images. Special thanks to Beketata for 106 | information about this image format and help in implementation 107 | - fixed bug: large files (>4Gb) may be read with errors 108 | 2006.01.12 - fixed bug: buffer overflow in reading of ISO headers 109 | 2007.01.23 version 1.7.4 beta 1 110 | - fixed bug: crash on images with long names. special thanks to 111 | Tan Chew Keong for bug report (http://vuln.sg/) 112 | 2009.03.10 version 1.7.6 113 | - fixed minor bug: on large (DVD) images opening of image may take 114 | significant time (up to 20 minutes) 115 | 2010.11.09 version 1.7.7 beta 1 116 | - added unicode API support for TotalCommander (used in Joliet ISO extension) 117 | 2010.11.10 version 1.7.7 beta 2 118 | - fixed issue in detection utf-8 locale of file name in Joliet extension 119 | 2010.11.18 version 1.7.7 beta 3 120 | - disabled by default detection of utf-8 codepage in Unicode filenames 121 | (because this is not standard and some UCS2 Japan names were detected as 122 | utf-8 names :)). to enable this heuristic define environment variable 123 | set ISO_WCX_ENABLE_UTF8 = 1 124 | - fixed critical issue: plugin may crash on some strange images where 125 | set of volume descriptors is not complete 126 | - fixed major issue: some files can't be extracted from large images (~2Gb) 127 | 2011.07.25 version 1.7.7 beta 4 128 | - fixed major issue: on some multi-session images plugin may crush 129 | 2011.10.31 version 1.7.8 130 | - port to 64-bit platform 131 | 2011.10.31 version 1.7.9 132 | - fixed crash on some specific ISO images. thanks Marcin Bednarz for bug report 133 | 134 | 135 | 136 | -------------------------------------------------------------------------------- /inilocator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 1. The highest priority for wincmd.ini locations is the /i commandline parameter. 3 | Use the GetCommandLine Winapi function to get this path and extract the value 4 | of the /i parameter. If the commandline string contains /i --> done, otherwise continue to 2. 5 | 2. Search for the file Wincmd.ini in TC program directory (%COMMANDER_PATH% environment string). 6 | If the file exists continue to 2a. Otherwise continue to 3. 7 | 2a. Read UseIniInProgramDir setting in [Configuration] section. 8 | Binary compare UseIniInProgramDir with 1 to find out if wincmd.ini in current directory is used. 9 | If this is the case continue to 2b, otherwise continue to 3. 10 | 2b. Binary compare UseIniInProgramDir with 4 to find out of UseIniInProgramDir 11 | should overwrite eventually existing registry values. 12 | If this is the case --> done, otherwise continue to 3. 13 | 3. Read the registry setting "IniFileName" in HKEY_CURRENT_USER\Software\Ghisler. 14 | If path has been found --> done, otherwise read the setting "IniFileName" in 15 | HKEY_LOCAL_MACHINE\Software\Ghisler. If a path has been found here --> done, otherwise continue to 3a. 16 | 3a. If 2a returned true (UseIniInProgramDir AND 1) use the Wincmd.ini in program directory (done) 17 | otherwise continue to 4. 18 | 4. The lowest priority is a Wincmd.ini file in Windows directory (done). 19 | Otherwise no valid ini file exists. 20 | */ 21 | #include "inilocator.h" 22 | 23 | PCHAR* CommandLineToArgvA(PCHAR CmdLine, int* _argc) 24 | { 25 | PCHAR* argv; 26 | PCHAR _argv; 27 | ULONG len; 28 | ULONG argc; 29 | CHAR a; 30 | ULONG i, j; 31 | 32 | BOOLEAN in_QM; 33 | BOOLEAN in_TEXT; 34 | BOOLEAN in_SPACE; 35 | 36 | len = strlen(CmdLine); 37 | i = ((len+2)/2)*sizeof(PVOID) + sizeof(PVOID); 38 | 39 | argv = (PCHAR*)GlobalAlloc(GMEM_FIXED, 40 | i + (len+2)*sizeof(CHAR)); 41 | 42 | _argv = (PCHAR)(((PUCHAR)argv)+i); 43 | 44 | argc = 0; 45 | argv[argc] = _argv; 46 | in_QM = FALSE; 47 | in_TEXT = FALSE; 48 | in_SPACE = TRUE; 49 | i = 0; 50 | j = 0; 51 | 52 | while( a = CmdLine[i] ) { 53 | if(in_QM) { 54 | if(a == '\"') { 55 | in_QM = FALSE; 56 | } else { 57 | _argv[j] = a; 58 | j++; 59 | } 60 | } else { 61 | switch(a) { 62 | case '\"': 63 | in_QM = TRUE; 64 | in_TEXT = TRUE; 65 | if(in_SPACE) { 66 | argv[argc] = _argv+j; 67 | argc++; 68 | } 69 | in_SPACE = FALSE; 70 | break; 71 | case ' ': 72 | case '\t': 73 | case '\n': 74 | case '\r': 75 | if(in_TEXT) { 76 | _argv[j] = '\0'; 77 | j++; 78 | } 79 | in_TEXT = FALSE; 80 | in_SPACE = TRUE; 81 | break; 82 | default: 83 | in_TEXT = TRUE; 84 | if(in_SPACE) { 85 | argv[argc] = _argv+j; 86 | argc++; 87 | } 88 | _argv[j] = a; 89 | j++; 90 | in_SPACE = FALSE; 91 | break; 92 | } 93 | } 94 | i++; 95 | } 96 | _argv[j] = '\0'; 97 | argv[argc] = NULL; 98 | 99 | (*_argc) = argc; 100 | return argv; 101 | } 102 | 103 | string get_wincmd_ini_location() { 104 | LPSTR *szArglist; 105 | int nArgs; 106 | int i; 107 | string fname = "wincmd.ini"; 108 | CHAR buf[8192]; 109 | bool name_found = false; 110 | 111 | szArglist = CommandLineToArgvA((PCHAR) GetCommandLineA(), &nArgs); 112 | if (NULL != szArglist) { 113 | for (i = 0; i < nArgs; i++) { 114 | if (szArglist[i][0] == '/' && (szArglist[i][1] == 'i' || szArglist[i][1] == 'I') && szArglist[i][2] == '=') { 115 | fname = szArglist[i]+3; 116 | name_found = true; 117 | 118 | // if name contains backslash, we are done 119 | for (i = fname.size() - 1; i >= 0; i--) if (fname[i] == '\\') break; 120 | if (i >= 0) break; 121 | 122 | // if name does not contain backslash, it is the file in %windir% 123 | ExpandEnvironmentStrings("%windir%\\", buf, 8192); 124 | fname.insert(0, buf); 125 | break; 126 | } 127 | } 128 | LocalFree(szArglist); 129 | } 130 | 131 | if (!name_found) { 132 | int useIniInProgramDir = 0; 133 | ExpandEnvironmentStrings("%COMMANDER_PATH%\\", buf, 8192); 134 | strcat_s(buf, 8192, fname.c_str()); 135 | CIniFile iniFile; 136 | 137 | if (iniFile.OpenIniFile(buf)) { 138 | useIniInProgramDir = iniFile.ReadInt("Configuration", "UseIniInProgramDir", 0); 139 | iniFile.CloseIniFile(); 140 | } 141 | 142 | if ((useIniInProgramDir & 1) && (useIniInProgramDir & 4)) { 143 | fname = buf; 144 | } else { 145 | // check registry for IniFileName 146 | HKEY hkeySOFTWARE = NULL, hkeyGhisler = NULL, hkeyTC = NULL; 147 | char buf2[8192]; 148 | DWORD buflen = 8192; 149 | if (RegOpenKeyEx(HKEY_CURRENT_USER, ("SOFTWARE"), 0, KEY_READ, &hkeySOFTWARE) == ERROR_SUCCESS && 150 | RegOpenKeyEx(hkeySOFTWARE, ("Ghisler"), 0, KEY_READ, &hkeyGhisler) == ERROR_SUCCESS && 151 | RegOpenKeyEx(hkeyGhisler, ("Total Commander"), 0, KEY_READ, &hkeyTC) == ERROR_SUCCESS && 152 | RegQueryValueEx(hkeyTC, ("IniFileName"), NULL, NULL, (LPBYTE) buf2, &buflen) == ERROR_SUCCESS) 153 | { 154 | for (i = 0; buf2[i] != '\0'; i++) if (buf2[i] == '\\') break; 155 | if (buf2[i] == '\0' || (buf2[0] == '.' && buf2[1] == '\\')) { 156 | if (buf2[i] == '\0') ExpandEnvironmentStrings("%windir%\\", buf, 8192); 157 | else ExpandEnvironmentStrings("%COMMANDER_PATH%\\", buf, 8192); 158 | strcat(buf, buf2); 159 | } else { 160 | ExpandEnvironmentStrings(buf2, buf, 8192); 161 | } 162 | fname = buf; 163 | name_found = true; 164 | } 165 | if (hkeySOFTWARE != NULL) RegCloseKey(hkeySOFTWARE); 166 | if (hkeyGhisler != NULL) RegCloseKey(hkeyGhisler); 167 | if (hkeyTC != NULL) RegCloseKey(hkeyTC); 168 | hkeySOFTWARE = NULL, hkeyGhisler = NULL, hkeyTC = NULL; 169 | 170 | if (!name_found && 171 | RegOpenKeyEx(HKEY_LOCAL_MACHINE, ("SOFTWARE"), 0, KEY_READ, &hkeySOFTWARE) == ERROR_SUCCESS && 172 | RegOpenKeyEx(hkeySOFTWARE, ("Ghisler"), 0, KEY_READ, &hkeyGhisler) == ERROR_SUCCESS && 173 | RegOpenKeyEx(hkeyGhisler, ("Total Commander"), 0, KEY_READ, &hkeyTC) == ERROR_SUCCESS && 174 | RegQueryValueEx(hkeyTC, ("IniFileName"), NULL, NULL, (LPBYTE) buf2, &buflen) == ERROR_SUCCESS) 175 | { 176 | for (i = 0; buf2[i] != '\0'; i++) if (buf2[i] == '\\') break; 177 | if (buf2[i] == '\0' || (buf2[0] == '.' && buf2[1] == '\\')) { 178 | if (buf2[i] == '\0') ExpandEnvironmentStrings("%windir%\\", buf, 8192); 179 | else ExpandEnvironmentStrings("%COMMANDER_PATH%\\", buf, 8192); 180 | strcat(buf, buf2 + 2); 181 | } else { 182 | ExpandEnvironmentStrings(buf2, buf, 8192); 183 | } 184 | fname = buf; 185 | name_found = true; 186 | } 187 | if (hkeySOFTWARE != NULL) RegCloseKey(hkeySOFTWARE); 188 | if (hkeyGhisler != NULL) RegCloseKey(hkeyGhisler); 189 | if (hkeyTC != NULL) RegCloseKey(hkeyTC); 190 | 191 | if (!name_found && (useIniInProgramDir & 1)) { 192 | fname = buf; 193 | name_found = true; 194 | } 195 | if (!name_found) { 196 | ExpandEnvironmentStrings("%windir%\\", buf, 8192); 197 | fname.insert(0, buf); 198 | } 199 | } 200 | } 201 | /* 202 | FILE *fout = fopen("c:\\ccc.txt", "wt"); 203 | if (fout != NULL) { 204 | fprintf(fout, "%s\n", fname.c_str()); 205 | ExpandEnvironmentStrings("%COMMANDER_PATH%\\", buf, 8192); 206 | fprintf(fout, "%s\n", buf); 207 | ExpandEnvironmentStrings("%USERPROFILE%\\", buf, 8192); 208 | fprintf(fout, "%s\n", buf); 209 | fclose(fout); 210 | } 211 | */ 212 | return fname; 213 | } 214 | -------------------------------------------------------------------------------- /libs/bzip2/bzlib.h: -------------------------------------------------------------------------------- 1 | 2 | /*-------------------------------------------------------------*/ 3 | /*--- Public header file for the library. ---*/ 4 | /*--- bzlib.h ---*/ 5 | /*-------------------------------------------------------------*/ 6 | 7 | /* ------------------------------------------------------------------ 8 | This file is part of bzip2/libbzip2, a program and library for 9 | lossless, block-sorting data compression. 10 | 11 | bzip2/libbzip2 version 1.0.5 of 10 December 2007 12 | Copyright (C) 1996-2007 Julian Seward 13 | 14 | Please read the WARNING, DISCLAIMER and PATENTS sections in the 15 | README file. 16 | 17 | This program is released under the terms of the license contained 18 | in the file LICENSE. 19 | ------------------------------------------------------------------ */ 20 | 21 | 22 | #ifndef _BZLIB_H 23 | #define _BZLIB_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #define BZ_RUN 0 30 | #define BZ_FLUSH 1 31 | #define BZ_FINISH 2 32 | 33 | #define BZ_OK 0 34 | #define BZ_RUN_OK 1 35 | #define BZ_FLUSH_OK 2 36 | #define BZ_FINISH_OK 3 37 | #define BZ_STREAM_END 4 38 | #define BZ_SEQUENCE_ERROR (-1) 39 | #define BZ_PARAM_ERROR (-2) 40 | #define BZ_MEM_ERROR (-3) 41 | #define BZ_DATA_ERROR (-4) 42 | #define BZ_DATA_ERROR_MAGIC (-5) 43 | #define BZ_IO_ERROR (-6) 44 | #define BZ_UNEXPECTED_EOF (-7) 45 | #define BZ_OUTBUFF_FULL (-8) 46 | #define BZ_CONFIG_ERROR (-9) 47 | 48 | typedef 49 | struct { 50 | char *next_in; 51 | unsigned int avail_in; 52 | unsigned int total_in_lo32; 53 | unsigned int total_in_hi32; 54 | 55 | char *next_out; 56 | unsigned int avail_out; 57 | unsigned int total_out_lo32; 58 | unsigned int total_out_hi32; 59 | 60 | void *state; 61 | 62 | void *(*bzalloc)(void *,int,int); 63 | void (*bzfree)(void *,void *); 64 | void *opaque; 65 | } 66 | bz_stream; 67 | 68 | 69 | #ifndef BZ_IMPORT 70 | #define BZ_EXPORT 71 | #endif 72 | 73 | #ifndef BZ_NO_STDIO 74 | /* Need a definitition for FILE */ 75 | #include 76 | #endif 77 | 78 | #ifdef _WIN32 79 | # include 80 | # ifdef small 81 | /* windows.h define small to char */ 82 | # undef small 83 | # endif 84 | # ifdef BZ_EXPORT 85 | # define BZ_API(func) WINAPI func 86 | # define BZ_EXTERN extern 87 | # else 88 | /* import windows dll dynamically */ 89 | # define BZ_API(func) (WINAPI * func) 90 | # define BZ_EXTERN 91 | # endif 92 | #else 93 | # define BZ_API(func) func 94 | # define BZ_EXTERN extern 95 | #endif 96 | 97 | 98 | /*-- Core (low-level) library functions --*/ 99 | 100 | BZ_EXTERN int BZ_API(BZ2_bzCompressInit) ( 101 | bz_stream* strm, 102 | int blockSize100k, 103 | int verbosity, 104 | int workFactor 105 | ); 106 | 107 | BZ_EXTERN int BZ_API(BZ2_bzCompress) ( 108 | bz_stream* strm, 109 | int action 110 | ); 111 | 112 | BZ_EXTERN int BZ_API(BZ2_bzCompressEnd) ( 113 | bz_stream* strm 114 | ); 115 | 116 | BZ_EXTERN int BZ_API(BZ2_bzDecompressInit) ( 117 | bz_stream *strm, 118 | int verbosity, 119 | int small 120 | ); 121 | 122 | BZ_EXTERN int BZ_API(BZ2_bzDecompress) ( 123 | bz_stream* strm 124 | ); 125 | 126 | BZ_EXTERN int BZ_API(BZ2_bzDecompressEnd) ( 127 | bz_stream *strm 128 | ); 129 | 130 | 131 | 132 | /*-- High(er) level library functions --*/ 133 | 134 | #ifndef BZ_NO_STDIO 135 | #define BZ_MAX_UNUSED 5000 136 | 137 | typedef void BZFILE; 138 | 139 | BZ_EXTERN BZFILE* BZ_API(BZ2_bzReadOpen) ( 140 | int* bzerror, 141 | FILE* f, 142 | int verbosity, 143 | int small, 144 | void* unused, 145 | int nUnused 146 | ); 147 | 148 | BZ_EXTERN void BZ_API(BZ2_bzReadClose) ( 149 | int* bzerror, 150 | BZFILE* b 151 | ); 152 | 153 | BZ_EXTERN void BZ_API(BZ2_bzReadGetUnused) ( 154 | int* bzerror, 155 | BZFILE* b, 156 | void** unused, 157 | int* nUnused 158 | ); 159 | 160 | BZ_EXTERN int BZ_API(BZ2_bzRead) ( 161 | int* bzerror, 162 | BZFILE* b, 163 | void* buf, 164 | int len 165 | ); 166 | 167 | BZ_EXTERN BZFILE* BZ_API(BZ2_bzWriteOpen) ( 168 | int* bzerror, 169 | FILE* f, 170 | int blockSize100k, 171 | int verbosity, 172 | int workFactor 173 | ); 174 | 175 | BZ_EXTERN void BZ_API(BZ2_bzWrite) ( 176 | int* bzerror, 177 | BZFILE* b, 178 | void* buf, 179 | int len 180 | ); 181 | 182 | BZ_EXTERN void BZ_API(BZ2_bzWriteClose) ( 183 | int* bzerror, 184 | BZFILE* b, 185 | int abandon, 186 | unsigned int* nbytes_in, 187 | unsigned int* nbytes_out 188 | ); 189 | 190 | BZ_EXTERN void BZ_API(BZ2_bzWriteClose64) ( 191 | int* bzerror, 192 | BZFILE* b, 193 | int abandon, 194 | unsigned int* nbytes_in_lo32, 195 | unsigned int* nbytes_in_hi32, 196 | unsigned int* nbytes_out_lo32, 197 | unsigned int* nbytes_out_hi32 198 | ); 199 | #endif 200 | 201 | 202 | /*-- Utility functions --*/ 203 | 204 | BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffCompress) ( 205 | char* dest, 206 | unsigned int* destLen, 207 | char* source, 208 | unsigned int sourceLen, 209 | int blockSize100k, 210 | int verbosity, 211 | int workFactor 212 | ); 213 | 214 | BZ_EXTERN int BZ_API(BZ2_bzBuffToBuffDecompress) ( 215 | char* dest, 216 | unsigned int* destLen, 217 | char* source, 218 | unsigned int sourceLen, 219 | int small, 220 | int verbosity 221 | ); 222 | 223 | 224 | /*-- 225 | Code contributed by Yoshioka Tsuneo (tsuneo@rr.iij4u.or.jp) 226 | to support better zlib compatibility. 227 | This code is not _officially_ part of libbzip2 (yet); 228 | I haven't tested it, documented it, or considered the 229 | threading-safeness of it. 230 | If this code breaks, please contact both Yoshioka and me. 231 | --*/ 232 | 233 | BZ_EXTERN const char * BZ_API(BZ2_bzlibVersion) ( 234 | void 235 | ); 236 | 237 | #ifndef BZ_NO_STDIO 238 | BZ_EXTERN BZFILE * BZ_API(BZ2_bzopen) ( 239 | const char *path, 240 | const char *mode 241 | ); 242 | 243 | BZ_EXTERN BZFILE * BZ_API(BZ2_bzdopen) ( 244 | int fd, 245 | const char *mode 246 | ); 247 | 248 | BZ_EXTERN int BZ_API(BZ2_bzread) ( 249 | BZFILE* b, 250 | void* buf, 251 | int len 252 | ); 253 | 254 | BZ_EXTERN int BZ_API(BZ2_bzwrite) ( 255 | BZFILE* b, 256 | void* buf, 257 | int len 258 | ); 259 | 260 | BZ_EXTERN int BZ_API(BZ2_bzflush) ( 261 | BZFILE* b 262 | ); 263 | 264 | BZ_EXTERN void BZ_API(BZ2_bzclose) ( 265 | BZFILE* b 266 | ); 267 | 268 | BZ_EXTERN const char * BZ_API(BZ2_bzerror) ( 269 | BZFILE *b, 270 | int *errnum 271 | ); 272 | #endif 273 | 274 | #ifdef __cplusplus 275 | } 276 | #endif 277 | 278 | #endif 279 | 280 | /*-------------------------------------------------------------*/ 281 | /*--- end bzlib.h ---*/ 282 | /*-------------------------------------------------------------*/ 283 | -------------------------------------------------------------------------------- /libs/zlib/contrib/minizip/ioapi.h: -------------------------------------------------------------------------------- 1 | /* ioapi.h -- IO base function header for compress/uncompress .zip 2 | part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) 3 | 4 | Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) 5 | 6 | Modifications for Zip64 support 7 | Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) 8 | 9 | For more info read MiniZip_info.txt 10 | 11 | Changes 12 | 13 | Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this) 14 | Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux. 15 | More if/def section may be needed to support other platforms 16 | Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows. 17 | (but you should use iowin32.c for windows instead) 18 | 19 | */ 20 | 21 | #ifndef _ZLIBIOAPI64_H 22 | #define _ZLIBIOAPI64_H 23 | 24 | #if (!defined(_WIN32)) && (!defined(WIN32)) 25 | 26 | // Linux needs this to support file operation on files larger then 4+GB 27 | // But might need better if/def to select just the platforms that needs them. 28 | 29 | #ifndef __USE_FILE_OFFSET64 30 | #define __USE_FILE_OFFSET64 31 | #endif 32 | #ifndef __USE_LARGEFILE64 33 | #define __USE_LARGEFILE64 34 | #endif 35 | #ifndef _LARGEFILE64_SOURCE 36 | #define _LARGEFILE64_SOURCE 37 | #endif 38 | #ifndef _FILE_OFFSET_BIT 39 | #define _FILE_OFFSET_BIT 64 40 | #endif 41 | #endif 42 | 43 | #include 44 | #include 45 | #include "zlib.h" 46 | 47 | #if defined(USE_FILE32API) 48 | #define fopen64 fopen 49 | #define ftello64 ftell 50 | #define fseeko64 fseek 51 | #else 52 | #ifdef _MSC_VER 53 | #define fopen64 fopen 54 | #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) 55 | #define ftello64 _ftelli64 56 | #define fseeko64 _fseeki64 57 | #else // old MSC 58 | #define ftello64 ftell 59 | #define fseeko64 fseek 60 | #endif 61 | #endif 62 | #endif 63 | 64 | /* 65 | #ifndef ZPOS64_T 66 | #ifdef _WIN32 67 | #define ZPOS64_T fpos_t 68 | #else 69 | #include 70 | #define ZPOS64_T uint64_t 71 | #endif 72 | #endif 73 | */ 74 | 75 | #ifdef HAVE_MINIZIP64_CONF_H 76 | #include "mz64conf.h" 77 | #endif 78 | 79 | /* a type choosen by DEFINE */ 80 | #ifdef HAVE_64BIT_INT_CUSTOM 81 | typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; 82 | #else 83 | #ifdef HAS_STDINT_H 84 | #include "stdint.h" 85 | typedef uint64_t ZPOS64_T; 86 | #else 87 | 88 | 89 | #if defined(_MSC_VER) || defined(__BORLANDC__) 90 | typedef unsigned __int64 ZPOS64_T; 91 | #else 92 | typedef unsigned long long int ZPOS64_T; 93 | #endif 94 | #endif 95 | #endif 96 | 97 | 98 | 99 | #ifdef __cplusplus 100 | extern "C" { 101 | #endif 102 | 103 | 104 | #define ZLIB_FILEFUNC_SEEK_CUR (1) 105 | #define ZLIB_FILEFUNC_SEEK_END (2) 106 | #define ZLIB_FILEFUNC_SEEK_SET (0) 107 | 108 | #define ZLIB_FILEFUNC_MODE_READ (1) 109 | #define ZLIB_FILEFUNC_MODE_WRITE (2) 110 | #define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) 111 | 112 | #define ZLIB_FILEFUNC_MODE_EXISTING (4) 113 | #define ZLIB_FILEFUNC_MODE_CREATE (8) 114 | 115 | 116 | #ifndef ZCALLBACK 117 | #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) 118 | #define ZCALLBACK CALLBACK 119 | #else 120 | #define ZCALLBACK 121 | #endif 122 | #endif 123 | 124 | 125 | 126 | 127 | typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); 128 | typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); 129 | typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); 130 | typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); 131 | typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); 132 | 133 | typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); 134 | typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); 135 | 136 | 137 | /* here is the "old" 32 bits structure structure */ 138 | typedef struct zlib_filefunc_def_s 139 | { 140 | open_file_func zopen_file; 141 | read_file_func zread_file; 142 | write_file_func zwrite_file; 143 | tell_file_func ztell_file; 144 | seek_file_func zseek_file; 145 | close_file_func zclose_file; 146 | testerror_file_func zerror_file; 147 | voidpf opaque; 148 | } zlib_filefunc_def; 149 | 150 | typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); 151 | typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); 152 | typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode)); 153 | 154 | typedef struct zlib_filefunc64_def_s 155 | { 156 | open64_file_func zopen64_file; 157 | read_file_func zread_file; 158 | write_file_func zwrite_file; 159 | tell64_file_func ztell64_file; 160 | seek64_file_func zseek64_file; 161 | close_file_func zclose_file; 162 | testerror_file_func zerror_file; 163 | voidpf opaque; 164 | } zlib_filefunc64_def; 165 | 166 | void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def)); 167 | void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); 168 | 169 | /* now internal definition, only for zip.c and unzip.h */ 170 | typedef struct zlib_filefunc64_32_def_s 171 | { 172 | zlib_filefunc64_def zfile_func64; 173 | open_file_func zopen32_file; 174 | tell_file_func ztell32_file; 175 | seek_file_func zseek32_file; 176 | } zlib_filefunc64_32_def; 177 | 178 | 179 | #define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) 180 | #define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) 181 | //#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) 182 | //#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) 183 | #define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) 184 | #define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) 185 | 186 | voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)); 187 | long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)); 188 | ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)); 189 | 190 | void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); 191 | 192 | #define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) 193 | #define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) 194 | #define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) 195 | 196 | #ifdef __cplusplus 197 | } 198 | #endif 199 | 200 | #endif 201 | -------------------------------------------------------------------------------- /libs/bzip2/huffman.c: -------------------------------------------------------------------------------- 1 | 2 | /*-------------------------------------------------------------*/ 3 | /*--- Huffman coding low-level stuff ---*/ 4 | /*--- huffman.c ---*/ 5 | /*-------------------------------------------------------------*/ 6 | 7 | /* ------------------------------------------------------------------ 8 | This file is part of bzip2/libbzip2, a program and library for 9 | lossless, block-sorting data compression. 10 | 11 | bzip2/libbzip2 version 1.0.5 of 10 December 2007 12 | Copyright (C) 1996-2007 Julian Seward 13 | 14 | Please read the WARNING, DISCLAIMER and PATENTS sections in the 15 | README file. 16 | 17 | This program is released under the terms of the license contained 18 | in the file LICENSE. 19 | ------------------------------------------------------------------ */ 20 | 21 | 22 | #include "bzlib_private.h" 23 | 24 | /*---------------------------------------------------*/ 25 | #define WEIGHTOF(zz0) ((zz0) & 0xffffff00) 26 | #define DEPTHOF(zz1) ((zz1) & 0x000000ff) 27 | #define MYMAX(zz2,zz3) ((zz2) > (zz3) ? (zz2) : (zz3)) 28 | 29 | #define ADDWEIGHTS(zw1,zw2) \ 30 | (WEIGHTOF(zw1)+WEIGHTOF(zw2)) | \ 31 | (1 + MYMAX(DEPTHOF(zw1),DEPTHOF(zw2))) 32 | 33 | #define UPHEAP(z) \ 34 | { \ 35 | Int32 zz, tmp; \ 36 | zz = z; tmp = heap[zz]; \ 37 | while (weight[tmp] < weight[heap[zz >> 1]]) { \ 38 | heap[zz] = heap[zz >> 1]; \ 39 | zz >>= 1; \ 40 | } \ 41 | heap[zz] = tmp; \ 42 | } 43 | 44 | #define DOWNHEAP(z) \ 45 | { \ 46 | Int32 zz, yy, tmp; \ 47 | zz = z; tmp = heap[zz]; \ 48 | while (True) { \ 49 | yy = zz << 1; \ 50 | if (yy > nHeap) break; \ 51 | if (yy < nHeap && \ 52 | weight[heap[yy+1]] < weight[heap[yy]]) \ 53 | yy++; \ 54 | if (weight[tmp] < weight[heap[yy]]) break; \ 55 | heap[zz] = heap[yy]; \ 56 | zz = yy; \ 57 | } \ 58 | heap[zz] = tmp; \ 59 | } 60 | 61 | 62 | /*---------------------------------------------------*/ 63 | void BZ2_hbMakeCodeLengths ( UChar *len, 64 | Int32 *freq, 65 | Int32 alphaSize, 66 | Int32 maxLen ) 67 | { 68 | /*-- 69 | Nodes and heap entries run from 1. Entry 0 70 | for both the heap and nodes is a sentinel. 71 | --*/ 72 | Int32 nNodes, nHeap, n1, n2, i, j, k; 73 | Bool tooLong; 74 | 75 | Int32 heap [ BZ_MAX_ALPHA_SIZE + 2 ]; 76 | Int32 weight [ BZ_MAX_ALPHA_SIZE * 2 ]; 77 | Int32 parent [ BZ_MAX_ALPHA_SIZE * 2 ]; 78 | 79 | for (i = 0; i < alphaSize; i++) 80 | weight[i+1] = (freq[i] == 0 ? 1 : freq[i]) << 8; 81 | 82 | while (True) { 83 | 84 | nNodes = alphaSize; 85 | nHeap = 0; 86 | 87 | heap[0] = 0; 88 | weight[0] = 0; 89 | parent[0] = -2; 90 | 91 | for (i = 1; i <= alphaSize; i++) { 92 | parent[i] = -1; 93 | nHeap++; 94 | heap[nHeap] = i; 95 | UPHEAP(nHeap); 96 | } 97 | 98 | AssertH( nHeap < (BZ_MAX_ALPHA_SIZE+2), 2001 ); 99 | 100 | while (nHeap > 1) { 101 | n1 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1); 102 | n2 = heap[1]; heap[1] = heap[nHeap]; nHeap--; DOWNHEAP(1); 103 | nNodes++; 104 | parent[n1] = parent[n2] = nNodes; 105 | weight[nNodes] = ADDWEIGHTS(weight[n1], weight[n2]); 106 | parent[nNodes] = -1; 107 | nHeap++; 108 | heap[nHeap] = nNodes; 109 | UPHEAP(nHeap); 110 | } 111 | 112 | AssertH( nNodes < (BZ_MAX_ALPHA_SIZE * 2), 2002 ); 113 | 114 | tooLong = False; 115 | for (i = 1; i <= alphaSize; i++) { 116 | j = 0; 117 | k = i; 118 | while (parent[k] >= 0) { k = parent[k]; j++; } 119 | len[i-1] = j; 120 | if (j > maxLen) tooLong = True; 121 | } 122 | 123 | if (! tooLong) break; 124 | 125 | /* 17 Oct 04: keep-going condition for the following loop used 126 | to be 'i < alphaSize', which missed the last element, 127 | theoretically leading to the possibility of the compressor 128 | looping. However, this count-scaling step is only needed if 129 | one of the generated Huffman code words is longer than 130 | maxLen, which up to and including version 1.0.2 was 20 bits, 131 | which is extremely unlikely. In version 1.0.3 maxLen was 132 | changed to 17 bits, which has minimal effect on compression 133 | ratio, but does mean this scaling step is used from time to 134 | time, enough to verify that it works. 135 | 136 | This means that bzip2-1.0.3 and later will only produce 137 | Huffman codes with a maximum length of 17 bits. However, in 138 | order to preserve backwards compatibility with bitstreams 139 | produced by versions pre-1.0.3, the decompressor must still 140 | handle lengths of up to 20. */ 141 | 142 | for (i = 1; i <= alphaSize; i++) { 143 | j = weight[i] >> 8; 144 | j = 1 + (j / 2); 145 | weight[i] = j << 8; 146 | } 147 | } 148 | } 149 | 150 | 151 | /*---------------------------------------------------*/ 152 | void BZ2_hbAssignCodes ( Int32 *code, 153 | UChar *length, 154 | Int32 minLen, 155 | Int32 maxLen, 156 | Int32 alphaSize ) 157 | { 158 | Int32 n, vec, i; 159 | 160 | vec = 0; 161 | for (n = minLen; n <= maxLen; n++) { 162 | for (i = 0; i < alphaSize; i++) 163 | if (length[i] == n) { code[i] = vec; vec++; }; 164 | vec <<= 1; 165 | } 166 | } 167 | 168 | 169 | /*---------------------------------------------------*/ 170 | void BZ2_hbCreateDecodeTables ( Int32 *limit, 171 | Int32 *base, 172 | Int32 *perm, 173 | UChar *length, 174 | Int32 minLen, 175 | Int32 maxLen, 176 | Int32 alphaSize ) 177 | { 178 | Int32 pp, i, j, vec; 179 | 180 | pp = 0; 181 | for (i = minLen; i <= maxLen; i++) 182 | for (j = 0; j < alphaSize; j++) 183 | if (length[j] == i) { perm[pp] = j; pp++; }; 184 | 185 | for (i = 0; i < BZ_MAX_CODE_LEN; i++) base[i] = 0; 186 | for (i = 0; i < alphaSize; i++) base[length[i]+1]++; 187 | 188 | for (i = 1; i < BZ_MAX_CODE_LEN; i++) base[i] += base[i-1]; 189 | 190 | for (i = 0; i < BZ_MAX_CODE_LEN; i++) limit[i] = 0; 191 | vec = 0; 192 | 193 | for (i = minLen; i <= maxLen; i++) { 194 | vec += (base[i+1] - base[i]); 195 | limit[i] = vec-1; 196 | vec <<= 1; 197 | } 198 | for (i = minLen + 1; i <= maxLen; i++) 199 | base[i] = ((limit[i-1] + 1) << 1) - base[i]; 200 | } 201 | 202 | 203 | /*-------------------------------------------------------------*/ 204 | /*--- end huffman.c ---*/ 205 | /*-------------------------------------------------------------*/ 206 | -------------------------------------------------------------------------------- /libs/zlib/zutil.h: -------------------------------------------------------------------------------- 1 | /* zutil.h -- internal interface and configuration of the compression library 2 | * Copyright (C) 1995-2010 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* WARNING: this file should *not* be used by applications. It is 7 | part of the implementation of the compression library and is 8 | subject to change. Applications should only use zlib.h. 9 | */ 10 | 11 | /* @(#) $Id$ */ 12 | 13 | #ifndef ZUTIL_H 14 | #define ZUTIL_H 15 | 16 | #if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ) 17 | # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) 18 | #else 19 | # define ZLIB_INTERNAL 20 | #endif 21 | 22 | #include "zlib.h" 23 | 24 | #ifdef STDC 25 | # if !(defined(_WIN32_WCE) && defined(_MSC_VER)) 26 | # include 27 | # endif 28 | # include 29 | # include 30 | #endif 31 | 32 | #ifndef local 33 | # define local static 34 | #endif 35 | /* compile with -Dlocal if your debugger can't find static symbols */ 36 | 37 | typedef unsigned char uch; 38 | typedef uch FAR uchf; 39 | typedef unsigned short ush; 40 | typedef ush FAR ushf; 41 | typedef unsigned long ulg; 42 | 43 | extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */ 44 | /* (size given to avoid silly warnings with Visual C++) */ 45 | 46 | #define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)] 47 | 48 | #define ERR_RETURN(strm,err) \ 49 | return (strm->msg = (char*)ERR_MSG(err), (err)) 50 | /* To be used only when the state is known to be valid */ 51 | 52 | /* common constants */ 53 | 54 | #ifndef DEF_WBITS 55 | # define DEF_WBITS MAX_WBITS 56 | #endif 57 | /* default windowBits for decompression. MAX_WBITS is for compression only */ 58 | 59 | #if MAX_MEM_LEVEL >= 8 60 | # define DEF_MEM_LEVEL 8 61 | #else 62 | # define DEF_MEM_LEVEL MAX_MEM_LEVEL 63 | #endif 64 | /* default memLevel */ 65 | 66 | #define STORED_BLOCK 0 67 | #define STATIC_TREES 1 68 | #define DYN_TREES 2 69 | /* The three kinds of block type */ 70 | 71 | #define MIN_MATCH 3 72 | #define MAX_MATCH 258 73 | /* The minimum and maximum match lengths */ 74 | 75 | #define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ 76 | 77 | /* target dependencies */ 78 | 79 | #if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) 80 | # define OS_CODE 0x00 81 | # if defined(__TURBOC__) || defined(__BORLANDC__) 82 | # if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) 83 | /* Allow compilation with ANSI keywords only enabled */ 84 | void _Cdecl farfree( void *block ); 85 | void *_Cdecl farmalloc( unsigned long nbytes ); 86 | # else 87 | # include 88 | # endif 89 | # else /* MSC or DJGPP */ 90 | # include 91 | # endif 92 | #endif 93 | 94 | #ifdef AMIGA 95 | # define OS_CODE 0x01 96 | #endif 97 | 98 | #if defined(VAXC) || defined(VMS) 99 | # define OS_CODE 0x02 100 | # define F_OPEN(name, mode) \ 101 | fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") 102 | #endif 103 | 104 | #if defined(ATARI) || defined(atarist) 105 | # define OS_CODE 0x05 106 | #endif 107 | 108 | #ifdef OS2 109 | # define OS_CODE 0x06 110 | # ifdef M_I86 111 | # include 112 | # endif 113 | #endif 114 | 115 | #if defined(MACOS) || defined(TARGET_OS_MAC) 116 | # define OS_CODE 0x07 117 | # if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os 118 | # include /* for fdopen */ 119 | # else 120 | # ifndef fdopen 121 | # define fdopen(fd,mode) NULL /* No fdopen() */ 122 | # endif 123 | # endif 124 | #endif 125 | 126 | #ifdef TOPS20 127 | # define OS_CODE 0x0a 128 | #endif 129 | 130 | #ifdef WIN32 131 | # ifndef __CYGWIN__ /* Cygwin is Unix, not Win32 */ 132 | # define OS_CODE 0x0b 133 | # endif 134 | #endif 135 | 136 | #ifdef __50SERIES /* Prime/PRIMOS */ 137 | # define OS_CODE 0x0f 138 | #endif 139 | 140 | #if defined(_BEOS_) || defined(RISCOS) 141 | # define fdopen(fd,mode) NULL /* No fdopen() */ 142 | #endif 143 | 144 | #if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX 145 | # if defined(_WIN32_WCE) 146 | # define fdopen(fd,mode) NULL /* No fdopen() */ 147 | # ifndef _PTRDIFF_T_DEFINED 148 | typedef int ptrdiff_t; 149 | # define _PTRDIFF_T_DEFINED 150 | # endif 151 | # else 152 | # define fdopen(fd,type) _fdopen(fd,type) 153 | # endif 154 | #endif 155 | 156 | #if defined(__BORLANDC__) 157 | #pragma warn -8004 158 | #pragma warn -8008 159 | #pragma warn -8066 160 | #endif 161 | 162 | /* provide prototypes for these when building zlib without LFS */ 163 | #if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 164 | ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); 165 | ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); 166 | #endif 167 | 168 | /* common defaults */ 169 | 170 | #ifndef OS_CODE 171 | # define OS_CODE 0x03 /* assume Unix */ 172 | #endif 173 | 174 | #ifndef F_OPEN 175 | # define F_OPEN(name, mode) fopen((name), (mode)) 176 | #endif 177 | 178 | /* functions */ 179 | 180 | #if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550) 181 | # ifndef HAVE_VSNPRINTF 182 | # define HAVE_VSNPRINTF 183 | # endif 184 | #endif 185 | #if defined(__CYGWIN__) 186 | # ifndef HAVE_VSNPRINTF 187 | # define HAVE_VSNPRINTF 188 | # endif 189 | #endif 190 | #ifndef HAVE_VSNPRINTF 191 | # ifdef MSDOS 192 | /* vsnprintf may exist on some MS-DOS compilers (DJGPP?), 193 | but for now we just assume it doesn't. */ 194 | # define NO_vsnprintf 195 | # endif 196 | # ifdef __TURBOC__ 197 | # define NO_vsnprintf 198 | # endif 199 | # ifdef WIN32 200 | /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ 201 | # if !defined(vsnprintf) && !defined(NO_vsnprintf) 202 | # if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 ) 203 | # define vsnprintf _vsnprintf 204 | # endif 205 | # endif 206 | # endif 207 | # ifdef __SASC 208 | # define NO_vsnprintf 209 | # endif 210 | #endif 211 | #ifdef VMS 212 | # define NO_vsnprintf 213 | #endif 214 | 215 | #if defined(pyr) 216 | # define NO_MEMCPY 217 | #endif 218 | #if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__) 219 | /* Use our own functions for small and medium model with MSC <= 5.0. 220 | * You may have to use the same strategy for Borland C (untested). 221 | * The __SC__ check is for Symantec. 222 | */ 223 | # define NO_MEMCPY 224 | #endif 225 | #if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY) 226 | # define HAVE_MEMCPY 227 | #endif 228 | #ifdef HAVE_MEMCPY 229 | # ifdef SMALL_MEDIUM /* MSDOS small or medium model */ 230 | # define zmemcpy _fmemcpy 231 | # define zmemcmp _fmemcmp 232 | # define zmemzero(dest, len) _fmemset(dest, 0, len) 233 | # else 234 | # define zmemcpy memcpy 235 | # define zmemcmp memcmp 236 | # define zmemzero(dest, len) memset(dest, 0, len) 237 | # endif 238 | #else 239 | void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); 240 | int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); 241 | void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len)); 242 | #endif 243 | 244 | /* Diagnostic functions */ 245 | #ifdef DEBUG 246 | # include 247 | extern int ZLIB_INTERNAL z_verbose; 248 | extern void ZLIB_INTERNAL z_error OF((char *m)); 249 | # define Assert(cond,msg) {if(!(cond)) z_error(msg);} 250 | # define Trace(x) {if (z_verbose>=0) fprintf x ;} 251 | # define Tracev(x) {if (z_verbose>0) fprintf x ;} 252 | # define Tracevv(x) {if (z_verbose>1) fprintf x ;} 253 | # define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} 254 | # define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} 255 | #else 256 | # define Assert(cond,msg) 257 | # define Trace(x) 258 | # define Tracev(x) 259 | # define Tracevv(x) 260 | # define Tracec(c,x) 261 | # define Tracecv(c,x) 262 | #endif 263 | 264 | 265 | voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items, 266 | unsigned size)); 267 | void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr)); 268 | 269 | #define ZALLOC(strm, items, size) \ 270 | (*((strm)->zalloc))((strm)->opaque, (items), (size)) 271 | #define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr)) 272 | #define TRY_FREE(s, p) {if (p) ZFREE(s, p);} 273 | 274 | #endif /* ZUTIL_H */ 275 | -------------------------------------------------------------------------------- /libs/zlib/contrib/minizip/ioapi.c: -------------------------------------------------------------------------------- 1 | /* ioapi.h -- IO base function header for compress/uncompress .zip 2 | part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) 3 | 4 | Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) 5 | 6 | Modifications for Zip64 support 7 | Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) 8 | 9 | For more info read MiniZip_info.txt 10 | 11 | */ 12 | 13 | #if (defined(_WIN32)) 14 | #define _CRT_SECURE_NO_WARNINGS 15 | #endif 16 | 17 | #include "ioapi.h" 18 | 19 | voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode) 20 | { 21 | if (pfilefunc->zfile_func64.zopen64_file != NULL) 22 | return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode); 23 | else 24 | { 25 | return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode); 26 | } 27 | } 28 | 29 | long call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin) 30 | { 31 | if (pfilefunc->zfile_func64.zseek64_file != NULL) 32 | return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin); 33 | else 34 | { 35 | uLong offsetTruncated = (uLong)offset; 36 | if (offsetTruncated != offset) 37 | return -1; 38 | else 39 | return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin); 40 | } 41 | } 42 | 43 | ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream) 44 | { 45 | if (pfilefunc->zfile_func64.zseek64_file != NULL) 46 | return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream); 47 | else 48 | { 49 | uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream); 50 | if ((tell_uLong) == ((uLong)-1)) 51 | return (ZPOS64_T)-1; 52 | else 53 | return tell_uLong; 54 | } 55 | } 56 | 57 | void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32) 58 | { 59 | p_filefunc64_32->zfile_func64.zopen64_file = NULL; 60 | p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file; 61 | p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; 62 | p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file; 63 | p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file; 64 | p_filefunc64_32->zfile_func64.ztell64_file = NULL; 65 | p_filefunc64_32->zfile_func64.zseek64_file = NULL; 66 | p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file; 67 | p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; 68 | p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque; 69 | p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file; 70 | p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file; 71 | } 72 | 73 | 74 | 75 | static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode)); 76 | static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size)); 77 | static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size)); 78 | static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream)); 79 | static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); 80 | static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream)); 81 | static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream)); 82 | 83 | static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode) 84 | { 85 | FILE* file = NULL; 86 | const char* mode_fopen = NULL; 87 | if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) 88 | mode_fopen = "rb"; 89 | else 90 | if (mode & ZLIB_FILEFUNC_MODE_EXISTING) 91 | mode_fopen = "r+b"; 92 | else 93 | if (mode & ZLIB_FILEFUNC_MODE_CREATE) 94 | mode_fopen = "wb"; 95 | 96 | if ((filename!=NULL) && (mode_fopen != NULL)) 97 | file = fopen(filename, mode_fopen); 98 | return file; 99 | } 100 | 101 | static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode) 102 | { 103 | FILE* file = NULL; 104 | const char* mode_fopen = NULL; 105 | if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) 106 | mode_fopen = "rb"; 107 | else 108 | if (mode & ZLIB_FILEFUNC_MODE_EXISTING) 109 | mode_fopen = "r+b"; 110 | else 111 | if (mode & ZLIB_FILEFUNC_MODE_CREATE) 112 | mode_fopen = "wb"; 113 | 114 | if ((filename!=NULL) && (mode_fopen != NULL)) 115 | file = fopen64((const char*)filename, mode_fopen); 116 | return file; 117 | } 118 | 119 | 120 | static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size) 121 | { 122 | uLong ret; 123 | ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); 124 | return ret; 125 | } 126 | 127 | static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size) 128 | { 129 | uLong ret; 130 | ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); 131 | return ret; 132 | } 133 | 134 | static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) 135 | { 136 | long ret; 137 | ret = ftell((FILE *)stream); 138 | return ret; 139 | } 140 | 141 | 142 | static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream) 143 | { 144 | ZPOS64_T ret; 145 | ret = ftello64((FILE *)stream); 146 | return ret; 147 | } 148 | 149 | static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin) 150 | { 151 | int fseek_origin=0; 152 | long ret; 153 | switch (origin) 154 | { 155 | case ZLIB_FILEFUNC_SEEK_CUR : 156 | fseek_origin = SEEK_CUR; 157 | break; 158 | case ZLIB_FILEFUNC_SEEK_END : 159 | fseek_origin = SEEK_END; 160 | break; 161 | case ZLIB_FILEFUNC_SEEK_SET : 162 | fseek_origin = SEEK_SET; 163 | break; 164 | default: return -1; 165 | } 166 | ret = 0; 167 | if (fseek((FILE *)stream, offset, fseek_origin) != 0) 168 | ret = -1; 169 | return ret; 170 | } 171 | 172 | static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) 173 | { 174 | int fseek_origin=0; 175 | long ret; 176 | switch (origin) 177 | { 178 | case ZLIB_FILEFUNC_SEEK_CUR : 179 | fseek_origin = SEEK_CUR; 180 | break; 181 | case ZLIB_FILEFUNC_SEEK_END : 182 | fseek_origin = SEEK_END; 183 | break; 184 | case ZLIB_FILEFUNC_SEEK_SET : 185 | fseek_origin = SEEK_SET; 186 | break; 187 | default: return -1; 188 | } 189 | ret = 0; 190 | 191 | if(fseeko64((FILE *)stream, offset, fseek_origin) != 0) 192 | ret = -1; 193 | 194 | return ret; 195 | } 196 | 197 | 198 | static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream) 199 | { 200 | int ret; 201 | ret = fclose((FILE *)stream); 202 | return ret; 203 | } 204 | 205 | static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream) 206 | { 207 | int ret; 208 | ret = ferror((FILE *)stream); 209 | return ret; 210 | } 211 | 212 | void fill_fopen_filefunc (pzlib_filefunc_def) 213 | zlib_filefunc_def* pzlib_filefunc_def; 214 | { 215 | pzlib_filefunc_def->zopen_file = fopen_file_func; 216 | pzlib_filefunc_def->zread_file = fread_file_func; 217 | pzlib_filefunc_def->zwrite_file = fwrite_file_func; 218 | pzlib_filefunc_def->ztell_file = ftell_file_func; 219 | pzlib_filefunc_def->zseek_file = fseek_file_func; 220 | pzlib_filefunc_def->zclose_file = fclose_file_func; 221 | pzlib_filefunc_def->zerror_file = ferror_file_func; 222 | pzlib_filefunc_def->opaque = NULL; 223 | } 224 | 225 | void fill_fopen64_filefunc (zlib_filefunc64_def* pzlib_filefunc_def) 226 | { 227 | pzlib_filefunc_def->zopen64_file = fopen64_file_func; 228 | pzlib_filefunc_def->zread_file = fread_file_func; 229 | pzlib_filefunc_def->zwrite_file = fwrite_file_func; 230 | pzlib_filefunc_def->ztell64_file = ftell64_file_func; 231 | pzlib_filefunc_def->zseek64_file = fseek64_file_func; 232 | pzlib_filefunc_def->zclose_file = fclose_file_func; 233 | pzlib_filefunc_def->zerror_file = ferror_file_func; 234 | pzlib_filefunc_def->opaque = NULL; 235 | } 236 | -------------------------------------------------------------------------------- /libs/zlib/zutil.c: -------------------------------------------------------------------------------- 1 | /* zutil.c -- target dependent utility functions for the compression library 2 | * Copyright (C) 1995-2005, 2010 Jean-loup Gailly. 3 | * For conditions of distribution and use, see copyright notice in zlib.h 4 | */ 5 | 6 | /* @(#) $Id$ */ 7 | 8 | #include "zutil.h" 9 | 10 | #ifndef NO_DUMMY_DECL 11 | struct internal_state {int dummy;}; /* for buggy compilers */ 12 | #endif 13 | 14 | const char * const z_errmsg[10] = { 15 | "need dictionary", /* Z_NEED_DICT 2 */ 16 | "stream end", /* Z_STREAM_END 1 */ 17 | "", /* Z_OK 0 */ 18 | "file error", /* Z_ERRNO (-1) */ 19 | "stream error", /* Z_STREAM_ERROR (-2) */ 20 | "data error", /* Z_DATA_ERROR (-3) */ 21 | "insufficient memory", /* Z_MEM_ERROR (-4) */ 22 | "buffer error", /* Z_BUF_ERROR (-5) */ 23 | "incompatible version",/* Z_VERSION_ERROR (-6) */ 24 | ""}; 25 | 26 | 27 | const char * ZEXPORT zlibVersion() 28 | { 29 | return ZLIB_VERSION; 30 | } 31 | 32 | uLong ZEXPORT zlibCompileFlags() 33 | { 34 | uLong flags; 35 | 36 | flags = 0; 37 | switch ((int)(sizeof(uInt))) { 38 | case 2: break; 39 | case 4: flags += 1; break; 40 | case 8: flags += 2; break; 41 | default: flags += 3; 42 | } 43 | switch ((int)(sizeof(uLong))) { 44 | case 2: break; 45 | case 4: flags += 1 << 2; break; 46 | case 8: flags += 2 << 2; break; 47 | default: flags += 3 << 2; 48 | } 49 | switch ((int)(sizeof(voidpf))) { 50 | case 2: break; 51 | case 4: flags += 1 << 4; break; 52 | case 8: flags += 2 << 4; break; 53 | default: flags += 3 << 4; 54 | } 55 | switch ((int)(sizeof(z_off_t))) { 56 | case 2: break; 57 | case 4: flags += 1 << 6; break; 58 | case 8: flags += 2 << 6; break; 59 | default: flags += 3 << 6; 60 | } 61 | #ifdef DEBUG 62 | flags += 1 << 8; 63 | #endif 64 | #if defined(ASMV) || defined(ASMINF) 65 | flags += 1 << 9; 66 | #endif 67 | #ifdef ZLIB_WINAPI 68 | flags += 1 << 10; 69 | #endif 70 | #ifdef BUILDFIXED 71 | flags += 1 << 12; 72 | #endif 73 | #ifdef DYNAMIC_CRC_TABLE 74 | flags += 1 << 13; 75 | #endif 76 | #ifdef NO_GZCOMPRESS 77 | flags += 1L << 16; 78 | #endif 79 | #ifdef NO_GZIP 80 | flags += 1L << 17; 81 | #endif 82 | #ifdef PKZIP_BUG_WORKAROUND 83 | flags += 1L << 20; 84 | #endif 85 | #ifdef FASTEST 86 | flags += 1L << 21; 87 | #endif 88 | #ifdef STDC 89 | # ifdef NO_vsnprintf 90 | flags += 1L << 25; 91 | # ifdef HAS_vsprintf_void 92 | flags += 1L << 26; 93 | # endif 94 | # else 95 | # ifdef HAS_vsnprintf_void 96 | flags += 1L << 26; 97 | # endif 98 | # endif 99 | #else 100 | flags += 1L << 24; 101 | # ifdef NO_snprintf 102 | flags += 1L << 25; 103 | # ifdef HAS_sprintf_void 104 | flags += 1L << 26; 105 | # endif 106 | # else 107 | # ifdef HAS_snprintf_void 108 | flags += 1L << 26; 109 | # endif 110 | # endif 111 | #endif 112 | return flags; 113 | } 114 | 115 | #ifdef DEBUG 116 | 117 | # ifndef verbose 118 | # define verbose 0 119 | # endif 120 | int ZLIB_INTERNAL z_verbose = verbose; 121 | 122 | void ZLIB_INTERNAL z_error (m) 123 | char *m; 124 | { 125 | fprintf(stderr, "%s\n", m); 126 | exit(1); 127 | } 128 | #endif 129 | 130 | /* exported to allow conversion of error code to string for compress() and 131 | * uncompress() 132 | */ 133 | const char * ZEXPORT zError(err) 134 | int err; 135 | { 136 | return ERR_MSG(err); 137 | } 138 | 139 | #if defined(_WIN32_WCE) 140 | /* The Microsoft C Run-Time Library for Windows CE doesn't have 141 | * errno. We define it as a global variable to simplify porting. 142 | * Its value is always 0 and should not be used. 143 | */ 144 | int errno = 0; 145 | #endif 146 | 147 | #ifndef HAVE_MEMCPY 148 | 149 | void ZLIB_INTERNAL zmemcpy(dest, source, len) 150 | Bytef* dest; 151 | const Bytef* source; 152 | uInt len; 153 | { 154 | if (len == 0) return; 155 | do { 156 | *dest++ = *source++; /* ??? to be unrolled */ 157 | } while (--len != 0); 158 | } 159 | 160 | int ZLIB_INTERNAL zmemcmp(s1, s2, len) 161 | const Bytef* s1; 162 | const Bytef* s2; 163 | uInt len; 164 | { 165 | uInt j; 166 | 167 | for (j = 0; j < len; j++) { 168 | if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; 169 | } 170 | return 0; 171 | } 172 | 173 | void ZLIB_INTERNAL zmemzero(dest, len) 174 | Bytef* dest; 175 | uInt len; 176 | { 177 | if (len == 0) return; 178 | do { 179 | *dest++ = 0; /* ??? to be unrolled */ 180 | } while (--len != 0); 181 | } 182 | #endif 183 | 184 | 185 | #ifdef SYS16BIT 186 | 187 | #ifdef __TURBOC__ 188 | /* Turbo C in 16-bit mode */ 189 | 190 | # define MY_ZCALLOC 191 | 192 | /* Turbo C malloc() does not allow dynamic allocation of 64K bytes 193 | * and farmalloc(64K) returns a pointer with an offset of 8, so we 194 | * must fix the pointer. Warning: the pointer must be put back to its 195 | * original form in order to free it, use zcfree(). 196 | */ 197 | 198 | #define MAX_PTR 10 199 | /* 10*64K = 640K */ 200 | 201 | local int next_ptr = 0; 202 | 203 | typedef struct ptr_table_s { 204 | voidpf org_ptr; 205 | voidpf new_ptr; 206 | } ptr_table; 207 | 208 | local ptr_table table[MAX_PTR]; 209 | /* This table is used to remember the original form of pointers 210 | * to large buffers (64K). Such pointers are normalized with a zero offset. 211 | * Since MSDOS is not a preemptive multitasking OS, this table is not 212 | * protected from concurrent access. This hack doesn't work anyway on 213 | * a protected system like OS/2. Use Microsoft C instead. 214 | */ 215 | 216 | voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size) 217 | { 218 | voidpf buf = opaque; /* just to make some compilers happy */ 219 | ulg bsize = (ulg)items*size; 220 | 221 | /* If we allocate less than 65520 bytes, we assume that farmalloc 222 | * will return a usable pointer which doesn't have to be normalized. 223 | */ 224 | if (bsize < 65520L) { 225 | buf = farmalloc(bsize); 226 | if (*(ush*)&buf != 0) return buf; 227 | } else { 228 | buf = farmalloc(bsize + 16L); 229 | } 230 | if (buf == NULL || next_ptr >= MAX_PTR) return NULL; 231 | table[next_ptr].org_ptr = buf; 232 | 233 | /* Normalize the pointer to seg:0 */ 234 | *((ush*)&buf+1) += ((ush)((uch*)buf-0) + 15) >> 4; 235 | *(ush*)&buf = 0; 236 | table[next_ptr++].new_ptr = buf; 237 | return buf; 238 | } 239 | 240 | void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) 241 | { 242 | int n; 243 | if (*(ush*)&ptr != 0) { /* object < 64K */ 244 | farfree(ptr); 245 | return; 246 | } 247 | /* Find the original pointer */ 248 | for (n = 0; n < next_ptr; n++) { 249 | if (ptr != table[n].new_ptr) continue; 250 | 251 | farfree(table[n].org_ptr); 252 | while (++n < next_ptr) { 253 | table[n-1] = table[n]; 254 | } 255 | next_ptr--; 256 | return; 257 | } 258 | ptr = opaque; /* just to make some compilers happy */ 259 | Assert(0, "zcfree: ptr not found"); 260 | } 261 | 262 | #endif /* __TURBOC__ */ 263 | 264 | 265 | #ifdef M_I86 266 | /* Microsoft C in 16-bit mode */ 267 | 268 | # define MY_ZCALLOC 269 | 270 | #if (!defined(_MSC_VER) || (_MSC_VER <= 600)) 271 | # define _halloc halloc 272 | # define _hfree hfree 273 | #endif 274 | 275 | voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size) 276 | { 277 | if (opaque) opaque = 0; /* to make compiler happy */ 278 | return _halloc((long)items, size); 279 | } 280 | 281 | void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr) 282 | { 283 | if (opaque) opaque = 0; /* to make compiler happy */ 284 | _hfree(ptr); 285 | } 286 | 287 | #endif /* M_I86 */ 288 | 289 | #endif /* SYS16BIT */ 290 | 291 | 292 | #ifndef MY_ZCALLOC /* Any system without a special alloc function */ 293 | 294 | #ifndef STDC 295 | extern voidp malloc OF((uInt size)); 296 | extern voidp calloc OF((uInt items, uInt size)); 297 | extern void free OF((voidpf ptr)); 298 | #endif 299 | 300 | voidpf ZLIB_INTERNAL zcalloc (opaque, items, size) 301 | voidpf opaque; 302 | unsigned items; 303 | unsigned size; 304 | { 305 | if (opaque) items += size - size; /* make compiler happy */ 306 | return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) : 307 | (voidpf)calloc(items, size); 308 | } 309 | 310 | void ZLIB_INTERNAL zcfree (opaque, ptr) 311 | voidpf opaque; 312 | voidpf ptr; 313 | { 314 | free(ptr); 315 | if (opaque) return; /* make compiler happy */ 316 | } 317 | 318 | #endif /* MY_ZCALLOC */ 319 | -------------------------------------------------------------------------------- /libs/zlib/trees.h: -------------------------------------------------------------------------------- 1 | /* header created automatically with -DGEN_TREES_H */ 2 | 3 | local const ct_data static_ltree[L_CODES+2] = { 4 | {{ 12},{ 8}}, {{140},{ 8}}, {{ 76},{ 8}}, {{204},{ 8}}, {{ 44},{ 8}}, 5 | {{172},{ 8}}, {{108},{ 8}}, {{236},{ 8}}, {{ 28},{ 8}}, {{156},{ 8}}, 6 | {{ 92},{ 8}}, {{220},{ 8}}, {{ 60},{ 8}}, {{188},{ 8}}, {{124},{ 8}}, 7 | {{252},{ 8}}, {{ 2},{ 8}}, {{130},{ 8}}, {{ 66},{ 8}}, {{194},{ 8}}, 8 | {{ 34},{ 8}}, {{162},{ 8}}, {{ 98},{ 8}}, {{226},{ 8}}, {{ 18},{ 8}}, 9 | {{146},{ 8}}, {{ 82},{ 8}}, {{210},{ 8}}, {{ 50},{ 8}}, {{178},{ 8}}, 10 | {{114},{ 8}}, {{242},{ 8}}, {{ 10},{ 8}}, {{138},{ 8}}, {{ 74},{ 8}}, 11 | {{202},{ 8}}, {{ 42},{ 8}}, {{170},{ 8}}, {{106},{ 8}}, {{234},{ 8}}, 12 | {{ 26},{ 8}}, {{154},{ 8}}, {{ 90},{ 8}}, {{218},{ 8}}, {{ 58},{ 8}}, 13 | {{186},{ 8}}, {{122},{ 8}}, {{250},{ 8}}, {{ 6},{ 8}}, {{134},{ 8}}, 14 | {{ 70},{ 8}}, {{198},{ 8}}, {{ 38},{ 8}}, {{166},{ 8}}, {{102},{ 8}}, 15 | {{230},{ 8}}, {{ 22},{ 8}}, {{150},{ 8}}, {{ 86},{ 8}}, {{214},{ 8}}, 16 | {{ 54},{ 8}}, {{182},{ 8}}, {{118},{ 8}}, {{246},{ 8}}, {{ 14},{ 8}}, 17 | {{142},{ 8}}, {{ 78},{ 8}}, {{206},{ 8}}, {{ 46},{ 8}}, {{174},{ 8}}, 18 | {{110},{ 8}}, {{238},{ 8}}, {{ 30},{ 8}}, {{158},{ 8}}, {{ 94},{ 8}}, 19 | {{222},{ 8}}, {{ 62},{ 8}}, {{190},{ 8}}, {{126},{ 8}}, {{254},{ 8}}, 20 | {{ 1},{ 8}}, {{129},{ 8}}, {{ 65},{ 8}}, {{193},{ 8}}, {{ 33},{ 8}}, 21 | {{161},{ 8}}, {{ 97},{ 8}}, {{225},{ 8}}, {{ 17},{ 8}}, {{145},{ 8}}, 22 | {{ 81},{ 8}}, {{209},{ 8}}, {{ 49},{ 8}}, {{177},{ 8}}, {{113},{ 8}}, 23 | {{241},{ 8}}, {{ 9},{ 8}}, {{137},{ 8}}, {{ 73},{ 8}}, {{201},{ 8}}, 24 | {{ 41},{ 8}}, {{169},{ 8}}, {{105},{ 8}}, {{233},{ 8}}, {{ 25},{ 8}}, 25 | {{153},{ 8}}, {{ 89},{ 8}}, {{217},{ 8}}, {{ 57},{ 8}}, {{185},{ 8}}, 26 | {{121},{ 8}}, {{249},{ 8}}, {{ 5},{ 8}}, {{133},{ 8}}, {{ 69},{ 8}}, 27 | {{197},{ 8}}, {{ 37},{ 8}}, {{165},{ 8}}, {{101},{ 8}}, {{229},{ 8}}, 28 | {{ 21},{ 8}}, {{149},{ 8}}, {{ 85},{ 8}}, {{213},{ 8}}, {{ 53},{ 8}}, 29 | {{181},{ 8}}, {{117},{ 8}}, {{245},{ 8}}, {{ 13},{ 8}}, {{141},{ 8}}, 30 | {{ 77},{ 8}}, {{205},{ 8}}, {{ 45},{ 8}}, {{173},{ 8}}, {{109},{ 8}}, 31 | {{237},{ 8}}, {{ 29},{ 8}}, {{157},{ 8}}, {{ 93},{ 8}}, {{221},{ 8}}, 32 | {{ 61},{ 8}}, {{189},{ 8}}, {{125},{ 8}}, {{253},{ 8}}, {{ 19},{ 9}}, 33 | {{275},{ 9}}, {{147},{ 9}}, {{403},{ 9}}, {{ 83},{ 9}}, {{339},{ 9}}, 34 | {{211},{ 9}}, {{467},{ 9}}, {{ 51},{ 9}}, {{307},{ 9}}, {{179},{ 9}}, 35 | {{435},{ 9}}, {{115},{ 9}}, {{371},{ 9}}, {{243},{ 9}}, {{499},{ 9}}, 36 | {{ 11},{ 9}}, {{267},{ 9}}, {{139},{ 9}}, {{395},{ 9}}, {{ 75},{ 9}}, 37 | {{331},{ 9}}, {{203},{ 9}}, {{459},{ 9}}, {{ 43},{ 9}}, {{299},{ 9}}, 38 | {{171},{ 9}}, {{427},{ 9}}, {{107},{ 9}}, {{363},{ 9}}, {{235},{ 9}}, 39 | {{491},{ 9}}, {{ 27},{ 9}}, {{283},{ 9}}, {{155},{ 9}}, {{411},{ 9}}, 40 | {{ 91},{ 9}}, {{347},{ 9}}, {{219},{ 9}}, {{475},{ 9}}, {{ 59},{ 9}}, 41 | {{315},{ 9}}, {{187},{ 9}}, {{443},{ 9}}, {{123},{ 9}}, {{379},{ 9}}, 42 | {{251},{ 9}}, {{507},{ 9}}, {{ 7},{ 9}}, {{263},{ 9}}, {{135},{ 9}}, 43 | {{391},{ 9}}, {{ 71},{ 9}}, {{327},{ 9}}, {{199},{ 9}}, {{455},{ 9}}, 44 | {{ 39},{ 9}}, {{295},{ 9}}, {{167},{ 9}}, {{423},{ 9}}, {{103},{ 9}}, 45 | {{359},{ 9}}, {{231},{ 9}}, {{487},{ 9}}, {{ 23},{ 9}}, {{279},{ 9}}, 46 | {{151},{ 9}}, {{407},{ 9}}, {{ 87},{ 9}}, {{343},{ 9}}, {{215},{ 9}}, 47 | {{471},{ 9}}, {{ 55},{ 9}}, {{311},{ 9}}, {{183},{ 9}}, {{439},{ 9}}, 48 | {{119},{ 9}}, {{375},{ 9}}, {{247},{ 9}}, {{503},{ 9}}, {{ 15},{ 9}}, 49 | {{271},{ 9}}, {{143},{ 9}}, {{399},{ 9}}, {{ 79},{ 9}}, {{335},{ 9}}, 50 | {{207},{ 9}}, {{463},{ 9}}, {{ 47},{ 9}}, {{303},{ 9}}, {{175},{ 9}}, 51 | {{431},{ 9}}, {{111},{ 9}}, {{367},{ 9}}, {{239},{ 9}}, {{495},{ 9}}, 52 | {{ 31},{ 9}}, {{287},{ 9}}, {{159},{ 9}}, {{415},{ 9}}, {{ 95},{ 9}}, 53 | {{351},{ 9}}, {{223},{ 9}}, {{479},{ 9}}, {{ 63},{ 9}}, {{319},{ 9}}, 54 | {{191},{ 9}}, {{447},{ 9}}, {{127},{ 9}}, {{383},{ 9}}, {{255},{ 9}}, 55 | {{511},{ 9}}, {{ 0},{ 7}}, {{ 64},{ 7}}, {{ 32},{ 7}}, {{ 96},{ 7}}, 56 | {{ 16},{ 7}}, {{ 80},{ 7}}, {{ 48},{ 7}}, {{112},{ 7}}, {{ 8},{ 7}}, 57 | {{ 72},{ 7}}, {{ 40},{ 7}}, {{104},{ 7}}, {{ 24},{ 7}}, {{ 88},{ 7}}, 58 | {{ 56},{ 7}}, {{120},{ 7}}, {{ 4},{ 7}}, {{ 68},{ 7}}, {{ 36},{ 7}}, 59 | {{100},{ 7}}, {{ 20},{ 7}}, {{ 84},{ 7}}, {{ 52},{ 7}}, {{116},{ 7}}, 60 | {{ 3},{ 8}}, {{131},{ 8}}, {{ 67},{ 8}}, {{195},{ 8}}, {{ 35},{ 8}}, 61 | {{163},{ 8}}, {{ 99},{ 8}}, {{227},{ 8}} 62 | }; 63 | 64 | local const ct_data static_dtree[D_CODES] = { 65 | {{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}}, 66 | {{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}}, 67 | {{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}}, 68 | {{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}}, 69 | {{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}}, 70 | {{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}} 71 | }; 72 | 73 | const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = { 74 | 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 75 | 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 76 | 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 77 | 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 78 | 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 79 | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 80 | 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 81 | 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 82 | 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 83 | 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 84 | 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 85 | 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 86 | 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, 87 | 18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 88 | 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 89 | 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 90 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 91 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 92 | 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 93 | 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 94 | 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 95 | 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 96 | 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 97 | 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 98 | 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 99 | 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 100 | }; 101 | 102 | const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= { 103 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 104 | 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 105 | 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 106 | 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 107 | 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 108 | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 109 | 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 110 | 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 111 | 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 112 | 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 113 | 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 114 | 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 115 | 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28 116 | }; 117 | 118 | local const int base_length[LENGTH_CODES] = { 119 | 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 120 | 64, 80, 96, 112, 128, 160, 192, 224, 0 121 | }; 122 | 123 | local const int base_dist[D_CODES] = { 124 | 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 125 | 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 126 | 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576 127 | }; 128 | 129 | -------------------------------------------------------------------------------- /libs/unrarlib/unrarlib.h: -------------------------------------------------------------------------------- 1 | /* *************************************************************************** 2 | ** 3 | ** This file is part of the UniquE RAR File Library. 4 | ** 5 | ** Copyright (C) 2000-2002 by Christian Scheurer (www.ChristianScheurer.ch) 6 | ** UNIX port copyright (c) 2000-2002 by Johannes Winkelmann (jw@tks6.net) 7 | ** 8 | ** The contents of this file are subject to the UniquE RAR File Library 9 | ** License (the "unrarlib-license.txt"). You may not use this file except 10 | ** in compliance with the License. You may obtain a copy of the License 11 | ** at http://www.unrarlib.org/license.html. 12 | ** Software distributed under the License is distributed on an "AS IS" 13 | ** basis, WITHOUT WARRANTY OF ANY KIND, either express or implied warranty. 14 | ** 15 | ** Alternatively, the contents of this file may be used under the terms 16 | ** of the GNU General Public License Version 2 or later (the "GPL"), in 17 | ** which case the provisions of the GPL are applicable instead of those 18 | ** above. If you wish to allow use of your version of this file only 19 | ** under the terms of the GPL and not to allow others to use your version 20 | ** of this file under the terms of the UniquE RAR File Library License, 21 | ** indicate your decision by deleting the provisions above and replace 22 | ** them with the notice and other provisions required by the GPL. If you 23 | ** do not delete the provisions above, a recipient may use your version 24 | ** of this file under the terms of the GPL or the UniquE RAR File Library 25 | ** License. 26 | ** 27 | ************************************************************************** */ 28 | 29 | /* include file for the "UniquE RAR File Library" */ 30 | /* (C) 2000-2002 by Christian Scheurer aka. UniquE */ 31 | /* multi-OS version (Win32, Linux and SUN) */ 32 | 33 | #ifndef __URARLIB_H 34 | #define __URARLIB_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" 38 | { 39 | #endif 40 | 41 | 42 | /* ************************************************************************ */ 43 | /* ************************************************************************ */ 44 | /* ** ** */ 45 | /* ** CONFIGURATION of the UniquE RAR FileLib ** */ 46 | /* ** ==> you may change the setting for the lib HERE! ** */ 47 | /* ** ** */ 48 | /* ************************************************************************ */ 49 | /* ************************************************************************ */ 50 | 51 | 52 | #define _DEBUG_LOG /* generate debug messages */ 53 | 54 | #define _DO_CRC32_CHECK /* perform cyclical redundancy */ 55 | /* check (CRC32) - disable this */ 56 | /* for a little speed-up */ 57 | /*#define _USE_ASM*/ /* 58 | * enable assembly extensions 59 | * x86 cpus. 60 | */ 61 | 62 | /*#define _USE_MEMORY_TO_MEMORY_DECOMPRESSION*/ /* read file from memory or a */ 63 | /* resource instead of reading */ 64 | /* from a file. NOTE: you wont't*/ 65 | /* be able to decompress from */ 66 | /* file if you enable this */ 67 | /* option! */ 68 | 69 | 70 | #ifdef WIN32 /* autodetect Win32 and Linux */ 71 | #define _WIN_32 /* Win32 with VisualC */ 72 | #define _DEBUG_LOG_FILE "C:\\temp\\debug_unrar.txt" /* log file path */ 73 | #else 74 | #define _UNIX /* Linux or Unix with GCC */ 75 | #define _DEBUG_LOG_FILE "/tmp/debug_unrar.txt" /* log file path */ 76 | /*#define NON_INTEL_BYTE_ORDER*/ /* GCC on motorola systems */ 77 | 78 | #endif 79 | 80 | /* ------------------------------------------------------------------------ */ 81 | 82 | 83 | 84 | /* -- global type definitions --------------------------------------------- */ 85 | 86 | #ifdef NON_INTEL_BYTE_ORDER 87 | #ifdef _USE_ASM 88 | #warning Disabling assembly because NON_INTEL_BYTE_ORDER is set 89 | #undef _USE_ASM 90 | #endif 91 | #endif 92 | 93 | #ifdef _WIN_32 94 | typedef unsigned char UBYTE; /* WIN32 definitions */ 95 | typedef unsigned short UWORD; 96 | typedef unsigned long UDWORD; 97 | #endif 98 | 99 | #ifdef _UNIX /* LINUX/UNIX definitions */ 100 | typedef unsigned char UBYTE; 101 | typedef unsigned short UWORD; 102 | typedef unsigned long UDWORD; 103 | #endif 104 | 105 | 106 | /* This structure is used for listing archive content */ 107 | struct RAR20_archive_entry /* These infos about files are */ 108 | { /* stored in RAR v2.0 archives */ 109 | char *Name; 110 | UWORD NameSize; 111 | UDWORD PackSize; 112 | UDWORD UnpSize; 113 | UBYTE HostOS; /* MSDOS=0,OS2=1,WIN32=2,UNIX=3 */ 114 | UDWORD FileCRC; 115 | UDWORD FileTime; 116 | UBYTE UnpVer; 117 | UBYTE Method; 118 | UDWORD FileAttr; 119 | }; 120 | 121 | typedef struct archivelist /* used to list archives */ 122 | { 123 | struct RAR20_archive_entry item; 124 | struct archivelist *next; 125 | } ArchiveList_struct; 126 | 127 | 128 | #ifdef _USE_MEMORY_TO_MEMORY_DECOMPRESSION 129 | typedef struct memory_file /* used to decompress files in */ 130 | { /* memory */ 131 | void *data; /* pointer to the file data */ 132 | unsigned long size; /* total size of the file data */ 133 | unsigned long offset; /* offset within "memory-file" */ 134 | } MemoryFile; 135 | #endif 136 | 137 | /* -- global functions ---------------------------------------------------- */ 138 | 139 | /* urarlib_get: 140 | * decompresses and decrypt data from a RAR file to a buffer in system memory. 141 | * 142 | * input: *output pointer to an empty char*. This pointer will show 143 | * to the extracted data 144 | * *size shows where to write the size of the decompressed 145 | * file 146 | * (**NOTE: URARLib _does_ memory allocation etc.!**) 147 | * *filename pointer to string containing the file to decompress 148 | * *rarfile pointer to a string with the full name and path of 149 | * the RAR file or pointer to a RAR file in memory if 150 | * memory-to-memory decompression is active. 151 | * *libpassword pointer to a string with the password used to 152 | * en-/decrypt the RAR 153 | * output: int returns TRUE on success or FALSE on error 154 | * (FALSE=0, TRUE=1) 155 | */ 156 | 157 | extern int urarlib_get(void *output, 158 | unsigned long *size, 159 | char *filename, 160 | void *rarfile, 161 | char *libpassword); 162 | 163 | 164 | 165 | /* urarlib_list: 166 | * list the content of a RAR archive. 167 | * 168 | * input: *rarfile pointer to a string with the full name and path of 169 | * the RAR file or pointer to a RAR file in memory if 170 | * memory-to-memory decompression is active. 171 | * *list pointer to an ArchiveList_struct that can be 172 | * filled with details about the archive 173 | * to the extracted data 174 | * output: int number of files/directories within archive 175 | */ 176 | 177 | extern int urarlib_list(void *rarfile, ArchiveList_struct *list); 178 | 179 | 180 | /* urarlib_freelist: 181 | * (after the suggestion and code of Duy Nguyen, Sean O'Blarney 182 | * and Johannes Winkelmann who independently wrote a patch) 183 | * free the memory of a ArchiveList_struct created by urarlib_list. 184 | * 185 | * input: *list pointer to an ArchiveList_struct 186 | * output: - 187 | */ 188 | 189 | extern void urarlib_freelist(ArchiveList_struct *list); 190 | 191 | /* ------------------------------------------------------------------------ */ 192 | 193 | 194 | 195 | #ifdef __cplusplus 196 | }; 197 | #endif 198 | 199 | #endif 200 | 201 | -------------------------------------------------------------------------------- /DiskDirExtended.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resrc1.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #define APSTUDIO_HIDDEN_SYMBOLS 11 | #include "windows.h" 12 | #undef APSTUDIO_HIDDEN_SYMBOLS 13 | #include "resource.h" 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | #undef APSTUDIO_READONLY_SYMBOLS 17 | 18 | ///////////////////////////////////////////////////////////////////////////// 19 | // Czech resources 20 | 21 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CSY) 22 | #ifdef _WIN32 23 | LANGUAGE LANG_CZECH, SUBLANG_DEFAULT 24 | #pragma code_page(1250) 25 | #endif //_WIN32 26 | 27 | ///////////////////////////////////////////////////////////////////////////// 28 | // 29 | // Dialog 30 | // 31 | 32 | IDD_SETTINGS DIALOGEX 0, 0, 268, 161 33 | STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU 34 | CAPTION "DiskDir Extended - Settings" 35 | FONT 8, "MS Sans Serif", 0, 0, 0x0 36 | BEGIN 37 | DEFPUSHBUTTON "OK",IDOK,151,137,50,17 38 | CONTROL "",IDC_LIST_ARCHIVES,"SysListView32",LVS_LIST | LVS_SINGLESEL | LVS_SORTASCENDING | LVS_ALIGNLEFT | WS_TABSTOP,7,13,134,97,WS_EX_TRANSPARENT | WS_EX_CLIENTEDGE 39 | PUSHBUTTON "Additional Info...",IDC_INFO,151,119,109,15,BS_FLAT 40 | PUSHBUTTON "Cancel",IDCANCEL,210,137,50,17 41 | GROUPBOX "",IDC_STATIC,4,2,141,112,BS_CENTER 42 | CONTROL "Version 1.68 (c) 2009 Peter Trebaticky\n\nBratislava (Slovakia)\npeter.trebaticky@gmail.com",IDC_STATIC, 43 | "Static",SS_LEFTNOWORDWRAP | WS_GROUP,7,120,131,33 44 | GROUPBOX "",IDC_STATIC,4,114,141,42,BS_LEFT 45 | GROUPBOX "List columns",IDC_STATIC,148,2,52,112,BS_CENTER 46 | CONTROL "name",IDC_RADIO1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,154,13,42,10 47 | CONTROL "size",IDC_RADIO2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,154,25,42,10 48 | CONTROL "year",IDC_RADIO3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,154,37,42,10 49 | CONTROL "month",IDC_RADIO4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,154,49,42,10 50 | CONTROL "day",IDC_RADIO5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,154,62,42,10 51 | CONTROL "hours",IDC_RADIO6,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,154,75,42,10 52 | CONTROL "minutes",IDC_RADIO7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,154,88,42,10 53 | CONTROL "seconds",IDC_RADIO8,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,154,101,42,10 54 | GROUPBOX "Leading zeros in",IDC_STATIC,204,2,60,77,BS_CENTER 55 | CONTROL "month",IDC_CHECK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,210,13,42,10 56 | CONTROL "day",IDC_CHECK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,210,25,42,10 57 | CONTROL "hours",IDC_CHECK3,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,210,37,42,10 58 | CONTROL "minutes",IDC_CHECK4,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,210,49,42,10 59 | CONTROL "seconds",IDC_CHECK5,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,210,62,42,10 60 | CONTROL "List only directories",IDC_CHECK6,"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,210,91,47,17 61 | GROUPBOX "Other options",IDC_STATIC,204,79,60,35,BS_CENTER 62 | CONTROL "List archives (use right-click)",IDC_CHECK7,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,23,2,103,10 63 | END 64 | 65 | IDD_LIST_FILE DIALOGEX 0, 0, 180, 61 66 | STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU 67 | CAPTION "DiskDir Extended - Question" 68 | FONT 8, "MS Sans Serif", 0, 0, 0x0 69 | BEGIN 70 | DEFPUSHBUTTON "Yes",IDOK,4,40,40,18,BS_CENTER | BS_VCENTER 71 | PUSHBUTTON "No",IDCANCEL,48,40,40,18,BS_CENTER | BS_VCENTER 72 | PUSHBUTTON "Yes for all\nof this type",IDC_YES_FORALL,92,40,40,18,BS_CENTER | BS_VCENTER | BS_MULTILINE 73 | PUSHBUTTON "No for all\nof this type",IDC_NO_FORALL,136,40,40,18,BS_CENTER | BS_VCENTER | BS_MULTILINE 74 | LTEXT "Should I list the contents of this file?",IDC_STATIC,4,4,173,8 75 | LTEXT "",IDC_FILE_NAME,9,15,167,25 76 | END 77 | 78 | 79 | #ifdef APSTUDIO_INVOKED 80 | ///////////////////////////////////////////////////////////////////////////// 81 | // 82 | // TEXTINCLUDE 83 | // 84 | 85 | 1 TEXTINCLUDE 86 | BEGIN 87 | "resrc1.h\0" 88 | END 89 | 90 | 2 TEXTINCLUDE 91 | BEGIN 92 | "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" 93 | "#include ""windows.h""\r\n" 94 | "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" 95 | "#include ""resource.h""\r\n" 96 | "\0" 97 | END 98 | 99 | 3 TEXTINCLUDE 100 | BEGIN 101 | "\r\n" 102 | "\0" 103 | END 104 | 105 | #endif // APSTUDIO_INVOKED 106 | 107 | 108 | ///////////////////////////////////////////////////////////////////////////// 109 | // 110 | // DESIGNINFO 111 | // 112 | 113 | #ifdef APSTUDIO_INVOKED 114 | GUIDELINES DESIGNINFO 115 | BEGIN 116 | IDD_SETTINGS, DIALOG 117 | BEGIN 118 | RIGHTMARGIN, 264 119 | END 120 | 121 | IDD_LIST_FILE, DIALOG 122 | BEGIN 123 | LEFTMARGIN, 7 124 | RIGHTMARGIN, 173 125 | TOPMARGIN, 7 126 | BOTTOMMARGIN, 21 127 | END 128 | END 129 | #endif // APSTUDIO_INVOKED 130 | 131 | #endif // Czech resources 132 | ///////////////////////////////////////////////////////////////////////////// 133 | 134 | 135 | ///////////////////////////////////////////////////////////////////////////// 136 | // Slovak resources 137 | 138 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SKY) 139 | #ifdef _WIN32 140 | LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT 141 | #pragma code_page(1250) 142 | #endif //_WIN32 143 | 144 | ///////////////////////////////////////////////////////////////////////////// 145 | // 146 | // Icon 147 | // 148 | 149 | // Icon with lowest ID value placed first to ensure application icon 150 | // remains consistent on all systems. 151 | IDI_YES ICON "yes.ico" 152 | IDI_NO ICON "no.ico" 153 | IDI_ASK ICON "ask.ico" 154 | 155 | ///////////////////////////////////////////////////////////////////////////// 156 | // 157 | // Version 158 | // 159 | 160 | VS_VERSION_INFO VERSIONINFO 161 | FILEVERSION 1,6,7,0 162 | PRODUCTVERSION 1,6,7,0 163 | FILEFLAGSMASK 0x17L 164 | #ifdef _DEBUG 165 | FILEFLAGS 0x1L 166 | #else 167 | FILEFLAGS 0x0L 168 | #endif 169 | FILEOS 0x4L 170 | FILETYPE 0x2L 171 | FILESUBTYPE 0x0L 172 | BEGIN 173 | BLOCK "StringFileInfo" 174 | BEGIN 175 | BLOCK "041b04b0" 176 | BEGIN 177 | VALUE "CompanyName", "TrePe" 178 | VALUE "FileDescription", "DiskDirExtended - plugin for TotalCommander to create list file with all selected files/dirs, also lists contents of archive files" 179 | VALUE "FileVersion", "1, 6, 8, 0" 180 | VALUE "InternalName", "DiskDirExtended" 181 | VALUE "LegalCopyright", "(C) 2009 Peter Trebaticky" 182 | VALUE "OriginalFilename", "DiskDirExtended" 183 | VALUE "ProductName", "DiskDirExtended" 184 | VALUE "ProductVersion", "1, 6, 8, 0" 185 | END 186 | END 187 | BLOCK "VarFileInfo" 188 | BEGIN 189 | VALUE "Translation", 0x41b, 1200 190 | END 191 | END 192 | 193 | 194 | ///////////////////////////////////////////////////////////////////////////// 195 | // 196 | // String Table 197 | // 198 | 199 | STRINGTABLE 200 | BEGIN 201 | IDS_LIST_COLUMNS_QUERY "You chose to list %d columns but this file has %d columns.\nDo you wish to keep file's number of columns (%d)?" 202 | IDS_ADDITIONAL_INFO "For more options see:\n%s\n\nThis plugin is free software. It uses:\n- minizip 1.1 (c) 1998-2010 Gilles Vollant\n from zlib 1.2.5 (c) 1995-2010 Jean-loup Gailly and Mark Adler\n- UniquE RAR File Library 0.4.0 (c) 2000-2002 by Christian Scheurer\n- Cabinet SDK (c) 1993-1997 Microsoft Corporation\n- parts from GNU tar 1.13 (c) 1994-1999 Free Software Foundation, Inc.\n- libbzip2 1.0.5 (c) 1996-2007 Julian R Seward\n- iso.wcx 1.7.9 (c) 2002-2013 Sergey Oblomov\n- UPX 3.09w (c) 1996-2013 Markus Oberhumer, Laszlo Molnar & John Reiser\n for reducing the size of this plugin\n\nAlso thanks to WildGoblin from forum.ru-board.com for help with GUI" 203 | IDS_ADDITIONAL_INFO_TITLE "DiskDir Extended - Additional Information" 204 | END 205 | 206 | STRINGTABLE 207 | BEGIN 208 | IDS_ERROR_CREATE_INI "Unable to create file DiskDirExtended.ini" 209 | IDS_LIST_COLUMNS_TITLE "DiskDir Extended - Question" 210 | END 211 | 212 | #endif // Slovak resources 213 | ///////////////////////////////////////////////////////////////////////////// 214 | 215 | 216 | 217 | #ifndef APSTUDIO_INVOKED 218 | ///////////////////////////////////////////////////////////////////////////// 219 | // 220 | // Generated from the TEXTINCLUDE 3 resource. 221 | // 222 | 223 | 224 | ///////////////////////////////////////////////////////////////////////////// 225 | #endif // not APSTUDIO_INVOKED 226 | 227 | -------------------------------------------------------------------------------- /libs/tar/src/tar.h: -------------------------------------------------------------------------------- 1 | /* Format of tar archives. 2 | Copyright (C) 1988, 92, 93, 94, 96, 97 Free Software Foundation, Inc. 3 | 4 | This program is free software; you can redistribute it and/or modify it 5 | under the terms of the GNU General Public License as published by the 6 | Free Software Foundation; either version 2, or (at your option) any later 7 | version. 8 | 9 | This program is distributed in the hope that it will be useful, but 10 | WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 12 | Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License along 15 | with this program; if not, write to the Free Software Foundation, Inc., 16 | 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ 17 | 18 | /* GNU tar Archive Format description. */ 19 | 20 | /* If OLDGNU_COMPATIBILITY is not zero, tar produces archives which, by 21 | default, are readable by older versions of GNU tar. This can be 22 | overriden by using --posix; in this case, POSIXLY_CORRECT in environment 23 | may be set for enforcing stricter conformance. If OLDGNU_COMPATIBILITY 24 | is zero or undefined, tar will eventually produces archives which, by 25 | default, POSIX compatible; then either using --posix or defining 26 | POSIXLY_CORRECT enforces stricter conformance. 27 | 28 | This #define will disappear in a few years. FP, June 1995. */ 29 | #define OLDGNU_COMPATIBILITY 1 30 | 31 | /*---------------------------------------------. 32 | | `tar' Header Block, from POSIX 1003.1-1990. | 33 | `---------------------------------------------*/ 34 | 35 | /* POSIX header. */ 36 | 37 | struct posix_header 38 | { /* byte offset */ 39 | char name[100]; /* 0 */ 40 | char mode[8]; /* 100 */ 41 | char uid[8]; /* 108 */ 42 | char gid[8]; /* 116 */ 43 | char size[12]; /* 124 */ 44 | char mtime[12]; /* 136 */ 45 | char chksum[8]; /* 148 */ 46 | char typeflag; /* 156 */ 47 | char linkname[100]; /* 157 */ 48 | char magic[6]; /* 257 */ 49 | char version[2]; /* 263 */ 50 | char uname[32]; /* 265 */ 51 | char gname[32]; /* 297 */ 52 | char devmajor[8]; /* 329 */ 53 | char devminor[8]; /* 337 */ 54 | char prefix[155]; /* 345 */ 55 | /* 500 */ 56 | }; 57 | 58 | #define TMAGIC "ustar" /* ustar and a null */ 59 | #define TMAGLEN 6 60 | #define TVERSION "00" /* 00 and no null */ 61 | #define TVERSLEN 2 62 | 63 | /* Values used in typeflag field. */ 64 | #define REGTYPE '0' /* regular file */ 65 | #define AREGTYPE '\0' /* regular file */ 66 | #define LNKTYPE '1' /* link */ 67 | #define SYMTYPE '2' /* reserved */ 68 | #define CHRTYPE '3' /* character special */ 69 | #define BLKTYPE '4' /* block special */ 70 | #define DIRTYPE '5' /* directory */ 71 | #define FIFOTYPE '6' /* FIFO special */ 72 | #define CONTTYPE '7' /* reserved */ 73 | 74 | /* Bits used in the mode field, values in octal. */ 75 | #define TSUID 04000 /* set UID on execution */ 76 | #define TSGID 02000 /* set GID on execution */ 77 | #define TSVTX 01000 /* reserved */ 78 | /* file permissions */ 79 | #define TUREAD 00400 /* read by owner */ 80 | #define TUWRITE 00200 /* write by owner */ 81 | #define TUEXEC 00100 /* execute/search by owner */ 82 | #define TGREAD 00040 /* read by group */ 83 | #define TGWRITE 00020 /* write by group */ 84 | #define TGEXEC 00010 /* execute/search by group */ 85 | #define TOREAD 00004 /* read by other */ 86 | #define TOWRITE 00002 /* write by other */ 87 | #define TOEXEC 00001 /* execute/search by other */ 88 | 89 | /*-------------------------------------. 90 | | `tar' Header Block, GNU extensions. | 91 | `-------------------------------------*/ 92 | 93 | /* In GNU tar, SYMTYPE is for to symbolic links, and CONTTYPE is for 94 | contiguous files, so maybe disobeying the `reserved' comment in POSIX 95 | header description. I suspect these were meant to be used this way, and 96 | should not have really been `reserved' in the published standards. */ 97 | 98 | /* *BEWARE* *BEWARE* *BEWARE* that the following information is still 99 | boiling, and may change. Even if the OLDGNU format description should be 100 | accurate, the so-called GNU format is not yet fully decided. It is 101 | surely meant to use only extensions allowed by POSIX, but the sketch 102 | below repeats some ugliness from the OLDGNU format, which should rather 103 | go away. Sparse files should be saved in such a way that they do *not* 104 | require two passes at archive creation time. Huge files get some POSIX 105 | fields to overflow, alternate solutions have to be sought for this. */ 106 | 107 | /* Descriptor for a single file hole. */ 108 | 109 | struct sparse 110 | { /* byte offset */ 111 | char offset[12]; /* 0 */ 112 | char numbytes[12]; /* 12 */ 113 | /* 24 */ 114 | }; 115 | 116 | /* Sparse files are not supported in POSIX ustar format. For sparse files 117 | with a POSIX header, a GNU extra header is provided which holds overall 118 | sparse information and a few sparse descriptors. When an old GNU header 119 | replaces both the POSIX header and the GNU extra header, it holds some 120 | sparse descriptors too. Whether POSIX or not, if more sparse descriptors 121 | are still needed, they are put into as many successive sparse headers as 122 | necessary. The following constants tell how many sparse descriptors fit 123 | in each kind of header able to hold them. */ 124 | 125 | #define SPARSES_IN_EXTRA_HEADER 16 126 | #define SPARSES_IN_OLDGNU_HEADER 4 127 | #define SPARSES_IN_SPARSE_HEADER 21 128 | 129 | /* The GNU extra header contains some information GNU tar needs, but not 130 | foreseen in POSIX header format. It is only used after a POSIX header 131 | (and never with old GNU headers), and immediately follows this POSIX 132 | header, when typeflag is a letter rather than a digit, so signaling a GNU 133 | extension. */ 134 | 135 | struct extra_header 136 | { /* byte offset */ 137 | char atime[12]; /* 0 */ 138 | char ctime[12]; /* 12 */ 139 | char offset[12]; /* 24 */ 140 | char realsize[12]; /* 36 */ 141 | char longnames[4]; /* 48 */ 142 | char unused_pad1[68]; /* 52 */ 143 | struct sparse sp[SPARSES_IN_EXTRA_HEADER]; 144 | /* 120 */ 145 | char isextended; /* 504 */ 146 | /* 505 */ 147 | }; 148 | 149 | /* Extension header for sparse files, used immediately after the GNU extra 150 | header, and used only if all sparse information cannot fit into that 151 | extra header. There might even be many such extension headers, one after 152 | the other, until all sparse information has been recorded. */ 153 | 154 | struct sparse_header 155 | { /* byte offset */ 156 | struct sparse sp[SPARSES_IN_SPARSE_HEADER]; 157 | /* 0 */ 158 | char isextended; /* 504 */ 159 | /* 505 */ 160 | }; 161 | 162 | /* The old GNU format header conflicts with POSIX format in such a way that 163 | POSIX archives may fool old GNU tar's, and POSIX tar's might well be 164 | fooled by old GNU tar archives. An old GNU format header uses the space 165 | used by the prefix field in a POSIX header, and cumulates information 166 | normally found in a GNU extra header. With an old GNU tar header, we 167 | never see any POSIX header nor GNU extra header. Supplementary sparse 168 | headers are allowed, however. */ 169 | 170 | struct oldgnu_header 171 | { /* byte offset */ 172 | char unused_pad1[345]; /* 0 */ 173 | char atime[12]; /* 345 */ 174 | char ctime[12]; /* 357 */ 175 | char offset[12]; /* 369 */ 176 | char longnames[4]; /* 381 */ 177 | char unused_pad2; /* 385 */ 178 | struct sparse sp[SPARSES_IN_OLDGNU_HEADER]; 179 | /* 386 */ 180 | char isextended; /* 482 */ 181 | char realsize[12]; /* 483 */ 182 | /* 495 */ 183 | }; 184 | 185 | /* OLDGNU_MAGIC uses both magic and version fields, which are contiguous. 186 | Found in an archive, it indicates an old GNU header format, which will be 187 | hopefully become obsolescent. With OLDGNU_MAGIC, uname and gname are 188 | valid, though the header is not truly POSIX conforming. */ 189 | #define OLDGNU_MAGIC "ustar " /* 7 chars and a null */ 190 | 191 | /* The standards committee allows only capital A through capital Z for 192 | user-defined expansion. */ 193 | 194 | /* This is a dir entry that contains the names of files that were in the 195 | dir at the time the dump was made. */ 196 | #define GNUTYPE_DUMPDIR 'D' 197 | 198 | /* Identifies the *next* file on the tape as having a long linkname. */ 199 | #define GNUTYPE_LONGLINK 'K' 200 | 201 | /* Identifies the *next* file on the tape as having a long name. */ 202 | #define GNUTYPE_LONGNAME 'L' 203 | 204 | /* This is the continuation of a file that began on another volume. */ 205 | #define GNUTYPE_MULTIVOL 'M' 206 | 207 | /* For storing filenames that do not fit into the main header. */ 208 | #define GNUTYPE_NAMES 'N' 209 | 210 | /* This is for sparse files. */ 211 | #define GNUTYPE_SPARSE 'S' 212 | 213 | /* This file is a tape/volume header. Ignore it on extraction. */ 214 | #define GNUTYPE_VOLHDR 'V' 215 | 216 | /*--------------------------------------. 217 | | tar Header Block, overall structure. | 218 | `--------------------------------------*/ 219 | 220 | /* tar files are made in basic blocks of this size. */ 221 | #define BLOCKSIZE 512 222 | 223 | enum archive_format 224 | { 225 | DEFAULT_FORMAT, /* format to be decided later */ 226 | V7_FORMAT, /* old V7 tar format */ 227 | OLDGNU_FORMAT, /* GNU format as per before tar 1.12 */ 228 | POSIX_FORMAT, /* restricted, pure POSIX format */ 229 | GNU_FORMAT /* POSIX format with GNU extensions */ 230 | }; 231 | 232 | union block 233 | { 234 | char buffer[BLOCKSIZE]; 235 | struct posix_header header; 236 | struct extra_header extra_header; 237 | struct oldgnu_header oldgnu_header; 238 | struct sparse_header sparse_header; 239 | }; 240 | 241 | /* End of Format description. */ 242 | --------------------------------------------------------------------------------