Skip to content
Snippets Groups Projects
Select Git revision
  • 5b34c1fe0ecea9f8da80675b4adf6a0c33a122e8
  • master default protected
  • cmp_tool-improvement
  • v0.15
  • v0.14
  • v0.13
  • v0.12
  • v0.11
  • v0.09
  • v0.08
  • v0.07
  • v0.06
  • v0.05
13 results

cmp_tool.c

Blame
  • 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},