🗑 Remove unused code
This commit is contained in:
parent
43614e1498
commit
c02caaf2ff
2 changed files with 9 additions and 22 deletions
4
.vscode/settings.json
vendored
4
.vscode/settings.json
vendored
|
@ -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",
|
||||||
|
|
25
src/main.c
25
src/main.c
|
@ -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);
|
||||||
|
|
Loading…
Reference in a new issue