das2/dsdf.h File Reference

Utilities for parsing DSDF files into descriptor objects. More...


Detailed Description

Utilities for parsing DSDF files into descriptor objects.

#include <das2/descriptor.h>

Go to the source code of this file.

Functions

Descriptordsdf_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.

Function Documentation

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.

Parameters:
sFileName - The DSDF file to open and parse
Returns:
an Descriptor object allocated on the heap, or NULL if there was a parsing error
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.

Parameters:
[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
Returns:
- A pointer to an array of doubles allocated on the heap, or NULL if parsing failed.
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.

Parameters:
[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
Returns:
A pointer to sNormParam which will contain a null terminated string if not NULL and uLen is at least 2
 All Data Structures Files Functions Variables Typedefs Enumerations Defines

Generated on 11 Sep 2016 for Das2 Stream Utilities by  doxygen 1.6.1