/**************************
 * Owen Sullivan
 * CPSC 2310 Fall 22
 * UserName: opsulli
 * Instructor:  Dr. Yvon Feaster
*************************/

#include "functions.h"

int main(int argc, char **argv) { 
    
    // Check that 2 command-line arguments were passed
    assert(argc == 3);

    // Open input file as read-only, and output file as write
    FILE *inFile = fopen(argv[1], "r");
    FILE *outFile = fopen(argv[2], "w");

    // Assert that both files opened successfully
    assert(inFile != NULL);
    assert(outFile != NULL);

    // Create a head node for the linked list
    node_t *head = NULL;
    // Call createList and populate linked list by passing head
    createList(inFile, &head);

    // Print the list
    printList(outFile, head);

    // Free the linked list nodes' memory
    deleteList(&head);

}