🗑 Remove unused code

This commit is contained in:
C-3PO 2018-09-14 00:56:32 +02:00
parent 43614e1498
commit c02caaf2ff
Signed by: c3po
GPG key ID: 62993C4BB4D86F24
2 changed files with 9 additions and 22 deletions

View file

@ -4,7 +4,9 @@
"decrypt.h": "c", "decrypt.h": "c",
"stdint.h": "c", "stdint.h": "c",
"decryptutilities.h": "c", "decryptutilities.h": "c",
"fileutilities.h": "c" "fileutilities.h": "c",
"stdio.h": "c",
"stdlib.h": "c"
}, },
"cSpell.words": [ "cSpell.words": [
"init", "init",

View file

@ -1,4 +1,3 @@
#include <errno.h>
#include <getopt.h> #include <getopt.h>
#include <stdbool.h> #include <stdbool.h>
#include <stdio.h> #include <stdio.h>
@ -38,10 +37,7 @@ struct arguments {
unsigned long fileSize; unsigned long fileSize;
//Decryption keys //Decryption keys
bool isEncrypted; bool isEncrypted;
uint32_t key0; //For xdelta3, the location of the old file
uint32_t key1;
uint32_t key2;
//TODO: For xdelta3, the location of the old file
char* prevFile; 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 //in this variable, getopt_long stores the current position in the command line args array
int option_index = 0; 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 //end of command line arguments reached
if (curOption == -1) { if (curOption == -1) {
@ -95,6 +91,9 @@ int main(int argc, char *argv[]) {
state.isEncrypted = true; state.isEncrypted = true;
break; break;
} }
case 'p': //prev file for xdelta3
//TODO
break;
default: default:
fprintf(stderr, "Unknown option '%c'.", (char)curOption); fprintf(stderr, "Unknown option '%c'.", (char)curOption);
exit(1); exit(1);
@ -106,20 +105,6 @@ int main(int argc, char *argv[]) {
exit(1); 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); uint8_t* compressedChunk = malloc(BUFFER_SIZE);