libcaesium/demo/main.c

25 lines
542 B
C
Raw Normal View History

2016-11-14 18:56:24 +01:00
#include <stdio.h>
2017-02-25 10:17:33 +01:00
#include <stdlib.h>
2020-02-28 10:47:38 +01:00
#include <string.h>
2019-12-23 18:48:19 +01:00
#include "../caesium/caesium.h"
2017-02-25 10:17:33 +01:00
#include "config.h"
2016-11-04 11:00:04 +01:00
2016-11-14 18:56:24 +01:00
int main(int argc, char *argv[])
2016-11-04 11:00:04 +01:00
{
2020-02-28 10:47:38 +01:00
if (argc == 2 && strcmp(argv[1], "-v") == 0) {
fprintf(stdout, "%d.%d.%d\n", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH);
exit(EXIT_SUCCESS);
}
2017-02-25 10:17:33 +01:00
2016-11-14 18:56:24 +01:00
if (argc != 3) {
fprintf(stderr, "Wrong arguments.\nExiting.\n");
2017-02-25 10:17:33 +01:00
exit(EXIT_FAILURE);
2016-11-14 18:56:24 +01:00
}
2017-02-25 10:17:33 +01:00
2016-11-13 14:43:54 +01:00
cs_image_pars options = initialize_parameters();
2019-12-23 18:48:19 +01:00
int error_code = 0;
cs_compress(argv[1], argv[2], &options, &error_code);
2016-11-14 18:56:24 +01:00
2019-12-23 18:48:19 +01:00
exit(error_code);
2020-02-28 10:47:38 +01:00
}