From c02caaf2ffb2808655681493271660c549de2324 Mon Sep 17 00:00:00 2001 From: C-3PO Date: Fri, 14 Sep 2018 00:56:32 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=91=20Remove=20unused=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 4 +++- src/main.c | 27 ++++++--------------------- 2 files changed, 9 insertions(+), 22 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 54092be..d5421a6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,7 +4,9 @@ "decrypt.h": "c", "stdint.h": "c", "decryptutilities.h": "c", - "fileutilities.h": "c" + "fileutilities.h": "c", + "stdio.h": "c", + "stdlib.h": "c" }, "cSpell.words": [ "init", diff --git a/src/main.c b/src/main.c index a2d6e29..ea3a849 100644 --- a/src/main.c +++ b/src/main.c @@ -1,4 +1,3 @@ -#include #include #include #include @@ -38,10 +37,7 @@ struct arguments { unsigned long fileSize; //Decryption keys bool isEncrypted; - uint32_t key0; - uint32_t key1; - uint32_t key2; - //TODO: For xdelta3, the location of the old file + //For xdelta3, the location of the old file char* prevFile; }; @@ -65,7 +61,7 @@ int main(int argc, char *argv[]) { //in this variable, getopt_long stores the current position in the command line args array int option_index = 0; - int curOption = getopt_long(argc, argv, "d:o:s:k:", long_options, &option_index); + int curOption = getopt_long(argc, argv, "d:o:s:k:p:", long_options, &option_index); //end of command line arguments reached if (curOption == -1) { @@ -95,6 +91,9 @@ int main(int argc, char *argv[]) { state.isEncrypted = true; break; } + case 'p': //prev file for xdelta3 + //TODO + break; default: fprintf(stderr, "Unknown option '%c'.", (char)curOption); exit(1); @@ -106,20 +105,6 @@ int main(int argc, char *argv[]) { exit(1); } - //TODO: verify argv and assign it to variables - //char* archiveName = argv[1]; - //const unsigned long archiveOffset = atol(argv[2]); - //const unsigned long fileLength = atol(argv[3]); - - //const bool isEncrypted = argc == 7; - /*if (isEncrypted) { - uint32_t key0 = atoi(argv[4]); - uint32_t key1 = atoi(argv[5]); - uint32_t key2 = atoi(argv[6]); - //Initialize decryption (pass decryption keys) - initDecryptor(key0, key1, key2); - }*/ - //------------------------------------------------- uint8_t* compressedChunk = malloc(BUFFER_SIZE); @@ -201,7 +186,7 @@ int main(int argc, char *argv[]) { //Optionally perform xdelta3 if (state.prevFile) { - //TODO + //TODO } }