Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
compress2_2_z.c File Reference
#include <windows.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <errno.h>
#include <fcntl.h>
#include <ctype.h>
#include <math.h>
#include <wctype.h>
#include <wchar.h>
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <locale.h>
#include <signal.h>
#include <limits.h>
#include <float.h>
#include <iso646.h>
#include <assert.h>
#include "stdio_v2.h"
#include "stdio_v3.h"
#include <process.h>
#include "win64.h"
#include "lzop2_multi.c"

Data Structures

struct  _rspdata
 

Macros

#define uchar   unsigned char
 
#define uint   unsigned int
 
#define ulong   unsigned long
 
#define ushort   unsigned short
 
#define __valquiriacall   __fastcall
 
#define AMANDA__SIZE   ((32767 * 6) + 2)
 
#define AMANDA__SIZE_w   (32767)
 
#define AMANDA__SIZE_ww   ((32767 * 2) + 2)
 
#define __amandacall   __stdcall
 
#define MAX_MEMORY_SIZE_Z   (16 * 1024 * 1024)
 
#define CHUNK   (32768 * 2 * 2) /* it is a good slice of data */
 

Typedefs

typedef struct _rspdata rspdata
 

Functions

void pedro_dprintf2 (int amanda_level, char *format,...)
 pedro_dprintf2 is my variant of my debug function because too much calls to pedro_dprintf these days, I am lazy, sorry....
 
WCHAR * utf8_2_wide_dl (const char *pUTF8)
 my temporary utf8_2_wide_dl function to add full Unicode support and future (when modified) support to long filenames. (jan/2025)
 
int compress2_uncompress_k_mt_z (char *input, char *output)
 function to uncompress a not standard lzop2 multi-thread file, being added full Unicode support and soon long filenames support (possible jan/2025)
 
void pedro_dprintf (int amanda_level, char *format,...)
 
FILE * fopen_utf8_z (char *filename_z, char *mode)
 
void mprintf (char *format,...)
 
uint getpor (int max, uint fatia)
 
void dprintf (char *format,...)
 
int __stdcall execute ()
 
int start ()
 
int start2 ()
 
HANDLE lfopen (const char *szFileName, char *pMode)
 
void lfclose (HANDLE hFile)
 
__int64 lfseek (HANDLE hFile, __int64 iDistance, int iMode)
 
__int64 lftell (HANDLE hFile)
 
__int64 lffilesize (const char *szFileName)
 simple function to get the size of a utf-8 encoded filename, no support to long filenames yet (above MAX_PATH)
 
unsigned long lfread (void *pBuffer, unsigned long ulCount, HANDLE hFile)
 
unsigned long lfwrite (void *pBuffer, unsigned long ulCount, HANDLE hFile)
 
int setendofile (HANDLE file, __int64 position)
 
int createtempfilename_and_keep_z_8 (char *path1, char *out_z, char *signature_z)
 Create a tempfilename with in ANSI format (28/dec/2024), if you plan to allow other temp paths in the future you need to change this function.
 
int compress2_compress_k (char *input, char *output, int levelin)
 This is the function to compress using lzop2 (lzop with multi-thread support)
 
int compress2_uncompress (char *input, char *output)
 
int __amandacall get_multithread_progress_8 (void)
 

Variables

CRITICAL_SECTION lpCriticalSection_charli_lzop2
 
bool is_multi_thread_z_8 = false
 
int intpause_8
 
int intcancel_8
 
char temp_path_z_8 []
 
int finished_8 = 0
 
int intstatus_8
 
int n_threads_z_8
 
int64_t bytes__read_thread_z_8 [129]
 
__INT32_OR_INT64 my_thread_handle_8 [129]
 
char temp_files_z_8 [129][2048]
 
int thread_return_value_z_8
 

Macro Definition Documentation

◆ __amandacall

#define __amandacall   __stdcall

◆ __valquiriacall

#define __valquiriacall   __fastcall

◆ AMANDA__SIZE

#define AMANDA__SIZE   ((32767 * 6) + 2)

The maximum size of an utf-8 encoded filename with the max limit of a file in Windows

◆ AMANDA__SIZE_w

#define AMANDA__SIZE_w   (32767)

The maximum size of Unicode characters in a path in Windows, Linux is 1024 characters as far I know

◆ AMANDA__SIZE_ww

#define AMANDA__SIZE_ww   ((32767 * 2) + 2)

◆ CHUNK

#define CHUNK   (32768 * 2 * 2) /* it is a good slice of data */

◆ MAX_MEMORY_SIZE_Z

#define MAX_MEMORY_SIZE_Z   (16 * 1024 * 1024)

◆ uchar

#define uchar   unsigned char

◆ uint

#define uint   unsigned int

◆ ulong

#define ulong   unsigned long

◆ ushort

#define ushort   unsigned short

Typedef Documentation

◆ rspdata

typedef struct _rspdata rspdata

Function Documentation

◆ compress2_compress_k()

