connect-four-c/arghandler.h

59 lines
930 B
C
Raw Normal View History

2017-04-22 20:57:29 +00:00
#ifndef ARG_HANDLER
#define ARG_HANDLER
#include <argp.h>
/************************************************************************************
* @author Jacob McCloughan
* @version 3/03/2017
* @see argp.h
*
* My implementation for argp. Will handle arguments for the Connect Four game.
*************************************************************************************/
/*
* Saved width board parameter.
*/
int wid;
/*
* Saved height board parameter.
*/
int hei;
/*
* Saved square board parameter.
*/
int sqr;
/*
* Saved win length parameter.
*/
int winlen;
/*
* Saved filename for loading.
*/
char* loadFile;
/*
* Argument values for flags.
*/
struct arguments {
int width;
int height;
int square;
int winL;
char* loadFile;
};
/*
* Function that sets up values post-parsing.
*/
error_t parse_opt(int key, char* arg, struct argp_state *state);
/*
* Parses arguments.
*/
void setup(int argc, char** argv);
#endif