Select Git revision
-
Dominik Loidolt authored
Implement the compression entity header as defined in PLATO-UVIE-PL-UM-0001 for compression and decompression
Dominik Loidolt authoredImplement the compression entity header as defined in PLATO-UVIE-PL-UM-0001 for compression and decompression
cmp_tool.c 19.84 KiB
/**
* @file cmp_tool.c
* @author Johannes Seelig (johannes.seelig@univie.ac.at)
* @author Dominik Loidolt (dominik.loidolt@univie.ac.at)
* @date 2020
*
* @copyright GPLv2
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* @brief command line tool for PLATO ICU/RDCU compression/decompression
* @see README.md
* @see Data Compression User Manual PLATO-UVIE-PL-UM-0001
*/
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <getopt.h>
#include <time.h>
#include "include/cmp_tool_lib.h"
#include "include/cmp_icu.h"
#include "include/decmp.h"
#include "include/cmp_guess.h"
#include "include/cmp_entity.h"
#include "include/rdcu_pkt_to_file.h"
#define VERSION "0.07"
#define BUFFER_LENGTH_DEF_FAKTOR 2
#define DEFAULT_MODEL_ID 53264 /* random id used as default */
#define DEFAULT_MODEL_COUNTER 0
/*
* For long options that have no equivalent short option, use a
* non-character as a pseudo short option, starting with CHAR_MAX + 1.
*/
enum {
DIFF_CFG_OPTION = CHAR_MAX + 1,
GUESS_OPTION,
GUESS_LEVEL,
RDCU_PKT_OPTION,
LAST_INFO,
NO_HEADER,
MODEL_ID,
MODEL_COUTER,
};
static const struct option long_options[] = {
{"rdcu_par", no_argument, NULL, 'a'},
{"model_cfg", no_argument, NULL, 'n'},
{"help", no_argument, NULL, 'h'},
{"verbose", no_argument, NULL, 'v'},
{"version", no_argument, NULL, 'V'},
{"rdcu_pkt", no_argument, NULL, RDCU_PKT_OPTION},
{"diff_cfg", no_argument, NULL, DIFF_CFG_OPTION},
{"guess", required_argument, NULL, GUESS_OPTION},
{"guess_level", required_argument, NULL, GUESS_LEVEL},
{"last_info", required_argument, NULL, LAST_INFO},