/************************* 
 * Owen Sullivan
 * CPSC 2310-002
 * opsulli@clemson.edu
*************************/

#include "EncodeDecode.h"

int main(int argc, char **argv) {

    // Check that the correct number of command-line arguments are supplied
    assert(argc == 3);

    // Open file pointers for image to be encoded
    FILE *encodedInput = fopen(argv[1], "rb");
    FILE *encodedOutput = fopen(argv[2], "wb");

    // Check that file pointers were opened
    assert(encodedInput != NULL);
    assert(encodedOutput != NULL);

    promptMenu(encodedInput, encodedOutput);

    // Close file pointers for encoded image set
    fclose(encodedInput);
    fclose(encodedOutput);

    // Open file pointer for image to be decoded
    FILE *decodedInput = fopen(argv[2], "rb");

    // Check that file pointer was opened
    assert(decodedInput != NULL);
    
    decodeImage(decodedInput);

    // Close file pointer for decoded image
    fclose(decodedInput);

    return 0;

}