HAZE
haze is a drop-in replacement to process water vapor to be used with FORCE
Loading...
Searching...
No Matches
options.h
1#ifndef OPTIONS_H
2#define OPTIONS_H
15
16#include "types.h"
17#include <stdbool.h>
18#include <stddef.h>
19#include <stdlib.h>
20
25void printHelp(void);
26
39[[nodiscard]] option_t *parseOptions(int argc, char *argv[]);
40
60int parseIntegers(int *arr, size_t capacity, size_t *elements, char *argString, const int min,
61 const int max);
62
73int convertPositiveIntegerSafely(const char *string);
74
86int parseRange(int *arr, size_t capacity, size_t *elements, const char *argString);
87
101int parseList(int *arr, size_t capacity, size_t *elements, char *argString);
102
111int parseSingle(int *arr, size_t *elements, const char *argString);
112
125bool validateArray(int *arr, const size_t elements, const int min, const int max);
126
138int getAuthentication(char **authenticationToken, const char *filePath);
139
151int getAuthenticationFromEnvironment(char **authenticationToken);
152
166int getAuthenticationFromFile(char **authenticationToken, const char *filePath);
167
178[[nodiscard]] char *extractKey(const char *cdsapirc);
179
185void forceNoTrailingSlash(const option_t *options);
186
192void printOptions(const option_t *options);
193 // end of group
195#endif // OPTIONS_H
char * extractKey(const char *cdsapirc)
Parse cdsapirc file and extract the key value.
void printOptions(const option_t *options)
Print fields of options struct to stdout.
bool validateArray(int *arr, const size_t elements, const int min, const int max)
Test if all elements in an array are within range and initialized.
int getAuthenticationFromFile(char **authenticationToken, const char *filePath)
Get CDS API authentication token from a file.
void forceNoTrailingSlash(const option_t *options)
Enforce file system path doesn't end with a slash.
int parseSingle(int *arr, size_t *elements, const char *argString)
Convert the string representation of an integer to an integer.
int getAuthentication(char **authenticationToken, const char *filePath)
Get CDS API authentication token from various sources.
int parseList(int *arr, size_t capacity, size_t *elements, char *argString)
Parse a comma-separated list of integers to an list of integers.
int parseRange(int *arr, size_t capacity, size_t *elements, const char *argString)
Parse positive integer from string representation to numeric reprentation.
int getAuthenticationFromEnvironment(char **authenticationToken)
Get CDS API authentication token from environment.
option_t * parseOptions(int argc, char *argv[])
Parse command line options for haze.
void printHelp(void)
Print a help string for haze to stdout.
Definition types.h:198