43 #define SIZE_DEFAULT (64 KB)
44 #define SEED_DEFAULT 0
45 #define COMPRESSIBILITY_DEFAULT 50
51 #define DISPLAY(...) fprintf(stderr, __VA_ARGS__)
52 #define DISPLAYLEVEL(l, ...) if (displayLevel>=l) { DISPLAY(__VA_ARGS__); }
59 static int usage(
char* programName)
61 DISPLAY(
"Compressible data generator\n");
63 DISPLAY(
" %s [size] [args]\n", programName);
69 DISPLAY(
" -h : display help and exit\n");
71 DISPLAY(
" -P0 : generate incompressible noise\n");
72 DISPLAY(
" -P100 : generate sparse files\n");
81 double litProba = 0.0;
87 programName =
argv[0];
88 for(argNb=1; argNb<argc; argNb++)
90 char* argument =
argv[argNb];
92 if(!argument)
continue;
103 return usage(programName);
107 while ((*argument>=
'0') && (*argument<=
'9'))
110 size += *argument -
'0';
113 if (*argument==
'K') {
size <<= 10; argument++; }
114 if (*argument==
'M') {
size <<= 20; argument++; }
115 if (*argument==
'G') {
size <<= 30; argument++; }
116 if (*argument==
'B') { argument++; }
121 while ((*argument>=
'0') && (*argument<=
'9'))
124 seed += *argument -
'0';
131 while ((*argument>=
'0') && (*argument<=
'9'))
134 proba += *argument -
'0';
137 if (proba>100.) proba=100.;
143 while ((*argument>=
'0') && (*argument<=
'9'))
146 litProba += *argument -
'0';
149 if (litProba>100.) litProba=100.;
157 return usage(programName);
void RDG_genOut(unsigned long long size, double matchProba, double litProba, unsigned seed)
int main(int argc, char **argv)
static unsigned displayLevel
static int usage(char *programName)
#define DISPLAYLEVEL(l,...)
#define COMPRESSIBILITY_DEFAULT
static static fork const void static count static fd const char const char static newpath char char argv
#define LZ4_VERSION_STRING