2017-10-07 03:48:38 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include "inflate_std_vects.h"
|
|
|
|
|
2018-06-16 00:54:59 +02:00
|
|
|
#define DNAME_MAX 256
|
|
|
|
#define FNAME_MAX (DNAME_MAX + 81)
|
2017-10-07 03:48:38 +02:00
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
uint8_t *buf;
|
|
|
|
int i, len, err;
|
|
|
|
FILE *fout = NULL;
|
|
|
|
char fname[FNAME_MAX];
|
2018-06-16 00:54:59 +02:00
|
|
|
char dname[DNAME_MAX];
|
2017-10-07 03:48:38 +02:00
|
|
|
|
|
|
|
if (argc != 2) {
|
|
|
|
fprintf(stderr, "Usage: %s <outdir>\n", argv[0]);
|
|
|
|
exit(1);
|
|
|
|
}
|
2018-06-16 00:54:59 +02:00
|
|
|
strncpy(dname, argv[1], DNAME_MAX - 1);
|
2017-10-07 03:48:38 +02:00
|
|
|
|
|
|
|
for (i = 0; i < sizeof(std_vect_array) / sizeof(struct vect_result); i++) {
|
|
|
|
buf = std_vect_array[i].vector;
|
|
|
|
len = std_vect_array[i].vector_length;
|
|
|
|
err = std_vect_array[i].expected_error;
|
|
|
|
|
2018-06-16 00:54:59 +02:00
|
|
|
snprintf(fname, FNAME_MAX, "%s/inflate_corp_n%04d_e%04d", dname, i, err);
|
2017-10-07 03:48:38 +02:00
|
|
|
printf(" writing %s\n", fname);
|
|
|
|
fout = fopen(fname, "w+");
|
|
|
|
if (!fout) {
|
|
|
|
fprintf(stderr, "Can't open %s for writing\n", fname);
|
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
fwrite(buf, len, 1, fout);
|
|
|
|
fclose(fout);
|
|
|
|
}
|
2018-11-13 21:44:25 +01:00
|
|
|
|
|
|
|
return 0;
|
2017-10-07 03:48:38 +02:00
|
|
|
}
|