|
HAZE
haze is a drop-in replacement to process water vapor to be used with FORCE
|
Functions | |
| void | printHelp (void) |
| Print a help string for haze to stdout. | |
| option_t * | parseOptions (int argc, char *argv[]) |
| Parse command line options for haze. | |
| int | parseRange (int *arr, size_t capacity, size_t *elements, const char *argString) |
| Parse positive integer from string representation to numeric reprentation. | |
| 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 | parseSingle (int *arr, size_t *elements, const char *argString) |
| Convert the string representation of an integer to an integer. | |
| 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 | getAuthentication (char **authenticationToken, const char *filePath) |
| Get CDS API authentication token from various sources. | |
| int | getAuthenticationFromEnvironment (char **authenticationToken) |
| Get CDS API authentication token from environment. | |
| int | getAuthenticationFromFile (char **authenticationToken, const char *filePath) |
| Get CDS API authentication token from a file. | |
| char * | extractKey (const char *cdsapirc) |
| Parse cdsapirc file and extract the key value. | |
| void | forceNoTrailingSlash (const option_t *options) |
| Enforce file system path doesn't end with a slash. | |
| void | printOptions (const option_t *options) |
| Print fields of options struct to stdout. | |
|
nodiscard |
Parse cdsapirc file and extract the key value.
| cdsapirc | File path to .cdsapirc. |
| void forceNoTrailingSlash | ( | const option_t * | options | ) |
Enforce file system path doesn't end with a slash.
| CLI Arguments Parsing and Program Setup | Reference to parsed options. |
| int getAuthentication | ( | char ** | authenticationToken, |
| const char * | filePath ) |
Get CDS API authentication token from various sources.
Query both the environment variables of the running process, possibly a specified file path and $HOME/.cdsapirc in that order. Returns after the first successfull token extraction.
| authenticationToken | Pointer to char * where token should be stored |
| filePath | File storing CDS API credentials, possibly NULL. |
| int getAuthenticationFromEnvironment | ( | char ** | authenticationToken | ) |
Get CDS API authentication token from environment.
Query the environment of the calling process for a variable called ADSAUTH. If found, the corresponding value is used for authentication.
| authenticationToken | Indirect reference to object storing the access token/key. |
| int getAuthenticationFromFile | ( | char ** | authenticationToken, |
| const char * | filePath ) |
Get CDS API authentication token from a file.
Get the authentication token from a specified file. In case filePath is set to NULL, try to access the file $HOME/.cdsapirc and extract the authentication token from there.
| authenticationToken | Indirect reference to object storing the access token/key. |
| filePath | File storing CDS API credentials, possibly NULL. |
| int parseList | ( | int * | arr, |
| size_t | capacity, | ||
| size_t * | elements, | ||
| char * | argString ) |
Parse a comma-separated list of integers to an list of integers.
| arr | Array to store converted values in. |
| capacity | Maximum capacity of array. |
| elements | Reference to number of elements in array. |
| argString | String representation of comma-separated intger values. |
|
nodiscard |
Parse command line options for haze.
Parse command line options specified by user, validate numeric inputs, read authentication token and force trailing slash on directory paths.
| argc | Argument count |
| argv | Argument values |
| int parseRange | ( | int * | arr, |
| size_t | capacity, | ||
| size_t * | elements, | ||
| const char * | argString ) |
Parse positive integer from string representation to numeric reprentation.
This function is a thin wrapper around strtol. In comparison with `parseSingle, it directly returns a value instead of storing the converted number in an array.
| string | String representation of integer. |
/**
Parse a range of integers denoted by min:max to list of intgers with closed interval bounds
| arr | Array to store converted values in. |
| capacity | Maximum capacity of array. |
| elements | Reference to number of elements in array. |
| argString | String representation of integer range. |
| int parseSingle | ( | int * | arr, |
| size_t * | elements, | ||
| const char * | argString ) |
Convert the string representation of an integer to an integer.
| arr | Array to store converted value in. |
| elements | Reference to number of elements in array. |
| argString | String representation of integer. |
| void printHelp | ( | void | ) |
Print a help string for haze to stdout.
| void printOptions | ( | const option_t * | options | ) |
Print fields of options struct to stdout.
| CLI Arguments Parsing and Program Setup | Object whose fields to print. |
| 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.
Test if all elements in arr are in the closed interval [min, max].
| arr | Array to check. |
| elements | Number of elements in array. |
| min | Minimum value, all stored values must be greater or equal than this value. |
| max | Maximum value, all stored values must be smaller or equal than this value. |