/*************************
 * Owen Sullivan
 * CPSC 2310 Fall 22
 * Lab 8
 * Username: opsulli
 * Instructor: Dr. Yvon Feaster
*************************/

#ifndef FUNCTIONS_
#define FUNCTIONS_

#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>

// Buffer struct with values matching header struct, but using large char
// arrays instead of small char arrays or ints to hold comments that might
// be read from input file
typedef struct buffer {

    char type[100];
    char width[100];
    char height[100];
    char maxColor[100];

} buffer_t;

// Header struct with values for PPM type, image width, image height,
// and image maxColor
typedef struct header {

    char type[3];
    int width;
    int height;
    int maxColor;

} header_t;

// Pixel struct with unsigned chars for r, g, and b values in a single pixel
typedef struct pixel {

    unsigned char r;
    unsigned char g;
    unsigned char b;

} pixel_t;

// Function prototypes
header_t readHeader(FILE *inFile);
void writeHeader(FILE *outFile, header_t header);
header_t discardComments(buffer_t buffer);

#endif