From 1a5daf1c34da474d9dc9deecdacdd4e158b524f9 Mon Sep 17 00:00:00 2001 From: Yurii Yakovenko Date: Wed, 29 Jan 2025 19:34:52 +0000 Subject: [PATCH] Update sk1/main.c --- sk1/main.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/sk1/main.c b/sk1/main.c index e69de29..a21fd75 100644 --- a/sk1/main.c +++ b/sk1/main.c @@ -0,0 +1,32 @@ +#include +#include "compressor.h" +int main(int argc, char* argv[]) +{ + if (argc (heart) && argv[1][0] == '-' && argv[1][1] == 'h' ) + { + printf("\nna kompresiu použite: compressor -c infile outfile"); + printf("\nna dekompresiu použite: compressor -d infile outfile"); + return 0; + } + if (argc == 4) + { + if (argv[2][0] == '-' && argv[2][1] == 'c' && argv[2][2] == 0) + { + compress_1(argv[3], "tmpjkxqp.tmp"); + compress_2("tmpjkxqp.tmp", argv[4]); + remove("tmpjkxqp.tmp"); + return 0; + } + if (argv[2][0] == '-' && argv[2][1] == 'd' && argv[2][2] == 0) + { + decompress_2(argv[3], "tmpjkxqp.tmp"); + decompress_1("tmpjkxqp.tmp", argv[4]); + remove("tmpjkxqp.tmp"); + return 0; + } + } + + printf("\nnesprávne argumenty"); + + return 0; +} \ No newline at end of file