Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
lz4cli.c File Reference
#include "platform.h"
#include "util.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lz4conf.h"
#include "bench.h"
#include "lz4io.h"
#include "lz4hc.h"
#include "lz4.h"

Macros

#define IO_MT   "single-thread"
 
#define COMPRESSOR_NAME   "lz4"
 
#define AUTHOR   "Yann Collet"
 
#define WELCOME_MESSAGE   "*** %s v%s %i-bit %s, by %s ***\n", COMPRESSOR_NAME, LZ4_versionString(), (int)(sizeof(void*)*8), IO_MT, AUTHOR
 
#define LZ4_EXTENSION   ".lz4"
 
#define LZ4CAT   "lz4cat"
 
#define UNLZ4   "unlz4"
 
#define LZ4_LEGACY   "lz4c"
 
#define KB   *(1U<<10)
 
#define MB   *(1U<<20)
 
#define GB   *(1U<<30)
 
#define DISPLAYOUT(...)
 
#define DISPLAY(...)
 
#define DISPLAYLEVEL(l, ...)
 
#define DEBUG   0
 
#define DEBUGOUTPUT(...)
 
#define END_PROCESS(error, ...)
 
#define DEFAULT_COMPRESSOR   LZ4IO_compressFilename
 
#define DEFAULT_DECOMPRESSOR   LZ4IO_decompressFilename
 
#define CLEAN_RETURN(i)
 
#define NEXT_FIELD(ptr)
 
#define NEXT_UINT32(val32)
 
#define ENV_NBTHREADS   "LZ4_NBWORKERS"
 
#define ENV_CLEVEL   "LZ4_CLEVEL"
 

Enumerations

enum  operationMode_e {
  om_auto , om_compress , om_decompress , om_test ,
  om_bench , om_list
}
 

Functions

int LZ4IO_compressFilename_Legacy (const char *input_filename, const char *output_filename, int compressionlevel, const LZ4IO_prefs_t *prefs)
 
int LZ4IO_compressMultipleFilenames_Legacy (const char **inFileNamesTable, int ifntSize, const char *suffix, int compressionLevel, const LZ4IO_prefs_t *prefs)
 
int main (int argCount, const char **argv)
 

Macro Definition Documentation

◆ AUTHOR

#define AUTHOR   "Yann Collet"

◆ CLEAN_RETURN

#define CLEAN_RETURN ( i)
Value:
{ operationResult = (i); goto _cleanup; }
lzma_index ** i
Definition index.h:629

◆ COMPRESSOR_NAME

#define COMPRESSOR_NAME   "lz4"

◆ DEBUG

#define DEBUG   0

◆ DEBUGOUTPUT

#define DEBUGOUTPUT ( ...)
Value:
do { if (DEBUG) DISPLAY(__VA_ARGS__); } while (0)
#define DISPLAY(...)
Definition lz4cli.c:83
#define DEBUG
Definition lz4cli.c:92

◆ DEFAULT_COMPRESSOR

#define DEFAULT_COMPRESSOR   LZ4IO_compressFilename

◆ DEFAULT_DECOMPRESSOR

#define DEFAULT_DECOMPRESSOR   LZ4IO_decompressFilename

◆ DISPLAY

#define DISPLAY ( ...)
Value:
fprintf(stderr, __VA_ARGS__)

◆ DISPLAYLEVEL

#define DISPLAYLEVEL ( l,
... )
Value:
do { if (displayLevel>=l) DISPLAY(__VA_ARGS__); } while (0)

◆ DISPLAYOUT

#define DISPLAYOUT ( ...)
Value:
fprintf(stdout, __VA_ARGS__)

◆ END_PROCESS

#define END_PROCESS ( error,
... )
Value:
do { \
DEBUGOUTPUT("Error in %s, line %i : \n", __FILE__, __LINE__); \
DISPLAYLEVEL(1, "Error %i : ", error); \
DISPLAYLEVEL(1, __VA_ARGS__); \
DISPLAYLEVEL(1, "\n"); \
exit(error); \
} while (0)
void error(char *msg) const
Definition minigzip.c:356

◆ ENV_CLEVEL

#define ENV_CLEVEL   "LZ4_CLEVEL"

◆ ENV_NBTHREADS

#define ENV_NBTHREADS   "LZ4_NBWORKERS"

◆ GB

#define GB   *(1U<<30)

◆ IO_MT

#define IO_MT   "single-thread"

◆ KB

#define KB   *(1U<<10)

◆ LZ4_EXTENSION

#define LZ4_EXTENSION   ".lz4"

◆ LZ4_LEGACY

#define LZ4_LEGACY   "lz4c"

◆ LZ4CAT

#define LZ4CAT   "lz4cat"

◆ MB

#define MB   *(1U<<20)

◆ NEXT_FIELD

#define NEXT_FIELD ( ptr)
Value:
{ \
if (*argument == '=') { \
ptr = ++argument; \
argument += strlen(ptr); \
} else { \
argNb++; \
if (argNb >= argCount) { \
DISPLAYLEVEL(1, "error: missing command argument \n"); \
CLEAN_RETURN(1); \
} \
ptr = argv[argNb]; \
assert(ptr != NULL); \
if (ptr[0]=='-') { \
DISPLAYLEVEL(1, "error: command cannot be separated from its argument by another command \n"); \
CLEAN_RETURN(1); \
} } }
#define NULL
Definition getopt1.c:37

◆ NEXT_UINT32

#define NEXT_UINT32 ( val32)
Value:
{ \
const char* __nb; \
NEXT_FIELD(__nb); \
val32 = readU32FromChar(&__nb); \
if(*__nb != 0) { \
errorOut("error: only numeric values with optional suffixes K, KB, KiB, M, MB, MiB are allowed"); \
} \
}

◆ UNLZ4

#define UNLZ4   "unlz4"

◆ WELCOME_MESSAGE

#define WELCOME_MESSAGE   "*** %s v%s %i-bit %s, by %s ***\n", COMPRESSOR_NAME, LZ4_versionString(), (int)(sizeof(void*)*8), IO_MT, AUTHOR

Enumeration Type Documentation

◆ operationMode_e

Enumerator
om_auto 
om_compress 
om_decompress 
om_test 
om_bench 
om_list 

Function Documentation

◆ LZ4IO_compressFilename_Legacy()

int LZ4IO_compressFilename_Legacy ( const char * input_filename,
const char * output_filename,
int compressionlevel,
const LZ4IO_prefs_t * prefs )

◆ LZ4IO_compressMultipleFilenames_Legacy()

int LZ4IO_compressMultipleFilenames_Legacy ( const char ** inFileNamesTable,
int ifntSize,
const char * suffix,
int compressionLevel,
const LZ4IO_prefs_t * prefs )

◆ main()

int main ( int argCount,
const char ** argv )