CMSIS2000
0.0.7
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "lz4.h"
#include "lz4hc.h"
#include "bench.h"
Go to the source code of this file.
Macros | |
#define | _CRT_SECURE_NO_DEPRECATE |
#define | _CRT_SECURE_NO_WARNINGS |
#define | ARCHIVE_MAGICNUMBER 0x184C2102 |
#define | ARCHIVE_MAGICNUMBER_SIZE 4 |
#define | AUTHOR "Yann Collet" |
#define | CACHELINE 64 |
#define | CHUNKSIZE (8<<20) |
#define | COMPILED __DATE__ |
#define | COMPRESSOR_NAME "Compression CLI using LZ4 algorithm" |
#define | COMPRESSOR_VERSION "" |
#define | CPU_BIG_ENDIAN (!CPU_LITTLE_ENDIAN) |
#define | CPU_LITTLE_ENDIAN (*(char*)(&one)) |
#define | DISPLAY(...) fprintf(stderr, __VA_ARGS__) |
#define | EXTENSION ".lz4" |
#define | GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) |
#define | LITTLE_ENDIAN32(i) if (CPU_BIG_ENDIAN) { i = swap32(i); } |
#define | WELCOME_MESSAGE "*** %s %s, by %s (%s) ***\n", COMPRESSOR_NAME, COMPRESSOR_VERSION, AUTHOR, COMPILED |
Functions | |
int | badusage (char *exename) |
int | compress_file (char *input_filename, char *output_filename, int compressionlevel) |
int | decode_file (char *input_filename, char *output_filename) |
int | get_fileHandle (char *input_filename, char *output_filename, FILE **pfinput, FILE **pfoutput) |
int | main (int argc, char **argv) |
static unsigned int | swap32 (unsigned int x) |
int | usage (char *exename) |
Variables | |
static const int | one = 1 |
#define ARCHIVE_MAGICNUMBER 0x184C2102 |
Definition at line 86 of file lz4demo.c.
Referenced by compress_file(), and decode_file().
#define ARCHIVE_MAGICNUMBER_SIZE 4 |
Definition at line 87 of file lz4demo.c.
Referenced by compress_file(), and decode_file().
#define CHUNKSIZE (8<<20) |
Definition at line 84 of file lz4demo.c.
Referenced by compress_file(), and decode_file().
#define COMPRESSOR_NAME "Compression CLI using LZ4 algorithm" |
#define CPU_BIG_ENDIAN (!CPU_LITTLE_ENDIAN) |
#define DISPLAY | ( | ... | ) | fprintf(stderr, __VA_ARGS__) |
Definition at line 102 of file lz4demo.c.
Referenced by badusage(), compress_file(), decode_file(), get_fileHandle(), main(), and usage().
#define LITTLE_ENDIAN32 | ( | i | ) | if (CPU_BIG_ENDIAN) { i = swap32(i); } |
Definition at line 96 of file lz4demo.c.
Referenced by compress_file(), and decode_file().
#define WELCOME_MESSAGE "*** %s %s, by %s (%s) ***\n", COMPRESSOR_NAME, COMPRESSOR_VERSION, AUTHOR, COMPILED |
int badusage | ( | char * | exename | ) |
int compress_file | ( | char * | input_filename, |
char * | output_filename, | ||
int | compressionlevel | ||
) |
Definition at line 167 of file lz4demo.c.
References ARCHIVE_MAGICNUMBER, ARCHIVE_MAGICNUMBER_SIZE, CHUNKSIZE, DISPLAY, get_fileHandle(), LITTLE_ENDIAN32, LZ4_compress(), LZ4_compressBound(), and LZ4_compressHC().
Referenced by main().
int decode_file | ( | char * | input_filename, |
char * | output_filename | ||
) |
Definition at line 248 of file lz4demo.c.
References ARCHIVE_MAGICNUMBER, ARCHIVE_MAGICNUMBER_SIZE, CHUNKSIZE, chunkSize, DISPLAY, get_fileHandle(), LITTLE_ENDIAN32, LZ4_compressBound(), and LZ4_uncompress_unknownOutputSize().
Referenced by main().
int get_fileHandle | ( | char * | input_filename, |
char * | output_filename, | ||
FILE ** | pfinput, | ||
FILE ** | pfoutput | ||
) |
Definition at line 134 of file lz4demo.c.
References DISPLAY.
Referenced by compress_file(), and decode_file().
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 320 of file lz4demo.c.
References badusage(), BMK_benchFile(), BMK_SetBlocksize(), BMK_SetNbIterations(), BMK_SetPause(), compress_file(), decode_file(), DISPLAY, usage(), and WELCOME_MESSAGE.
int usage | ( | char * | exename | ) |
Definition at line 108 of file lz4demo.c.
References DISPLAY.
Referenced by badusage(), and main().