SDDSlib
|
Processes SDDS layout headers and translates namelist structures. More...
Go to the source code of this file.
Functions | |
int32_t | SDDS_ProcessDescription (SDDS_DATASET *SDDS_dataset, char *s) |
Process the description section of the SDDS dataset. | |
int32_t | SDDS_ProcessColumnDefinition (SDDS_DATASET *SDDS_dataset, char *s) |
Process the column definition section of the SDDS dataset. | |
int32_t | SDDS_ProcessParameterDefinition (SDDS_DATASET *SDDS_dataset, char *s) |
Process the parameter definition section of the SDDS dataset. | |
FILE * | SDDS_ProcessIncludeCommand (SDDS_DATASET *SDDS_dataset, char *s) |
Process the include command within the SDDS dataset. | |
int32_t | SDDS_ProcessAssociateDefinition (SDDS_DATASET *SDDS_dataset, char *s) |
Process the associate definition section of the SDDS dataset. | |
int32_t | SDDS_ProcessDataMode (SDDS_DATASET *SDDS_dataset, char *s) |
Process the data mode section of the SDDS dataset. | |
int32_t | SDDS_ProcessArrayDefinition (SDDS_DATASET *SDDS_dataset, char *s) |
Process the array definition section of the SDDS dataset. | |
int32_t | SDDS_ProcessColumnString (SDDS_DATASET *SDDS_dataset, char *string, int32_t mode) |
Process a column definition string. | |
int32_t | SDDS_ProcessParameterString (SDDS_DATASET *SDDS_dataset, char *string, int32_t mode) |
Process a parameter definition string. | |
int32_t | SDDS_ProcessArrayString (SDDS_DATASET *SDDS_dataset, char *string) |
Process an array definition string. | |
int32_t | SDDS_ProcessAssociateString (SDDS_DATASET *SDDS_dataset, char *string) |
Process an associate definition string. | |
char * | SDDS_GetTagValuePair (char *ptr, char **tag, char **value) |
Retrieve a tag-value pair from the input string. | |
char * | SDDS_PrepareToParseTagValuePairs (char *s) |
Prepare the string for parsing tag-value pairs. | |
int32_t | SDDS_FindFieldIndex (char *tag, SDDS_FIELD_INFORMATION *fieldInfo, int32_t fieldInfos) |
Find the index of a field based on its tag. | |
int32_t | SDDS_MatchEnum (char *value, SDDS_ENUM_PAIR *enumPair) |
Match an enumeration string to its corresponding value. | |
int32_t | SDDS_ParseNamelist (void *data, SDDS_FIELD_INFORMATION *fieldInfo, int32_t fieldInfos, char *s) |
Parse a namelist string and populate the corresponding data structure. | |
int32_t | SDDS1_ProcessDescription (SDDS_DATASET *SDDS_dataset, char *s) |
Process the description section for SDDS protocol version 1. | |
int32_t | SDDS1_ProcessColumnDefinition (SDDS_DATASET *SDDS_dataset, char *s) |
Processes and defines a column within an SDDS dataset. | |
int32_t | SDDS1_ProcessParameterDefinition (SDDS_DATASET *SDDS_dataset, char *s) |
Processes and defines a parameter within an SDDS dataset. | |
FILE * | SDDS1_ProcessIncludeCommand (SDDS_DATASET *SDDS_dataset, char *s) |
Processes an include command by opening the specified file. | |
int32_t | SDDS1_ProcessAssociateDefinition (SDDS_DATASET *SDDS_dataset, char *s) |
Processes and defines an associate within an SDDS dataset. | |
int32_t | SDDS1_ProcessDataMode (SDDS_DATASET *SDDS_dataset, char *s) |
Processes and sets the data mode for an SDDS dataset. | |
int32_t | SDDS1_ProcessArrayDefinition (SDDS_DATASET *SDDS_dataset, char *s) |
Processes and defines an array within an SDDS dataset. | |
Processes SDDS layout headers and translates namelist structures.
This file implements a suite of functions responsible for reading and processing SDDS (Self Describing Data Sets) layout headers. The primary purpose of these routines is to facilitate the translation between external namelist structures used for input and the internal data structures that store the SDDS layout.
Key functionalities include:
The implemented functions ensure robust argument checking and support for multiple protocol versions, allowing for future scalability and compatibility.
Definition in file SDDS_process.c.
int32_t SDDS1_ProcessArrayDefinition | ( | SDDS_DATASET * | SDDS_dataset, |
char * | s ) |
Processes and defines an array within an SDDS dataset.
This function parses an array definition string, extracts the necessary array information, and defines the array in the given SDDS dataset.
SDDS_dataset | Pointer to the SDDS dataset where the array will be defined. |
s | String containing the array definition in namelist format. |
1
on successful processing and definition of the array.0
if an error occurs during parsing or definition. Definition at line 916 of file SDDS_process.c.
int32_t SDDS1_ProcessAssociateDefinition | ( | SDDS_DATASET * | SDDS_dataset, |
char * | s ) |
Processes and defines an associate within an SDDS dataset.
This function parses an associate definition string, extracts the necessary associate information, and defines the associate in the given SDDS dataset.
SDDS_dataset | Pointer to the SDDS dataset where the associate will be defined. |
s | String containing the associate definition in namelist format. |
1
on successful processing and definition of the associate.0
if an error occurs during parsing or definition. Definition at line 847 of file SDDS_process.c.
int32_t SDDS1_ProcessColumnDefinition | ( | SDDS_DATASET * | SDDS_dataset, |
char * | s ) |
Processes and defines a column within an SDDS dataset.
This function parses a column definition string, extracts the necessary column information, and defines the column in the given SDDS dataset.
SDDS_dataset | Pointer to the SDDS dataset where the column will be defined. |
s | String containing the column definition in namelist format. |
1
on successful processing and definition of the column.0
if an error occurs during parsing or definition. Definition at line 730 of file SDDS_process.c.
int32_t SDDS1_ProcessDataMode | ( | SDDS_DATASET * | SDDS_dataset, |
char * | s ) |
Processes and sets the data mode for an SDDS dataset.
This function parses a data mode definition string, extracts the necessary data mode information, and sets the data mode in the given SDDS dataset.
SDDS_dataset | Pointer to the SDDS dataset where the data mode will be set. |
s | String containing the data mode definition in namelist format. |
1
on successful processing and setting of the data mode.0
if an error occurs during parsing or if mandatory fields are missing. Definition at line 879 of file SDDS_process.c.
int32_t SDDS1_ProcessDescription | ( | SDDS_DATASET * | SDDS_dataset, |
char * | s ) |
Process the description section for SDDS protocol version 1.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
s | Pointer to the description string. |
Definition at line 703 of file SDDS_process.c.
FILE * SDDS1_ProcessIncludeCommand | ( | SDDS_DATASET * | SDDS_dataset, |
char * | s ) |
Processes an include command by opening the specified file.
This function parses an include command string to extract the filename, then attempts to open the file for reading. It returns a file pointer if successful.
SDDS_dataset | Pointer to the SDDS dataset (unused in current implementation). |
s | String containing the include command in namelist format. |
FILE
on success.NULL
if parsing fails or the file cannot be opened. Definition at line 818 of file SDDS_process.c.
int32_t SDDS1_ProcessParameterDefinition | ( | SDDS_DATASET * | SDDS_dataset, |
char * | s ) |
Processes and defines a parameter within an SDDS dataset.
This function parses a parameter definition string, extracts the necessary parameter information, and defines the parameter in the given SDDS dataset.
SDDS_dataset | Pointer to the SDDS dataset where the parameter will be defined. |
s | String containing the parameter definition in namelist format. |
1
on successful processing and definition of the parameter.0
if an error occurs during parsing or definition. Definition at line 774 of file SDDS_process.c.
int32_t SDDS_FindFieldIndex | ( | char * | tag, |
SDDS_FIELD_INFORMATION * | fieldInfo, | ||
int32_t | fieldInfos ) |
Find the index of a field based on its tag.
tag | Pointer to the tag string. |
fieldInfo | Array of SDDS_FIELD_INFORMATION structures. |
fieldInfos | Number of elements in the fieldInfo array. |
Definition at line 550 of file SDDS_process.c.
char * SDDS_GetTagValuePair | ( | char * | ptr, |
char ** | tag, | ||
char ** | value ) |
Retrieve a tag-value pair from the input string.
This function parses a substring to extract a tag and its corresponding value. It handles quoted strings and escaped characters.
ptr | Pointer to the current position in the string. |
tag | Double pointer to store the extracted tag. |
value | Double pointer to store the extracted value. |
Definition at line 442 of file SDDS_process.c.
int32_t SDDS_MatchEnum | ( | char * | value, |
SDDS_ENUM_PAIR * | enumPair ) |
Match an enumeration string to its corresponding value.
value | Pointer to the enumeration string. |
enumPair | Array of SDDS_ENUM_PAIR structures. |
Definition at line 566 of file SDDS_process.c.
int32_t SDDS_ParseNamelist | ( | void * | data, |
SDDS_FIELD_INFORMATION * | fieldInfo, | ||
int32_t | fieldInfos, | ||
char * | s ) |
Parse a namelist string and populate the corresponding data structure.
This function parses a namelist string containing tag-value pairs and assigns the values to the appropriate fields in the provided data structure based on the field information provided.
data | Pointer to the data structure to populate. |
fieldInfo | Array of SDDS_FIELD_INFORMATION structures describing the fields. |
fieldInfos | Number of elements in the fieldInfo array. |
s | Pointer to the namelist string. |
Definition at line 588 of file SDDS_process.c.
char * SDDS_PrepareToParseTagValuePairs | ( | char * | s | ) |
Prepare the string for parsing tag-value pairs.
This function removes the trailing '&end' if present and ensures there is no group name.
s | Pointer to the input string. |
Definition at line 514 of file SDDS_process.c.
int32_t SDDS_ProcessArrayDefinition | ( | SDDS_DATASET * | SDDS_dataset, |
char * | s ) |
Process the array definition section of the SDDS dataset.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
s | Pointer to the array definition string. |
Definition at line 243 of file SDDS_process.c.
int32_t SDDS_ProcessArrayString | ( | SDDS_DATASET * | SDDS_dataset, |
char * | string ) |
Process an array definition string.
This function parses a string containing array definition information and updates the SDDS dataset accordingly.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
string | Pointer to the array definition string. |
Definition at line 362 of file SDDS_process.c.
int32_t SDDS_ProcessAssociateDefinition | ( | SDDS_DATASET * | SDDS_dataset, |
char * | s ) |
Process the associate definition section of the SDDS dataset.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
s | Pointer to the associate definition string. |
Definition at line 181 of file SDDS_process.c.
int32_t SDDS_ProcessAssociateString | ( | SDDS_DATASET * | SDDS_dataset, |
char * | string ) |
Process an associate definition string.
This function parses a string containing associate definition information and updates the SDDS dataset accordingly.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
string | Pointer to the associate definition string. |
Definition at line 400 of file SDDS_process.c.
int32_t SDDS_ProcessColumnDefinition | ( | SDDS_DATASET * | SDDS_dataset, |
char * | s ) |
Process the column definition section of the SDDS dataset.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
s | Pointer to the column definition string. |
Definition at line 88 of file SDDS_process.c.
int32_t SDDS_ProcessColumnString | ( | SDDS_DATASET * | SDDS_dataset, |
char * | string, | ||
int32_t | mode ) |
Process a column definition string.
This function parses a string containing column definition information and updates the SDDS dataset accordingly.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
string | Pointer to the column definition string. |
mode | Mode indicating how the column is defined. |
Definition at line 283 of file SDDS_process.c.
int32_t SDDS_ProcessDataMode | ( | SDDS_DATASET * | SDDS_dataset, |
char * | s ) |
Process the data mode section of the SDDS dataset.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
s | Pointer to the data mode string. |
Definition at line 212 of file SDDS_process.c.
int32_t SDDS_ProcessDescription | ( | SDDS_DATASET * | SDDS_dataset, |
char * | s ) |
Process the description section of the SDDS dataset.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
s | Pointer to the description string. |
Definition at line 57 of file SDDS_process.c.
FILE * SDDS_ProcessIncludeCommand | ( | SDDS_DATASET * | SDDS_dataset, |
char * | s ) |
Process the include command within the SDDS dataset.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
s | Pointer to the include command string. |
Definition at line 150 of file SDDS_process.c.
int32_t SDDS_ProcessParameterDefinition | ( | SDDS_DATASET * | SDDS_dataset, |
char * | s ) |
Process the parameter definition section of the SDDS dataset.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
s | Pointer to the parameter definition string. |
Definition at line 119 of file SDDS_process.c.
int32_t SDDS_ProcessParameterString | ( | SDDS_DATASET * | SDDS_dataset, |
char * | string, | ||
int32_t | mode ) |
Process a parameter definition string.
This function parses a string containing parameter definition information and updates the SDDS dataset accordingly.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
string | Pointer to the parameter definition string. |
mode | Mode indicating how the parameter is defined. |
Definition at line 323 of file SDDS_process.c.