2022-06-29 10:58:49 +02:00
|
|
|
#ifndef HELPER_H
|
|
|
|
#define HELPER_H
|
|
|
|
|
2022-06-29 10:50:55 +02:00
|
|
|
#include <errno.h>
|
2022-06-29 11:08:31 +02:00
|
|
|
#include <getopt.h>
|
2022-06-29 10:50:55 +02:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdio.h>
|
2022-06-29 11:08:31 +02:00
|
|
|
#include <stdlib.h>
|
2022-06-29 10:50:55 +02:00
|
|
|
|
|
|
|
enum argumentParseResult {
|
|
|
|
RESULT_OK = 0,
|
|
|
|
RESULT_EXIT_SUCCESS,
|
|
|
|
RESULT_EXIT_FAILURE
|
|
|
|
};
|
|
|
|
|
|
|
|
struct configuration {
|
2022-06-29 11:08:31 +02:00
|
|
|
char* filename;
|
2022-06-29 10:50:55 +02:00
|
|
|
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
|