Utilities for parsing DSDF files into descriptor objects. More...
Utilities for parsing DSDF files into descriptor objects.
#include <das2/descriptor.h>
Go to the source code of this file.
Functions | |
Descriptor * | dsdf_parse (const char *sFileName) |
Parse a DSDF file into a descriptor object. | |
double * | dsdf_valToArray (const char *sValue, size_t *pLen) |
Helper function to parse a DSDF value as a double array. | |
const char * | dsdf_setIdlBin (const char *sIdlBin) |
Set the location of the IDL binary. | |
char * | dsdf_valToNormParam (const char *sRawParam, char *sNormParam, size_t uNormLen) |
Normalize a general reader command line parameter set. |
Descriptor* dsdf_parse | ( | const char * | sFileName | ) |
Parse a DSDF file into a descriptor object.
This DSDF parser supports IDL continuation characters, which are '$' immediately followed by a newline (
). The total line buffer across all continuation lines is 22499 bytes long.
sFileName | - The DSDF file to open and parse |
double* dsdf_valToArray | ( | const char * | sValue, | |
size_t * | pLen | |||
) |
Helper function to parse a DSDF value as a double array.
Certian Das1 DSDF values such as the y_coordinate contained executable IDL code instead of a simple array of values. If a global IDL executable has been set via dsdf_setIdlBin, then any arrays this function cannot parse will be handed by an IDL subprocess.
[in] | sValue | - The DSDF value to parse |
[out] | pLen | - a pointer to a size_t that will receive the length of the returned double array |
const char* dsdf_setIdlBin | ( | const char * | sIdlBin | ) |
Set the location of the IDL binary.
By default the library does not know how to find IDL, use this function to set the location of the idl startup program. Note that IDL is not needed when parsing Das 2.2 (or higher) compliant DSDF files. Only programs that read older Das1 DSDF files may have the need to call IDL.
char* dsdf_valToNormParam | ( | const char * | sRawParam, | |
char * | sNormParam, | |||
size_t | uNormLen | |||
) |
Normalize a general reader command line parameter set.
The normalization rules are as follows:
0. If the raw parameter string is NULL or empty the string '_noparam' is copied into the norm-param buffer and the function returns.
1. The params are broken on whitespace into a set of ordered tokens.
2. If the token starts with a '-' and the next token doe snot start with a '-' then the two tokens are merged with a '-' separator.
3. All tokens are sorted alphabetically and then merged via '_' separators.
[in] | sRawParam | - The parameter string to normalize |
[out] | sNormParam | - A buffer to hold the normalized parameter string |
[in] | uLen | - The length of the sNormParam buffer |