int compress2_compress_k ( char * input,
char * output,
int levelin )

This is the function to compress using lzop2 (lzop with multi-thread support)

Parameters
inpututf-8 encode uncompressed file
outpututf-8 destination compressed lzop2 file
levelinnot in use, at least this release
Returns
int
0 - No error
1 - Cannot open input file
2 - Cannot open output file
5 - Cannot read from input file
6 - Cannot write to output file
8 - Compression error
119 - User cancel
400 - Cannot write to temp file
403 - File access error
405 - Cannot open output temp file
407 - Cannot create temp file

◆ compress2_uncompress()

int compress2_uncompress ( char * input,
char * output )

◆ compress2_uncompress_k_mt_z()

int compress2_uncompress_k_mt_z ( char * input,
char * output )

function to uncompress a not standard lzop2 multi-thread file, being added full Unicode support and soon long filenames support (possible jan/2025)

Parameters
inpututf-8 encoded file
outpututf-8 encoded file
Returns
int

0 - No error
1 - Cannot open input file
2 - Cannot open output file
5 - Cannot read from input file
6 - Cannot write to output file
7 - Invalid lzop2 file
8 - Decompression error
119 - User cancel
403 - File access error
405 - Cannotm open output file
407 - Cannot create temp file

◆ createtempfilename_and_keep_z_8()

int createtempfilename_and_keep_z_8 ( char * path1,
char * out_z,
char * signature_z )

Create a tempfilename with in ANSI format (28/dec/2024), if you plan to allow other temp paths in the future you need to change this function.

Parameters
path1
out_z
signature_z
Returns
int

◆ dprintf()

void dprintf ( char * format,
... )

◆ execute()

int __stdcall execute ( )

◆ fopen_utf8_z()

FILE * fopen_utf8_z ( char * filename_z,
char * mode )

◆ get_multithread_progress_8()

int __amandacall get_multithread_progress_8 ( void )

◆ getpor()

uint getpor ( int max,
uint fatia )

◆ lfclose()

void lfclose ( HANDLE hFile)

◆ lffilesize()

__int64 lffilesize ( const char * szFileName)

simple function to get the size of a utf-8 encoded filename, no support to long filenames yet (above MAX_PATH)

to get the file input size, with support to files above 2gb, and unicode support

Parameters
szFileNameutf-8 encoded filename
Returns
__int64
Parameters
szFileNamethe utf-8 encoded input file
Returns
__int64
Parameters
szFileNameutf-8 encoded filename
Returns
__int64

simple function to get the size of a utf-8 encoded filename, no support to long filenames yet (above MAX_PATH)

Parameters
szFileNamethe utf-8 encoded input file
Returns
__int64

◆ lfopen()

HANDLE lfopen ( const char * szFileName,
char * pMode )

◆ lfread()

unsigned long lfread ( void * pBuffer,
unsigned long ulCount,
HANDLE hFile )

◆ lfseek()

__int64 lfseek ( HANDLE hFile,
__int64 iDistance,
int iMode )

◆ lftell()

__int64 lftell ( HANDLE hFile)

◆ lfwrite()

unsigned long lfwrite ( void * pBuffer,
unsigned long ulCount,
HANDLE hFile )

◆ mprintf()

void mprintf ( char * format,
... )

◆ pedro_dprintf()

void pedro_dprintf ( int amanda_level,
char * format,
... )

◆ pedro_dprintf2()

void pedro_dprintf2 ( int amanda_level,
char * format,
... )

pedro_dprintf2 is my variant of my debug function because too much calls to pedro_dprintf these days, I am lazy, sorry....

em brotli or brotli2

Parameters
amanda_levelif equal or above 0 print the string
formatprintf based format
...

◆ setendofile()

int setendofile ( HANDLE file,
__int64 position )

◆ start()

int start ( )

◆ start2()

int start2 ( )

◆ utf8_2_wide_dl()

WCHAR * utf8_2_wide_dl ( const char * pUTF8)

my temporary utf8_2_wide_dl function to add full Unicode support and future (when modified) support to long filenames. (jan/2025)

Parameters
pUTF8
Returns
WCHAR*

Variable Documentation

◆ bytes__read_thread_z_8

int64_t bytes__read_thread_z_8[129]

◆ finished_8

int finished_8 = 0

◆ intcancel_8

int intcancel_8
extern

◆ intpause_8

int intpause_8
extern

◆ intstatus_8

int intstatus_8
extern

◆ is_multi_thread_z_8

bool is_multi_thread_z_8 = false

◆ lpCriticalSection_charli_lzop2

CRITICAL_SECTION lpCriticalSection_charli_lzop2

◆ my_thread_handle_8

__INT32_OR_INT64 my_thread_handle_8[129]

◆ n_threads_z_8

int n_threads_z_8
extern

◆ temp_files_z_8

char temp_files_z_8[129][2048]

◆ temp_path_z_8

char temp_path_z_8[]
extern

◆ thread_return_value_z_8

int thread_return_value_z_8