#include #include "UnAlz.h" void Usage() { printf("\n"); #ifdef _UNALZ_ICONV printf("USAGE : unalz [-utf8 | -cp949] sourcefile.alz [dest path] \n"); # ifdef _UNALZ_UTF8 printf(" -utf8 : convert filename's codepage to UTF-8 (default)\n"); printf(" -cp949 : convert filename's codepage to CP949\n"); # else printf(" -utf8 : convert filename's codepage to UTF-8\n"); printf(" -cp949 : convert filename's codepage to CP949 (default)\n"); # endif // _UNALZ_UTF8 #else // no iconv printf("USAGE : unalz sourcefile.alz [dest path] \n"); #endif // _UNALZ_ICONV } void UnAlzCallback(const char* szMessage, INT64 nCurrent, INT64 nRange, void* param, BOOL* bHalt) { // progress char buf[1000]; INT64 percent; static INT64 nPrevPercent = -1; int buflen; int i; // ÆÄÀϸí Ãâ·Â.. if(szMessage) { //printf("\n"); printf("unalziiiing : %s ", szMessage); nPrevPercent = -1; return ; } percent = nCurrent*100/nRange; if(nPrevPercent==percent) return; // ³Ê¹« ÀæÀº ¾÷µ¥ÀÌÆ® ¹æÁö.. nPrevPercent = percent; #ifdef _WIN32 sprintf(buf, "%I64d/%I64d (%I64d%%)", nCurrent, nRange, percent); #else sprintf(buf, "%d/%d (%d%%)", (int)nCurrent, (int)nRange, (int)percent); // int64 ¸¦ Ãâ·ÂÇÒ¶ó¸é ¾îÂîÇØ¾ß µÇ´ÂÁö? #endif puts(buf); buflen = strlen(buf); fflush(stdout); for(i=0;i=argc) {Usage();return 0;} // ¿É¼Ç¸¸ ¾²¸é ¾î¼¶ó°í.. if(destcodepage) unalz.SetDestCodepage(destcodepage); #endif // ¼Ò½º ÆÄÀÏ source=argv[count]; count++; // ´ë»ó °æ·Î if(count