gra-projekt/Implementierung/lib/helper.h

34 lines
714 B
C
Raw Normal View History

2022-06-29 10:58:49 +02:00
#ifndef HELPER_H
#define HELPER_H
#include <errno.h>
2022-06-29 11:08:31 +02:00
#include <getopt.h>
#include <stdint.h>
#include <stdio.h>
2022-06-29 11:08:31 +02:00
#include <stdlib.h>
enum argumentParseResult {
RESULT_OK = 0,
RESULT_EXIT_SUCCESS,
RESULT_EXIT_FAILURE
};
struct configuration {
2022-06-29 11:08:31 +02:00
char* filename;
int implementationToUse;
int doBenchmark;
int benchmarkingCycles;
};
2022-06-29 11:08:31 +02:00
/**
* @brief parse commandline arguments to config and print errors, if any
*
* @param argc argc
* @param argv argv
* @param c pointer where the configuration should be stored
* @return enum argumentParseResult
*/
enum argumentParseResult parseArguments(int argc, char** argv,
struct configuration* c);
2022-06-29 10:58:49 +02:00
2022-06-29 11:08:31 +02:00
#endif // HELPER_H