![]() |
Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
|
#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 <stdbool.h>#include <process.h>#include "helper_utilities_by_amanda_and_ricardo.c"#include <sys/types.h>#include <sys/stat.h>#include <unistd.h>#include "patchlevel.h"Data Structures | |
| struct | utimbuf |
| union | bytes |
Macros | |
| #define | __attribute__(unused) |
| #define | uchar unsigned char |
| #define | uint unsigned int |
| #define | ushort unsigned short |
| #define | __attribute__(unused) |
| #define | ARGS(a) |
| #define | SIG_TYPE void (*)() |
| #define | lstat stat |
| #define | min(a, b) |
| #define | IBUFSIZ BUFSIZ /* Defailt input buffer size */ |
| #define | OBUFSIZ BUFSIZ /* Default output buffer size */ |
| #define | MAGIC_1 (char_type)'\037' /* First byte of compressed file */ |
| #define | MAGIC_2 (char_type)'\235' /* Second byte of compressed file */ |
| #define | BIT_MASK 0x1f /* Mask for 'number of compresssion bits' */ |
| #define | BLOCK_MODE 0x80 /* Block compresssion if table is full and */ |
| #define | FIRST 257 /* first free entry */ |
| #define | CLEAR 256 /* table clear output code */ |
| #define | INIT_BITS 9 /* initial number of bits/code */ |
| #define | SACREDMEM 0 |
| #define | USERMEM 450000 /* default user memory */ |
| #define | BYTEORDER 0000 |
| #define | NOALLIGN 0 |
| #define | O_BINARY 0 /* System has no binary mode */ |
| #define | BITS 16 |
| #define | HSIZE 69001 /* 95% occupancy */ |
| #define | CHECK_GAP 10000 |
| #define | ARGVAL() |
| #define | MAXCODE(n) |
| #define | REGISTERS 2 |
| #define | REG1 |
| #define | REG2 |
| #define | REG3 |
| #define | REG4 |
| #define | REG5 |
| #define | REG6 |
| #define | REG7 |
| #define | REG8 |
| #define | REG9 |
| #define | REG10 |
| #define | REG11 |
| #define | REG12 |
| #define | REG13 |
| #define | REG14 |
| #define | REG15 |
| #define | REG16 |
| #define | REG1 register |
| #define | REG2 register |
| #define | output(b, o, c, n) |
| #define | input(b, o, c, n, m) |
| #define | htabof(i) |
| #define | codetabof(i) |
| #define | tab_prefixof(i) |
| #define | tab_suffixof(i) |
| #define | de_stack ((char_type *)&(htab[HSIZE - 1])) |
| #define | clear_htab() |
| #define | clear_tab_prefixof() |
| #define | fc fcode.code |
Typedefs | |
| typedef long int | code_int |
| typedef long int | count_int |
| typedef long int | cmp_code_int |
| typedef unsigned char | char_type |
Functions | |
| 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) | |
| 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.... | |
| __int64 | lffilesize_dl (const char *szFileName) |
| default function to get the size of files with Unicode support | |
| void Usage | ARGS ((int)) |
| void comprexx | ARGS ((const char *)) |
| void compdir | ARGS ((char *)) |
| int compress | ARGS ((int, int)) |
| void read_error | ARGS ((void)) |
| void prratio | ARGS ((FILE *, long, long)) |
| int | main_old (REG1 int argc, argv) |
| void | Usage (int status) |
| void | comprexx (char *fileptr) const |
| int | compress (int fdin, int fdout) |
| int | decompress (int fdin, int fdout) |
| void | read_error () |
| void | write_error () |
| void | abort_compress () |
| void | prratio (FILE *stream, long int num, long int den) |
| void | about () |
| int __stdcall | compress_co___rspk_ar (char *Input_amanda_file_utf_8, char *OutPut_ricardo_File_utf_8, __attribute__((unused)) int Compression_juliete_Level_unused___) |
| Function to compress a file using the Unix compress method. | |
| int __stdcall | uncompress_co___rspk_ar (char *Input_amanda_file_utf_8, char *OutPut_ricardo_File_utf_8) |
| Function to uncompress a Unix compress based file. | |
| int __stdcall | get_progress_co___ar (void) |
| int __stdcall | pause_co___aakp_co___ar (void) |
| int __stdcall | resume_co___aakp_co___ar (void) |
| int __stdcall | cancel_co___aakp_co___ar (void) |
Variables | |
| char * | progname |
| int | silent = 0 |
| int | quiet = 1 |
| int | do_decomp = 0 |
| int | force = 0 |
| int | nomagic = 0 |
| int | block_mode = BLOCK_MODE |
| int | maxbits = BITS |
| int | zcat_flg = 0 |
| int | recursive = 0 |
| int | exit_code = -1 |
| char_type | inbuf [IBUFSIZ+64] |
| char_type | outbuf [OBUFSIZ+2048] |
| struct stat | infstat |
| char * | ifname |
| int | remove_ofname = 0 |
| char * | ofname = NULL |
| int | fgnd_flag = 0 |
| long | bytes_in |
| long | bytes_out |
| count_int | htab [HSIZE] |
| unsigned short | codetab [HSIZE] |
| #define __attribute__ | ( | unused | ) |
| #define __attribute__ | ( | unused | ) |
| #define ARGS | ( | a | ) |
| #define ARGVAL | ( | ) |
| #define BIT_MASK 0x1f /* Mask for 'number of compresssion bits' */ |
| #define BITS 16 |
| #define BYTEORDER 0000 |
| #define CHECK_GAP 10000 |
| #define clear_htab | ( | ) |
| #define clear_tab_prefixof | ( | ) |
| #define fc fcode.code |
| #define FIRST 257 /* first free entry */ |
| #define HSIZE 69001 /* 95% occupancy */ |
| #define INIT_BITS 9 /* initial number of bits/code */ |
| #define lstat stat |
| #define MAGIC_1 (char_type)'\037' /* First byte of compressed file */ |
| #define MAGIC_2 (char_type)'\235' /* Second byte of compressed file */ |
| #define MAXCODE | ( | n | ) |
| #define NOALLIGN 0 |
| #define O_BINARY 0 /* System has no binary mode */ |
| #define REG1 |
| #define REG1 register |
| #define REG10 |
| #define REG11 |
| #define REG12 |
| #define REG13 |
| #define REG14 |
| #define REG15 |
| #define REG16 |
| #define REG2 |
| #define REG2 register |
| #define REG3 |
| #define REG4 |
| #define REG5 |
| #define REG6 |
| #define REG7 |
| #define REG8 |
| #define REG9 |
| #define REGISTERS 2 |
| #define SACREDMEM 0 |
| #define SIG_TYPE void (*)() |
| #define tab_prefixof | ( | i | ) |
| #define uchar unsigned char |
| #define uint unsigned int |
| #define USERMEM 450000 /* default user memory */ |
| #define ushort unsigned short |
| typedef unsigned char char_type |
| typedef long int cmp_code_int |
| void abort_compress | ( | ) |
| void about | ( | ) |
| void compdir ARGS | ( | (char *) | ) |
| void prratio ARGS | ( | (FILE *, long, long) | ) |
| int decompress ARGS | ( | (int, int) | ) |
| static void about ARGS | ( | (void) | ) |
| int __stdcall cancel_co___aakp_co___ar | ( | void | ) |
| int __stdcall compress_co___rspk_ar | ( | char * | Input_amanda_file_utf_8, |
| char * | OutPut_ricardo_File_utf_8, | ||
| __attribute__((unused)) int | Compression_juliete_Level_unused___ ) |
Function to compress a file using the Unix compress method.
| Input_amanda_file_utf_8 | utf-8 encoded input file |
| OutPut_ricardo_File_utf_8 | utf-8 encoded output file |
0 - No error
1 - Cannot open input file
2 - Cannot open destination file
3 - Cannot close input file
4 - Cannot close output file
5 - Cannot read from input file
6 - Cannot write to output file
119 - User cancel
| void comprexx | ( | char * | fileptr | ) | const |
| int __stdcall get_progress_co___ar | ( | void | ) |
| __int64 lffilesize_dl | ( | const char * | szFileName | ) |
default function to get the size of files with Unicode support
| szFileName | utf-8 encoded file |
| int __stdcall pause_co___aakp_co___ar | ( | void | ) |
| 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
| amanda_level | if equal or above 0 print the string |
| format | printf based format |
| ... |
| void read_error | ( | ) |
| int __stdcall resume_co___aakp_co___ar | ( | void | ) |
| int __stdcall uncompress_co___rspk_ar | ( | char * | Input_amanda_file_utf_8, |
| char * | OutPut_ricardo_File_utf_8 ) |
Function to uncompress a Unix compress based file.
| Input_amanda_file_utf_8 | utf-8 encoded input file |
| OutPut_ricardo_File_utf_8 | utf-8 encoded output file |
0 - No error
1 - Cannot open input file
2 - Cannot open output file
3 - Cannot close input file
4 - Cannot close output file
5 - Cannot read from input file
6 - Cannot write to output file
7 - Not a valid compressed file
119 - User cancel
| void Usage | ( | int | status | ) |
| 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)
| pUTF8 |
| void write_error | ( | ) |
| int block_mode = BLOCK_MODE |
| long bytes_in |
| long bytes_out |
| unsigned short codetab[HSIZE] |
| int do_decomp = 0 |
| int exit_code = -1 |
| int fgnd_flag = 0 |
| int force = 0 |
| char* ifname |
| struct stat infstat |
| int nomagic = 0 |
| char* ofname = NULL |
| char* progname |
| int quiet = 1 |
| int recursive = 0 |
| int remove_ofname = 0 |
| int silent = 0 |
| int zcat_flg = 0 |