74#define AMANDA__SIZE ((32767 * 6) + 2)
79#define AMANDA__SIZE_w (32767)
83#define __INT32_OR_INT64 __int64
85#define __INT32_OR_INT64 int
88int utf8towide(
const char *pUTF8, WCHAR *pUSC2,
int nUSC2);
114void dprintf(
char *format, ...);
126 if ((
myfile = fopen(infile_ar,
"rb")) ==
NULL)
132 ret_z = _ftelli64(
myfile);
172 if ((fp_r = fopen(fn_r,
"rb")) ==
NULL)
200 while ((
len = fread(buff, 1, 0x10000, fp_r)) > 0)
307 fread(temp, 1, 4,
myfile);
308 if (0 != memcmp(temp,
"BZh", 3))
322 if ((fp_w = fopen(fn_w,
"wb")) ==
NULL)
372 fwrite(buff, 1,
len, fp_w);
457int __stdcall
execute(
char *infile,
char *outfile,
char *level,
int comando_bzip2_xcx1)
467 CloseHandle(myhandle);
470static int getpor_bzip2_xcx(int64_t max, int64_t fatia)
478 a = ((double)100 / max) * fatia;
527 if (!strcmp((
char *)argumento1,
"compress"))
530 strcpy(inputfile, (
char *)argumento2);
531 strcpy(outputfile, (
char *)argumento3);
532 execute(inputfile, outputfile, (
char *)argumento4, 0);
535 if (!strcmp((
char *)argumento1,
"compressbzip3"))
538 strcpy(inputfile, (
char *)argumento2);
539 strcpy(outputfile, (
char *)argumento3);
540 execute(inputfile, outputfile, (
char *)argumento4, 2);
544 if (!strcmp((
char *)argumento1,
"compressbzip3_sha512_k"))
547 strcpy(inputfile, (
char *)argumento2);
548 strcpy(outputfile, (
char *)argumento3);
549 execute(inputfile, outputfile, (
char *)argumento4, 4);
553 if (!strcmp((
char *)argumento1,
"decompress"))
556 strcpy(inputfile, (
char *)argumento2);
557 strcpy(outputfile, (
char *)argumento3);
558 execute(inputfile, outputfile, (
char *)argumento4, 1);
561 if (!strcmp((
char *)argumento1,
"decompressbzip3"))
564 strcpy(inputfile, (
char *)argumento2);
565 strcpy(outputfile, (
char *)argumento3);
566 execute(inputfile, outputfile, (
char *)argumento4, 3);
570 if (!strcmp((
char *)argumento1,
"status"))
572 return (
status(argumento2));
575 if (!strcmp((
char *)argumento1,
"getprogress"))
579 if (!strcmp((
char *)argumento1,
"bresume"))
583 if (!strcmp((
char *)argumento1,
"pause"))
587 if (!strcmp((
char *)argumento1,
"cancel"))
592 dprintf(
" loopenado no cancel\n");
599 if (!strcmp((
char *)argumento1,
"selectlibrary"))
601 strcpy(
library, (
char *)argumento2);
605 if (!strcmp((
char *)argumento1,
"thestatus"))
610 if (!strcmp((
char *)argumento1,
"intreturn"))
615 if (!strcmp((
char *)argumento1,
"setlevel"))
624 if (!strcmp((
char *)argumento1,
"getcpuname"))
629 if (!strcmp((
char *)argumento1,
"getbrandstring"))
665 static char buffer[50000];
666 va_start(args, format);
667 vsprintf(buffer, format, args);
668 val = MessageBox(0, buffer,
"BW", MB_OK | MB_TOPMOST);
677 mprintf2_bzip2_xcx(
"Win32 and Win64 DLL to compress files using bzip2 or bzip3 compression methods");
692 _time = (double)GetTickCount();
694 if ((CompressionLevel > 9) || (CompressionLevel < 0))
699 sprintf(level,
"w%d", CompressionLevel);
724 maxa = (maxa / 100) * porr;
742 a = (
b /
a) * (
float)100.0;
754 maxa = ((double)100.0 / maxa * fatiaa);
767 ret = (
unsigned int)value;
775 sprintf(
data,
"%02d:%02d:%02d:%03d", hour,
min, seg, frame);
782 void dprintf3(
char *format, ...);
786 double desloca = (double)GetTickCount();
794 dret = dret - (desloca -
_time);
808int __stdcall
CompressBzip3(
char *Inputfile,
char *OutPutFile,
int CompressionLevel)
821 _time = (double)GetTickCount();
823 if ((CompressionLevel > 9) || (CompressionLevel < 0))
828 sprintf(level,
"w%d", CompressionLevel);
852 _time = (double)GetTickCount();
854 if ((CompressionLevel > 9) || (CompressionLevel < 0))
859 sprintf(level,
"w%d", CompressionLevel);
896 _time = (double)GetTickCount();
913 _time = (double)GetTickCount();
void * LPVOID
Definition 7zTypes.h:200
#define FILE_ATTRIBUTE_ARCHIVE
Definition 7zTypes.h:147
UINT32 DWORD
Definition 7zTypes.h:194
#define __attribute__(unused_ric_since_2004)
Definition main_cr.c:84
#define min(a, b)
Definition compress42.c:304
Definition poolTests.c:28
void mprintf2_bzip2_xcx(char *format,...)
Definition bzip2dll.c:661
int unicodemode_bzip2_xcx
Definition bzip2dll.c:112
int __stdcall CancelCompress()
Definition bzip2dll.c:880
int secondtostring(double value, char *data)
Definition bzip2dll.c:759
#define AMANDA__SIZE
Definition bzip2dll.c:74
void dprintf(char *format,...)
Definition dprintf.c:96
void removedordeespaconoinicio(char *path)
int __stdcall ControlName_bzip2_xcx(char *data)
Definition bzip2dll.c:638
int __stdcall bzip2compress(char *infile, char *outfile, char *levelch)
Definition bzip2dll.c:142
int __stdcall startapi_bzip2_xcx(__attribute__((unused)) int parameter)
Definition bzip2dll.c:427
int __stdcall DecompressBzip3(char *Inputfile, char *OutPutFile)
Definition bzip2dll.c:903
int __stdcall GetTimeToFinish(char *data)
Definition bzip2dll.c:780
int __stdcall PauseCompress()
Definition bzip2dll.c:870
int __stdcall ResumeCompress()
Definition bzip2dll.c:875
int __stdcall getprogress()
Definition bzip2dll.c:481
double dgetval(double maxa, double porr)
Definition bzip2dll.c:722
char mylevel[255]
Definition bzip2dll.c:97
int __stdcall status(int newvalue)
Definition bzip2dll.c:513
int __stdcall GetStatus()
Definition bzip2dll.c:708
#define __INT32_OR_INT64
Definition bzip2dll.c:85
int __stdcall GetCPUVendor(char *data)
Definition bzip2dll.c:649
int levelok
Definition bzip2dll.c:108
char library[255]
Definition bzip2dll.c:98
double _time
Definition bzip2dll.c:637
int __stdcall CompressBzip3(char *Inputfile, char *OutPutFile, int CompressionLevel)
Definition bzip2dll.c:808
void removedordeespaconofinal(char *path)
double dgetmax(double por, double fatia)
Definition bzip2dll.c:732
char * getcpuname_k(void)
Definition cpu_fixed_z.c:233
int intcancel
Definition bzip2dll.c:100
char * getprocessorbrandstring_k(void)
Definition cpu_fixed_z.c:125
int __stdcall bresume(void)
Definition bzip2dll.c:421
int __stdcall interface1_bzip2_xcx(__INT32_OR_INT64 argumento1, __INT32_OR_INT64 argumento2, __INT32_OR_INT64 argumento3, __INT32_OR_INT64 argumento4)
Definition bzip2dll.c:523
int intstatus_bzip2_xcx
Definition bzip2dll.c:104
int __stdcall GetCPUBrandString(char *data)
Definition bzip2dll.c:655
char myoutfile[255]
Definition bzip2dll.c:95
int bzip3percent
Definition bzip3.c:204
int __stdcall About_bzip2_xcx()
Definition bzip2dll.c:675
int comando_bzip2_xcx
Definition bzip2dll.c:96
int __stdcall GetReturnValue_bzip2_xcx()
Definition bzip2dll.c:713
int intpause
Definition bzip2dll.c:99
int __stdcall cancel(void)
Definition bzip2dll.c:416
int __stdcall bzip2decompress(char *infile, char *outfile)
Definition bzip2dll.c:269
int intreturn
Definition bzip2dll.c:105
int modo
Definition bzip2dll.c:107
int __stdcall GetProgress_bzip2_xcx()
Definition bzip2dll.c:803
int __stdcall Compress_bzip2_xcx(char *Inputfile, char *OutPutFile, int CompressionLevel)
Definition bzip2dll.c:681
double dgetpor_bzip2_xcx(double maxa, double fatiaa)
Definition bzip2dll.c:746
int64_t filesize_bzip2_xcx
Definition bzip2dll.c:102
int utf8towide(const char *pUTF8, WCHAR *pUSC2, int nUSC2)
int __stdcall GetProgress()
Definition bzip2dll.c:921
char myinfile[255]
Definition bzip2dll.c:94
int64_t intfatia
Definition bzip2dll.c:103
int __stdcall CompressBzip3_SHA512_k(char *Inputfile, char *OutPutFile, int CompressionLevel)
Definition bzip2dll.c:839
int __stdcall pause(void)
Definition bzip2dll.c:410
__int64 getfilesize_bzip2_xcx_ar(char *infile_ar)
Definition bzip2dll.c:121
int __stdcall Decompress(char *Inputfile, char *OutPutFile)
Definition bzip2dll.c:885
void pedro_dprintf(int amanda_level, char *format,...)
Definition pedro.c:43
BZ_EXTERN BZFILE *BZ_API BZ2_bzopen(const char *path, const char *mode)
Definition bzlib.c:1802
BZ_EXTERN int BZ_API BZ2_bzwrite(BZFILE *b, void *buf, int len)
Definition bzlib.c:1833
BZ_EXTERN int BZ_API BZ2_bzread(BZFILE *b, void *buf, int len)
Definition bzlib.c:1816
void BZFILE
Definition bzlib.h:137
BZ_EXTERN void BZ_API BZ2_bzclose(BZFILE *b)
Definition bzlib.c:1856
BZ_EXTERN const char *BZ_API BZ2_bzerror(BZFILE *b, int *errnum)
Definition bzlib.c:1902
void * myfile
Definition dll.c:155
#define SEEK_END
Definition zconf.h:500
#define b(i)
Definition sha256.c:42
#define a(i)
Definition sha256.c:41
#define NULL
Definition getopt1.c:37
static uint32_t const uint8_t uint32_t len
Definition memcmplen.h:44
ret
Definition zlib_interface.c:30