SDDSlib
|
Provides functions for writing SDDS layout headers. More...
Go to the source code of this file.
Functions | |
char * | SDDS_BlankToNull (char *string) |
Converts blank strings to NULL. | |
int32_t | SDDS_WriteVersion (int32_t version_number, FILE *fp) |
Writes the SDDS protocol version to a standard file. | |
int32_t | SDDS_LZMAWriteVersion (int32_t version_number, struct lzmafile *lzmafp) |
Writes the SDDS protocol version to an LZMA-compressed file. | |
int32_t | SDDS_PrintNamelistField (FILE *fp, char *name, char *value) |
Writes a namelist field to a standard file. | |
int32_t | SDDS_LZMAPrintNamelistField (struct lzmafile *lzmafp, char *name, char *value) |
Writes a namelist field to an LZMA-compressed file. | |
int32_t | SDDS_WriteDescription (char *text, char *contents, FILE *fp) |
Writes the SDDS description section to a standard file. | |
int32_t | SDDS_LZMAWriteDescription (char *text, char *contents, struct lzmafile *lzmafp) |
Writes the SDDS description section to an LZMA-compressed file. | |
int32_t | SDDS_WriteColumnDefinition (COLUMN_DEFINITION *column_definition, FILE *fp) |
Writes a column definition to a standard file. | |
int32_t | SDDS_LZMAWriteColumnDefinition (COLUMN_DEFINITION *column_definition, struct lzmafile *lzmafp) |
Writes a column definition to an LZMA-compressed file. | |
int32_t | SDDS_WriteParameterDefinition (PARAMETER_DEFINITION *parameter_definition, FILE *fp) |
Writes a parameter definition to a standard file. | |
int32_t | SDDS_LZMAWriteParameterDefinition (PARAMETER_DEFINITION *parameter_definition, struct lzmafile *lzmafp) |
Writes a parameter definition to an LZMA-compressed file. | |
int32_t | SDDS_WriteAssociateDefinition (ASSOCIATE_DEFINITION *associate_definition, FILE *fp) |
Writes an associate definition to a standard file. | |
int32_t | SDDS_LZMAWriteAssociateDefinition (ASSOCIATE_DEFINITION *associate_definition, struct lzmafile *lzmafp) |
Writes an associate definition to an LZMA-compressed file. | |
int32_t | SDDS_WriteDataMode (SDDS_LAYOUT *layout, FILE *fp) |
Writes the data mode section to a standard file. | |
int32_t | SDDS_LZMAWriteDataMode (SDDS_LAYOUT *layout, struct lzmafile *lzmafp) |
Writes the data mode section to an LZMA-compressed file. | |
int32_t | SDDS_WriteArrayDefinition (ARRAY_DEFINITION *array_definition, FILE *fp) |
Writes an array definition to a standard file. | |
int32_t | SDDS_LZMAWriteArrayDefinition (ARRAY_DEFINITION *array_definition, struct lzmafile *lzmafp) |
Writes an array definition to an LZMA-compressed file. | |
Provides functions for writing SDDS layout headers.
This file contains functions that handle writing SDDS (Self Describing Data Sets) layout headers. These functions convert the internal layout structures into the namelist format used for input/output operations.
Definition in file SDDS_write.c.
char * SDDS_BlankToNull | ( | char * | string | ) |
Converts blank strings to NULL.
This utility function checks if a given string is NULL or consists solely of whitespace characters. If so, it returns NULL; otherwise, it returns the original string.
string | The input string to check. |
Definition at line 37 of file SDDS_write.c.
int32_t SDDS_LZMAPrintNamelistField | ( | struct lzmafile * | lzmafp, |
char * | name, | ||
char * | value ) |
Writes a namelist field to an LZMA-compressed file.
This function formats and writes a single namelist field to the specified LZMA-compressed file. It handles escaping of double quotes and determines whether to enclose the value in quotes based on its content.
lzmafp | The LZMA-compressed file pointer where the namelist field will be written. |
name | The name of the field. |
value | The value of the field. |
Definition at line 166 of file SDDS_write.c.
int32_t SDDS_LZMAWriteArrayDefinition | ( | ARRAY_DEFINITION * | array_definition, |
struct lzmafile * | lzmafp ) |
Writes an array definition to an LZMA-compressed file.
This function outputs the definition of a single array in the SDDS layout to an LZMA-compressed file. It includes fields such as name, symbol, units, description, format string, group name, data type, and dimensions. The definition is enclosed within &array and &end tags.
array_definition | Pointer to the array definition structure. |
lzmafp | The LZMA-compressed file pointer where the array definition will be written. |
Definition at line 722 of file SDDS_write.c.
int32_t SDDS_LZMAWriteAssociateDefinition | ( | ASSOCIATE_DEFINITION * | associate_definition, |
struct lzmafile * | lzmafp ) |
Writes an associate definition to an LZMA-compressed file.
This function outputs the definition of an associate in the SDDS layout to an LZMA-compressed file. It includes fields such as name, filename, contents, path, description, and an SDDS flag. The definition is enclosed within &associate and &end tags.
associate_definition | Pointer to the associate definition structure. |
lzmafp | The LZMA-compressed file pointer where the associate definition will be written. |
Definition at line 520 of file SDDS_write.c.
int32_t SDDS_LZMAWriteColumnDefinition | ( | COLUMN_DEFINITION * | column_definition, |
struct lzmafile * | lzmafp ) |
Writes a column definition to an LZMA-compressed file.
This function outputs the definition of a single column in the SDDS layout to an LZMA-compressed file. It includes fields such as name, symbol, units, description, format string, and data type. The definition is enclosed within &column and &end tags.
column_definition | Pointer to the column definition structure. |
lzmafp | The LZMA-compressed file pointer where the column definition will be written. |
Definition at line 356 of file SDDS_write.c.
int32_t SDDS_LZMAWriteDataMode | ( | SDDS_LAYOUT * | layout, |
struct lzmafile * | lzmafp ) |
Writes the data mode section to an LZMA-compressed file.
This function outputs the data mode settings of the SDDS layout to the specified LZMA-compressed file pointer. It includes settings such as mode, lines per row, row counts, endianess, column-major order, and fixed row counts. The section is enclosed within &data and &end tags.
layout | Pointer to the SDDS layout structure containing data mode settings. |
lzmafp | The LZMA-compressed file pointer where the data mode section will be written. |
Definition at line 614 of file SDDS_write.c.
int32_t SDDS_LZMAWriteDescription | ( | char * | text, |
char * | contents, | ||
struct lzmafile * | lzmafp ) |
Writes the SDDS description section to an LZMA-compressed file.
This function writes the description section of the SDDS layout, including optional text and contents fields. It encapsulates the data within &description and &end tags in an LZMA-compressed file.
text | The descriptive text for the SDDS layout. |
contents | The contents description for the SDDS layout. |
lzmafp | The LZMA-compressed file pointer where the description will be written. |
Definition at line 280 of file SDDS_write.c.
int32_t SDDS_LZMAWriteParameterDefinition | ( | PARAMETER_DEFINITION * | parameter_definition, |
struct lzmafile * | lzmafp ) |
Writes a parameter definition to an LZMA-compressed file.
This function outputs the definition of a single parameter in the SDDS layout to an LZMA-compressed file. It includes fields such as name, symbol, units, description, format string, data type, and fixed value. The definition is enclosed within ¶meter and &end tags.
parameter_definition | Pointer to the parameter definition structure. |
lzmafp | The LZMA-compressed file pointer where the parameter definition will be written. |
Definition at line 438 of file SDDS_write.c.
int32_t SDDS_LZMAWriteVersion | ( | int32_t | version_number, |
struct lzmafile * | lzmafp ) |
Writes the SDDS protocol version to an LZMA-compressed file.
This function outputs the SDDS protocol version string to the provided LZMA-compressed file pointer. Maintaining the protocol version is essential for ensuring the integrity of the SDDS file format.
version_number | The SDDS protocol version number to write. |
lzmafp | The LZMA-compressed file pointer where the version string will be written. |
Definition at line 77 of file SDDS_write.c.
int32_t SDDS_PrintNamelistField | ( | FILE * | fp, |
char * | name, | ||
char * | value ) |
Writes a namelist field to a standard file.
This function formats and writes a single namelist field to the specified file. It handles escaping of double quotes and determines whether to enclose the value in quotes based on its content.
fp | The file pointer where the namelist field will be written. |
name | The name of the field. |
value | The value of the field. |
Definition at line 122 of file SDDS_write.c.
int32_t SDDS_WriteArrayDefinition | ( | ARRAY_DEFINITION * | array_definition, |
FILE * | fp ) |
Writes an array definition to a standard file.
This function outputs the definition of a single array in the SDDS layout. It includes fields such as name, symbol, units, description, format string, group name, data type, and dimensions. The definition is enclosed within &array and &end tags.
array_definition | Pointer to the array definition structure. |
fp | The file pointer where the array definition will be written. |
Definition at line 692 of file SDDS_write.c.
int32_t SDDS_WriteAssociateDefinition | ( | ASSOCIATE_DEFINITION * | associate_definition, |
FILE * | fp ) |
Writes an associate definition to a standard file.
This function outputs the definition of an associate in the SDDS layout. It includes fields such as name, filename, contents, path, description, and an SDDS flag. The definition is enclosed within &associate and &end tags.
associate_definition | Pointer to the associate definition structure. |
fp | The file pointer where the associate definition will be written. |
Definition at line 493 of file SDDS_write.c.
int32_t SDDS_WriteColumnDefinition | ( | COLUMN_DEFINITION * | column_definition, |
FILE * | fp ) |
Writes a column definition to a standard file.
This function outputs the definition of a single column in the SDDS layout. It includes fields such as name, symbol, units, description, format string, and data type. The definition is enclosed within &column and &end tags.
column_definition | Pointer to the column definition structure. |
fp | The file pointer where the column definition will be written. |
Definition at line 329 of file SDDS_write.c.
int32_t SDDS_WriteDataMode | ( | SDDS_LAYOUT * | layout, |
FILE * | fp ) |
Writes the data mode section to a standard file.
This function outputs the data mode settings of the SDDS layout to the specified file pointer. It includes settings such as mode, lines per row, row counts, endianess, column-major order, and fixed row counts. The section is enclosed within &data and &end tags.
layout | Pointer to the SDDS layout structure containing data mode settings. |
fp | The file pointer where the data mode section will be written. |
Definition at line 576 of file SDDS_write.c.
int32_t SDDS_WriteDescription | ( | char * | text, |
char * | contents, | ||
FILE * | fp ) |
Writes the SDDS description section to a standard file.
This function writes the description section of the SDDS layout, including optional text and contents fields. It encapsulates the data within &description and &end tags.
text | The descriptive text for the SDDS layout. |
contents | The contents description for the SDDS layout. |
fp | The file pointer where the description will be written. |
Definition at line 256 of file SDDS_write.c.
int32_t SDDS_WriteParameterDefinition | ( | PARAMETER_DEFINITION * | parameter_definition, |
FILE * | fp ) |
Writes a parameter definition to a standard file.
This function outputs the definition of a single parameter in the SDDS layout. It includes fields such as name, symbol, units, description, format string, data type, and fixed value. The definition is enclosed within ¶meter and &end tags.
parameter_definition | Pointer to the parameter definition structure. |
fp | The file pointer where the parameter definition will be written. |
Definition at line 411 of file SDDS_write.c.
int32_t SDDS_WriteVersion | ( | int32_t | version_number, |
FILE * | fp ) |
Writes the SDDS protocol version to a standard file.
This function outputs the SDDS protocol version string to the provided file pointer. It is crucial that the protocol version remains unchanged to ensure compatibility.
version_number | The SDDS protocol version number to write. |
fp | The file pointer where the version string will be written. |
Definition at line 59 of file SDDS_write.c.