
/* Header file for life.c */
#include <stdio.h>

enum {
    BOARDX= 60,  /* Size of board in characters */
    BOARDY= 16,
    MAXLEN= 255, /* Maximum length of line to be read from keyboard or file */
    ERROR= -1,   /* Code returned by a function which has had a problem */ 
    NOERROR= 0   /* Code returned by a function which has not had a problem */
};

int read_board (char *, char [BOARDX][BOARDY]);
/* Read the original starting life board from a file 
  returns ERROR if there is a problem reading or NOERROR otherwise */

void print_board (char [BOARDX][BOARDY]);
/* Print the status of the board to screen */

void update_board (char [BOARDX][BOARDY]);
/* Update the status of the board according to the life rules */

int calc_neighbours (int, int, char [BOARDX][BOARDY]);
/* Returns the number of neighbours for a particular location on the board
including checking if we are the edge of the board */

int write_board (char [BOARDX][BOARDY]);
/* Save the status of the board to file - ask for a filename first 
Returns NOERROR if it is written successfully or ERROR if there is a problem */

int strings_match (char *, char *);
/* Returns 1 (TRUE) if two strings are the same and 0 (FALSE) if they are not*/

void copy_n_chars (char *, char *, int);
/* Copies up to a given number of characters from one string to another */

void print_usage (void);
/* Print instructions on usage of the program */

