34 lines
No EOL
714 B
C
34 lines
No EOL
714 B
C
#ifndef HELPER_H
|
|
#define HELPER_H
|
|
|
|
#include <errno.h>
|
|
#include <getopt.h>
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
enum argumentParseResult {
|
|
RESULT_OK = 0,
|
|
RESULT_EXIT_SUCCESS,
|
|
RESULT_EXIT_FAILURE
|
|
};
|
|
|
|
struct configuration {
|
|
char* filename;
|
|
int implementationToUse;
|
|
int doBenchmark;
|
|
int benchmarkingCycles;
|
|
};
|
|
|
|
/**
|
|
* @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);
|
|
|
|
#endif // HELPER_H
|