tico 0.1
Mechanical Watch Terminal Timegrapher
parseargs.h
Go to the documentation of this file.
1#pragma once
2#include "config.h"
3
17int checkFileArg(int name,
18 FILE** filePtr,
19 const char* optArg,
20 const char* mode);
21
29int checkUIntArg(int name, unsigned int* value, const char* optArg);
30
38void parseArguments(int argc, char* argv[], CapConfig* cfg);
39
45int getInt(char* ptr);
46
52double getDouble(char* ptr);
53
60int getDoublesFromStdin(size_t maxCount, double* arr);
61
69int getIntsFromFile(size_t maxCount, int* arr, FILE* file);
int getInt(char *ptr)
Parses an integer from a string.
Definition: parseargs.c:258
int getIntsFromFile(size_t maxCount, int *arr, FILE *file)
Reads integers from file until EOF or maxCount is reached.
Definition: parseargs.c:338
double getDouble(char *ptr)
Parses a double from a string.
Definition: parseargs.c:276
int checkFileArg(int name, FILE **filePtr, const char *optArg, const char *mode)
Parses command line arguments and fills the CapConfig struct.
Definition: parseargs.c:58
int checkUIntArg(int name, unsigned int *value, const char *optArg)
Checks if the provided argument is a valid integer and parses it.
Definition: parseargs.c:43
int getDoublesFromStdin(size_t maxCount, double *arr)
Reads doubles from standard input until EOF or maxCount is reached.
Definition: parseargs.c:299
void parseArguments(int argc, char *argv[], CapConfig *cfg)
Parses command line arguments and fills the CapConfig struct.
Definition: parseargs.c:157
brief struct to hold the configuration parameters for the capture process
Definition: config.h:8