diff --git a/Makefile b/Makefile index 2b280a2..215607b 100755 --- a/Makefile +++ b/Makefile @@ -12,8 +12,8 @@ all: @echo "" @echo "TARGET_SYSTEM is one of" @echo "" + @echo " posix-utf8 : POSIX with utf8 filesystem(Most of modern OS, e.g. OSX/Ubuntu)" @echo " posix : POSIX system (FreeBSD/linux/OSX/sparc/Win32)" - @echo " posix-utf8 : POSIX with utf8 filesystem(e.g. OSX)" @echo " linux-utf8 : LINUX with utf8 filesystem(without -liconv option)" @echo " posix-noiconv : POSIX without libiconv (Windows(MINGW32,CYGWIN) or EUC-KR file system)" @echo "" diff --git a/UnAlz.cpp b/UnAlz.cpp index de654fa..31367d7 100755 --- a/UnAlz.cpp +++ b/UnAlz.cpp @@ -118,6 +118,16 @@ static BOOL IsBigEndian(void) #endif +// 64bit file handling support +#if (_FILE_OFFSET_BITS==64) +# define unalz_fseek fseeko +# define unalz_ftell ftello +#else +# define unalz_fseek fseek +# define unalz_ftell ftell +#endif + + // error string table <- CUnAlz::ERR ÀÇ ¹ø¿ª static const char* errorstrtable[]= { @@ -278,7 +288,7 @@ BOOL CUnAlz::Open(const char* szPathName) BOOL ret; if(FEof()) break; - //int pos = ftell(m_fp); + //int pos = unalz_ftell(m_fp); sig = ReadSignature(); if(sig==SIG_EOF) { @@ -1494,9 +1504,9 @@ BOOL CUnAlz::FOpen(const char* szPathName) m_files[i].fp = fopen(temp, "rb"); if(m_files[i].fp==NULL) break; dwFileSizeHigh=0; - fseek(m_files[i].fp,0,SEEK_END); - nFileSizeLow=ftell(m_files[i].fp); - fseek(m_files[i].fp,0,SEEK_SET); + unalz_fseek(m_files[i].fp,0,SEEK_END); + nFileSizeLow=unalz_ftell(m_files[i].fp); + unalz_fseek(m_files[i].fp,0,SEEK_SET); #endif m_nFileCount++; m_files[i].nFileSize = ((INT64)nFileSizeLow) + (((INT64)dwFileSizeHigh)<<32); @@ -1584,7 +1594,7 @@ BOOL CUnAlz::FSeek(INT64 offset) #ifdef _WIN32 SetFilePointer(m_files[i].fp, LONG(m_nCurFilePos), &remainHigh, FILE_BEGIN); #else - fseek(m_files[i].fp, m_nCurFilePos, SEEK_SET); + unalz_fseek(m_files[i].fp, m_nCurFilePos, SEEK_SET); #endif return TRUE; } @@ -1668,7 +1678,7 @@ BOOL CUnAlz::FRead(void* buffer, UINT32 nBytesToRead, int* pTotRead ) #ifdef _WIN32 SetFilePointer(m_files[m_nCurFile].fp, (int)m_nCurFilePos, NULL, FILE_BEGIN); #else - fseek(m_files[m_nCurFile].fp, m_nCurFilePos, SEEK_SET); + unalz_fseek(m_files[m_nCurFile].fp, m_nCurFilePos, SEEK_SET); #endif } else diff --git a/UnAlz.h b/UnAlz.h index 4c5c124..390b9b9 100755 --- a/UnAlz.h +++ b/UnAlz.h @@ -115,6 +115,10 @@ - unalz 0.62 2009/01/09 - apple gcc ÄÄÆÄÀÏ °ü·Ã ¼öÁ¤(by lacovnk) - unalz 0.63 + 2009/01/20 - 2GB°¡ ³Ñ´Â ÆÄÀÏ Ã³¸® °ü·Ã ¼öÁ¤(by bsjeon@hanmail) + - ÆÄÀÏ ¸®½ºÆà ºÎºÐ ¼öÁ¤ + - ¼Ò½º Á¤¸® + - unalz 0.64 ±â´É : - alz ÆÄÀÏÀÇ ¾ÐÃà ÇØÁ¦ (deflate/º¯Çü bzip2/raw) @@ -564,7 +568,7 @@ private : // INT64 m_nCurFilePos; ///< ÇöÀç ÆÄÀÏÀÇ ¹°¸®Àû À§Ä¡. BOOL m_bIsEOF; ///< ÆÄÀÏÀÇ ³¡±îÁö (ºÐÇÒ ÆÄÀÏ Æ÷ÇÔÇؼ­) ¿Ô³ª? - BOOL m_bIsEncrypted; // xf86 + BOOL m_bIsEncrypted; ///< by xf86 BOOL m_bIsDataDescr; #define UNALZ_LEN_PASSWORD 512 char m_szPasswd[UNALZ_LEN_PASSWORD]; diff --git a/UnAlzUtils.cpp b/UnAlzUtils.cpp index 6b16f89..ef10e28 100755 --- a/UnAlzUtils.cpp +++ b/UnAlzUtils.cpp @@ -68,9 +68,10 @@ int ListAlz(CUnAlz* pUnAlz, const char* src) list = pUnAlz->GetFileList(); printf("\nListing archive: %s\n" - "\n Date & Time Attr Size Compressed Name\n", + "\n" + "Attr Uncomp Size Comp Size Date & Time & File Name\n", src); - printf("------------------- ----- ------------ ------------ ------------\n"); + printf("---- ------------ ------------ ------------------------------------------------\n"); // char szDate[64]; char szTime[64]; @@ -91,9 +92,9 @@ int ListAlz(CUnAlz* pUnAlz, const char* src) // attributes FileAttr2Str(szAttr, i->head.fileAttribute); - printf("%19s %s " I64FORM(12) " " I64FORM(12) " %s%s\n", - szTime, szAttr, i->uncompressedSize, - i->compressedSize, i->fileName, + printf("%s " I64FORM(12) " " I64FORM(12) " %s %s%s\n", + szAttr, i->uncompressedSize, + i->compressedSize, szTime, i->fileName, i->head.fileDescriptor & ALZ_FILE_DESCRIPTOR_ENCRYPTED ? "*" : "" ); ++fileNum; @@ -101,11 +102,9 @@ int ListAlz(CUnAlz* pUnAlz, const char* src) totalCompressedSize += i->compressedSize; } - printf("------------------- ----- ------------ ------------ ------------\n"); - printf(" " U64FORM(12) " " U64FORM(12) " %u file(s)\n", - totalUnCompressedSize, totalCompressedSize, fileNum); + printf("---- ------------ ------------ ------------------------------------------------\n"); + printf(" " U64FORM(12) " " U64FORM(12) " Total %u file%s\n", + totalUnCompressedSize, totalCompressedSize, fileNum, fileNum<=1 ? "" : "s"); return 0; } - - diff --git a/UnAlzUtils.h b/UnAlzUtils.h index f8fe16a..b768afd 100755 --- a/UnAlzUtils.h +++ b/UnAlzUtils.h @@ -1,3 +1,41 @@ +/* + UNALZ : read and extract module for ALZ format. + + LICENSE (zlib License) + Copyright (C) 2004-2009 kippler@gmail.com , http://www.kipple.pe.kr + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + ÀÌ ¼ÒÇÁÆ®¿þ¾î´Â ¾î¶°ÇÑ ¸í½ÃÀû ¶Ç´Â ¹¬½ÃÀû º¸Áõµµ ¾øÀÌ "ÀÖ´Â ±×´ë·Î" Á¦°øµË´Ï´Ù. ±× + ¾î¶² °æ¿ì¿¡µµ ÀÛ¼ºÀÚ´Â ÀÌ ¼ÒÇÁÆ®¿þ¾îÀÇ »ç¿ëÀ¸·Î ÀÎÇÑ ¼ÕÇØ¿¡ ´ëÇØ Ã¥ÀÓÀ» ÁöÁö ¾Ê½À´Ï´Ù. + + ´ÙÀ½ Á¦ÇÑ ±ÔÁ¤À» ÁؼöÇÏ´Â °æ¿ì¿¡ ÇÑÇÏ¿© »ó¾÷ÀûÀÎ ÀÀ¿ë ÇÁ·Î±×·¥À» Æ÷ÇÔÇÏ´Â ¸ðµç ¿ëµµ·Î ÀÌ ¼ÒÇÁÆ®¿þ¾î¸¦ + »ç¿ëÇÏ°í ÀÚÀ¯·Ó°Ô ¼öÁ¤ ¹× Àç¹èÆ÷ÇÒ ¼ö ÀÖ´Â ±ÇÇÑÀÌ ´©±¸¿¡°Ô³ª ºÎ¿©µË´Ï´Ù. + + 1. ÀÌ ¼ÒÇÁÆ®¿þ¾îÀÇ Ãâó¸¦ À߸ø Ç¥½ÃÇϰųª ¿ø·¡ ¼ÒÇÁÆ®¿þ¾î¸¦ ÀÚ½ÅÀÌ ÀÛ¼ºÇß´Ù°í ÁÖÀåÇؼ­´Â ¾È µË´Ï´Ù. Á¦Ç°¿¡ + ÀÌ ¼ÒÇÁÆ®¿þ¾î¸¦ »ç¿ëÇÏ´Â °æ¿ì ¿ä±¸ »çÇ×Àº ¾Æ´ÏÁö¸¸ Á¦Ç° ¼³¸í¼­¿¡ ÀÎÁ¤ Á¶Ç×À» ³Ö¾î ÁÖ½Ã¸é °¨»çÇÏ°Ú½À´Ï´Ù. + 2. ¼öÁ¤µÈ ¼Ò½º ¹öÀüÀº ¹Ýµå½Ã ¸íÈ®ÇÏ°Ô Ç¥½ÃµÇ¾î¾ß ÇÏ¸ç ¿ø·¡ ¼ÒÇÁÆ®¿þ¾î·Î ¿ÀÀεǵµ·Ï À߸ø Ç¥½ÃÇؼ­´Â ¾È µË´Ï´Ù. + 3. ¸ðµç ¼Ò½º ¹èÆ÷ ½Ã ÀÌ °øÁö¸¦ »èÁ¦Çϰųª ¼öÁ¤ÇÒ ¼ö ¾ø½À´Ï´Ù. + + ============================================================================================================= +*/ + + + //////////////////////////////////////////////////////////////////////////////////////////////////// /// /// unalz °ü·Ã À¯Æ¿ ¸ðÀ½ diff --git a/main.cpp b/main.cpp index bb27b3b..876bb78 100755 --- a/main.cpp +++ b/main.cpp @@ -1,3 +1,40 @@ +/* + UNALZ : read and extract module for ALZ format. + + LICENSE (zlib License) + Copyright (C) 2004-2009 kippler@gmail.com , http://www.kipple.pe.kr + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + ÀÌ ¼ÒÇÁÆ®¿þ¾î´Â ¾î¶°ÇÑ ¸í½ÃÀû ¶Ç´Â ¹¬½ÃÀû º¸Áõµµ ¾øÀÌ "ÀÖ´Â ±×´ë·Î" Á¦°øµË´Ï´Ù. ±× + ¾î¶² °æ¿ì¿¡µµ ÀÛ¼ºÀÚ´Â ÀÌ ¼ÒÇÁÆ®¿þ¾îÀÇ »ç¿ëÀ¸·Î ÀÎÇÑ ¼ÕÇØ¿¡ ´ëÇØ Ã¥ÀÓÀ» ÁöÁö ¾Ê½À´Ï´Ù. + + ´ÙÀ½ Á¦ÇÑ ±ÔÁ¤À» ÁؼöÇÏ´Â °æ¿ì¿¡ ÇÑÇÏ¿© »ó¾÷ÀûÀÎ ÀÀ¿ë ÇÁ·Î±×·¥À» Æ÷ÇÔÇÏ´Â ¸ðµç ¿ëµµ·Î ÀÌ ¼ÒÇÁÆ®¿þ¾î¸¦ + »ç¿ëÇÏ°í ÀÚÀ¯·Ó°Ô ¼öÁ¤ ¹× Àç¹èÆ÷ÇÒ ¼ö ÀÖ´Â ±ÇÇÑÀÌ ´©±¸¿¡°Ô³ª ºÎ¿©µË´Ï´Ù. + + 1. ÀÌ ¼ÒÇÁÆ®¿þ¾îÀÇ Ãâó¸¦ À߸ø Ç¥½ÃÇϰųª ¿ø·¡ ¼ÒÇÁÆ®¿þ¾î¸¦ ÀÚ½ÅÀÌ ÀÛ¼ºÇß´Ù°í ÁÖÀåÇؼ­´Â ¾È µË´Ï´Ù. Á¦Ç°¿¡ + ÀÌ ¼ÒÇÁÆ®¿þ¾î¸¦ »ç¿ëÇÏ´Â °æ¿ì ¿ä±¸ »çÇ×Àº ¾Æ´ÏÁö¸¸ Á¦Ç° ¼³¸í¼­¿¡ ÀÎÁ¤ Á¶Ç×À» ³Ö¾î ÁÖ½Ã¸é °¨»çÇÏ°Ú½À´Ï´Ù. + 2. ¼öÁ¤µÈ ¼Ò½º ¹öÀüÀº ¹Ýµå½Ã ¸íÈ®ÇÏ°Ô Ç¥½ÃµÇ¾î¾ß ÇÏ¸ç ¿ø·¡ ¼ÒÇÁÆ®¿þ¾î·Î ¿ÀÀεǵµ·Ï À߸ø Ç¥½ÃÇؼ­´Â ¾È µË´Ï´Ù. + 3. ¸ðµç ¼Ò½º ¹èÆ÷ ½Ã ÀÌ °øÁö¸¦ »èÁ¦Çϰųª ¼öÁ¤ÇÒ ¼ö ¾ø½À´Ï´Ù. + + ============================================================================================================= +*/ + + #ifdef _WIN32 # pragma warning( disable : 4786 ) // stl warning ¾ø¾Ö±â #endif @@ -32,7 +69,8 @@ void Copyright() // printf("unalz v0.60 (2006/12/31) \n"); // printf("unalz v0.61 (2007/02/10) \n"); // printf("unalz v0.62 (2008/04/04) \n"); - printf("unalz v0.63 (2009/01/09) \n"); +// printf("unalz v0.63 (2009/01/09) \n"); + printf("unalz v0.64 (2009/01/20) \n"); printf("Copyright(C) 2004-2009 by kippler@gmail.com (http://www.kipple.pe.kr) \n"); } @@ -104,7 +142,7 @@ void UnAlzCallback(const char* szFileName, INT64 nCurrent, INT64 nRange, void* p #else snprintf(szMessage, MSG_BUF_LEN, "unalziiiing : %s (%lldbytes) ", szFileName, nRange); #endif - printf("%s", szMessage); + printf("%s.", szMessage); fflush(stdout); nPrevPercent = -1; return; @@ -318,7 +356,7 @@ int main(int argc, char* argv[]) } } if(g_bPipeMode==FALSE) - printf("\ndone..\n"); + printf("\ndone.\n"); } return 0; diff --git a/readme.txt b/readme.txt index 24f302c..f05ec9a 100755 --- a/readme.txt +++ b/readme.txt @@ -1,14 +1,12 @@ - unalz v0.63 + unalz v0.64 Copyright(C) 2004-2009 by kippler@gmail.com (http://www.kipple.pe.kr) - LICENSE (zlib License) - Copyright (C) 2004-2009 kippler@gmail.com , http://www.kipple.pe.kr - This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. @@ -25,3 +23,16 @@ misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. + + + ÀÌ ¼ÒÇÁÆ®¿þ¾î´Â ¾î¶°ÇÑ ¸í½ÃÀû ¶Ç´Â ¹¬½ÃÀû º¸Áõµµ ¾øÀÌ "ÀÖ´Â ±×´ë·Î" Á¦°øµË´Ï´Ù. ±× + ¾î¶² °æ¿ì¿¡µµ ÀÛ¼ºÀÚ´Â ÀÌ ¼ÒÇÁÆ®¿þ¾îÀÇ »ç¿ëÀ¸·Î ÀÎÇÑ ¼ÕÇØ¿¡ ´ëÇØ Ã¥ÀÓÀ» ÁöÁö ¾Ê½À´Ï´Ù. + + ´ÙÀ½ Á¦ÇÑ ±ÔÁ¤À» ÁؼöÇÏ´Â °æ¿ì¿¡ ÇÑÇÏ¿© »ó¾÷ÀûÀÎ ÀÀ¿ë ÇÁ·Î±×·¥À» Æ÷ÇÔÇÏ´Â ¸ðµç ¿ëµµ·Î ÀÌ ¼ÒÇÁÆ®¿þ¾î¸¦ + »ç¿ëÇÏ°í ÀÚÀ¯·Ó°Ô ¼öÁ¤ ¹× Àç¹èÆ÷ÇÒ ¼ö ÀÖ´Â ±ÇÇÑÀÌ ´©±¸¿¡°Ô³ª ºÎ¿©µË´Ï´Ù. + + 1. ÀÌ ¼ÒÇÁÆ®¿þ¾îÀÇ Ãâó¸¦ À߸ø Ç¥½ÃÇϰųª ¿ø·¡ ¼ÒÇÁÆ®¿þ¾î¸¦ ÀÚ½ÅÀÌ ÀÛ¼ºÇß´Ù°í ÁÖÀåÇؼ­´Â ¾È µË´Ï´Ù. Á¦Ç°¿¡ + ÀÌ ¼ÒÇÁÆ®¿þ¾î¸¦ »ç¿ëÇÏ´Â °æ¿ì ¿ä±¸ »çÇ×Àº ¾Æ´ÏÁö¸¸ Á¦Ç° ¼³¸í¼­¿¡ ÀÎÁ¤ Á¶Ç×À» ³Ö¾î ÁÖ½Ã¸é °¨»çÇÏ°Ú½À´Ï´Ù. + 2. ¼öÁ¤µÈ ¼Ò½º ¹öÀüÀº ¹Ýµå½Ã ¸íÈ®ÇÏ°Ô Ç¥½ÃµÇ¾î¾ß ÇÏ¸ç ¿ø·¡ ¼ÒÇÁÆ®¿þ¾î·Î ¿ÀÀεǵµ·Ï À߸ø Ç¥½ÃÇؼ­´Â ¾È µË´Ï´Ù. + 3. ¸ðµç ¼Ò½º ¹èÆ÷ ½Ã ÀÌ °øÁö¸¦ »èÁ¦Çϰųª ¼öÁ¤ÇÒ ¼ö ¾ø½À´Ï´Ù. +