SDDSlib
|
SDDS (Self Describing Data Set) Data Types Definitions and Function Prototypes. More...
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include "SDDStypes.h"
#include <inttypes.h>
#include <lzma.h>
Go to the source code of this file.
Classes | |
struct | SDDS_DEFINITION |
struct | PARAMETER_DEFINITION |
struct | COLUMN_DEFINITION |
struct | ARRAY_DEFINITION |
struct | ASSOCIATE_DEFINITION |
struct | SORTED_INDEX |
struct | DATA_MODE |
struct | lzmafile |
struct | SDDS_ENUM_PAIR |
struct | SDDS_FIELD_INFORMATION |
struct | SDDS_LAYOUT |
struct | SDDS_ARRAY |
struct | SDDS_FILEBUFFER |
struct | SDDS_DATASET |
Typedefs | |
typedef void * | voidp |
typedef voidp | gzFile |
typedef SDDS_DATASET | SDDS_TABLE |
Functions | |
int | SDDS_CompareIndexedNames (const void *s1, const void *s2) |
Compares two SORTED_INDEX structures by their name fields. | |
int | SDDS_CompareIndexedNamesPtr (const void *s1, const void *s2) |
Compares two pointers to SORTED_INDEX structures by their name fields. | |
epicsShareFuncSDDS int32_t | SDDS_InitializeOutput (SDDS_DATASET *SDDS_dataset, int32_t data_mode, int32_t lines_per_row, const char *description, const char *contents, const char *filename) |
Initializes the SDDS output dataset. | |
epicsShareFuncSDDS int32_t | SDDS_Parallel_InitializeOutput (SDDS_DATASET *SDDS_dataset, const char *description, const char *contents, const char *filename) |
Initializes the SDDS output dataset for parallel processing. | |
epicsShareFuncSDDS int32_t | SDDS_InitializeAppend (SDDS_DATASET *SDDS_dataset, const char *filename) |
Initializes the SDDS dataset for appending data by adding a new page to an existing file. | |
epicsShareFuncSDDS int32_t | SDDS_InitializeAppendToPage (SDDS_DATASET *SDDS_dataset, const char *filename, int64_t updateInterval, int64_t *rowsPresentReturn) |
Initializes the SDDS dataset for appending data to the last page of an existing file. | |
epicsShareFuncSDDS int32_t | SDDS_DisconnectFile (SDDS_DATASET *SDDS_dataset) |
Disconnects the SDDS dataset from its associated file. | |
epicsShareFuncSDDS int32_t | SDDS_ReconnectFile (SDDS_DATASET *SDDS_dataset) |
Reconnects the SDDS dataset to its previously associated file. | |
epicsShareFuncSDDS long | SDDS_DisconnectInputFile (SDDS_DATASET *SDDS_dataset) |
Disconnects the input file from the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_ReconnectInputFile (SDDS_DATASET *SDDS_dataset, long position) |
Reconnects the input file for the SDDS dataset at a specified position. | |
epicsShareFuncSDDS int32_t | SDDS_ReadNewBinaryRows (SDDS_DATASET *SDDS_dataset) |
Reads new binary rows from the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_FreeStringData (SDDS_DATASET *SDDS_dataset) |
epicsShareFuncSDDS int32_t | SDDS_Terminate (SDDS_DATASET *SDDS_dataset) |
epicsShareFuncSDDS void | SDDS_SetTerminateMode (uint32_t mode) |
epicsShareFuncSDDS void | SDDS_SetColumnMemoryMode (SDDS_DATASET *SDDS_dataset, uint32_t mode) |
epicsShareFuncSDDS int32_t | SDDS_GetColumnMemoryMode (SDDS_DATASET *SDDS_dataset) |
epicsShareFuncSDDS int32_t | SDDS_SetRowCountMode (SDDS_DATASET *SDDS_dataset, uint32_t mode) |
Sets the row count mode for the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_SetAutoReadRecovery (SDDS_DATASET *SDDS_dataset, uint32_t mode) |
epicsShareFuncSDDS int32_t | SDDS_UpdateRowCount (SDDS_DATASET *SDDS_dataset) |
epicsShareFuncSDDS void | SDDS_DisableFSync (SDDS_DATASET *SDDS_dataset) |
Disables file synchronization for the SDDS dataset. | |
epicsShareFuncSDDS void | SDDS_EnableFSync (SDDS_DATASET *SDDS_dataset) |
Enables file synchronization for the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_DoFSync (SDDS_DATASET *SDDS_dataset) |
Synchronizes the SDDS dataset's file to disk. | |
epicsShareFuncSDDS int32_t | SDDS_DefineParameter (SDDS_DATASET *SDDS_dataset, const char *name, const char *symbol, const char *units, const char *description, const char *format_string, int32_t type, char *fixed_value) |
Defines a data parameter with a fixed string value. | |
epicsShareFuncSDDS int32_t | SDDS_DefineParameter1 (SDDS_DATASET *SDDS_dataset, const char *name, const char *symbol, const char *units, const char *description, const char *format_string, int32_t type, void *fixed_value) |
Defines a data parameter with a fixed numerical value. | |
epicsShareFuncSDDS int32_t | SDDS_DefineColumn (SDDS_DATASET *SDDS_dataset, const char *name, const char *symbol, const char *units, const char *description, const char *format_string, int32_t type, int32_t field_length) |
Defines a data column within the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_DefineArray (SDDS_DATASET *SDDS_dataset, const char *name, const char *symbol, const char *units, const char *description, const char *format_string, int32_t type, int32_t field_length, int32_t dimensions, const char *group_name) |
Defines a data array within the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_DefineAssociate (SDDS_DATASET *SDDS_dataset, const char *name, const char *filename, const char *path, const char *description, const char *contents, int32_t sdds) |
Defines an associate for the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_IsValidName (const char *name, const char *dataClass) |
Checks if a given name is valid for a specified class within the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_SetNameValidityFlags (uint32_t flags) |
Sets the validity flags for parameter and column names in the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_DefineSimpleColumn (SDDS_DATASET *SDDS_dataset, const char *name, const char *unit, int32_t type) |
Defines a simple data column within the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_DefineSimpleParameter (SDDS_DATASET *SDDS_dataset, const char *name, const char *unit, int32_t type) |
Defines a simple data parameter within the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_DefineSimpleColumns (SDDS_DATASET *SDDS_dataset, int32_t number, char **name, char **unit, int32_t type) |
Defines multiple simple data columns of the same data type within the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_DefineSimpleParameters (SDDS_DATASET *SDDS_dataset, int32_t number, char **name, char **unit, int32_t type) |
Defines multiple simple data parameters of the same data type within the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_SetNoRowCounts (SDDS_DATASET *SDDS_dataset, int32_t value) |
Sets the flag to enable or disable row counts in the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_WriteLayout (SDDS_DATASET *SDDS_dataset) |
Writes the SDDS layout header to the output file. | |
epicsShareFuncSDDS int32_t | SDDS_EraseData (SDDS_DATASET *SDDS_dataset) |
Erases all data entries in the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_ProcessColumnString (SDDS_DATASET *SDDS_dataset, char *string, int32_t mode) |
Process a column definition string. | |
epicsShareFuncSDDS int32_t | SDDS_ProcessParameterString (SDDS_DATASET *SDDS_dataset, char *string, int32_t mode) |
Process a parameter definition string. | |
epicsShareFuncSDDS int32_t | SDDS_ProcessArrayString (SDDS_DATASET *SDDS_dataset, char *string) |
Process an array definition string. | |
epicsShareFuncSDDS int32_t | SDDS_ProcessAssociateString (SDDS_DATASET *SDDS_dataset, char *string) |
Process an associate definition string. | |
epicsShareFuncSDDS int32_t | SDDS_InitializeCopy (SDDS_DATASET *SDDS_target, SDDS_DATASET *SDDS_source, char *filename, char *filemode) |
epicsShareFuncSDDS int32_t | SDDS_CopyLayout (SDDS_DATASET *SDDS_target, SDDS_DATASET *SDDS_source) |
epicsShareFuncSDDS int32_t | SDDS_AppendLayout (SDDS_DATASET *SDDS_target, SDDS_DATASET *SDDS_source, uint32_t mode) |
epicsShareFuncSDDS int32_t | SDDS_CopyPage (SDDS_DATASET *SDDS_target, SDDS_DATASET *SDDS_source) |
epicsShareFuncSDDS int32_t | SDDS_CopyParameters (SDDS_DATASET *SDDS_target, SDDS_DATASET *SDDS_source) |
epicsShareFuncSDDS int32_t | SDDS_CopyArrays (SDDS_DATASET *SDDS_target, SDDS_DATASET *SDDS_source) |
epicsShareFuncSDDS int32_t | SDDS_CopyColumns (SDDS_DATASET *SDDS_target, SDDS_DATASET *SDDS_source) |
epicsShareFuncSDDS int32_t | SDDS_CopyRowsOfInterest (SDDS_DATASET *SDDS_target, SDDS_DATASET *SDDS_source) |
epicsShareFuncSDDS int32_t | SDDS_CopyRow (SDDS_DATASET *SDDS_target, int64_t target_row, SDDS_DATASET *SDDS_source, int64_t source_srow) |
epicsShareFuncSDDS int32_t | SDDS_CopyRowDirect (SDDS_DATASET *SDDS_target, int64_t target_row, SDDS_DATASET *SDDS_source, int64_t source_row) |
epicsShareFuncSDDS int32_t | SDDS_CopyAdditionalRows (SDDS_DATASET *SDDS_target, SDDS_DATASET *SDDS_source) |
epicsShareFuncSDDS int32_t | SDDS_CopyRows (SDDS_DATASET *SDDS_target, SDDS_DATASET *SDDS_source, int64_t firstRow, int64_t lastRow) |
epicsShareFuncSDDS void | SDDS_DeferSavingLayout (SDDS_DATASET *SDDS_dataset, int32_t mode) |
epicsShareFuncSDDS int32_t | SDDS_SaveLayout (SDDS_DATASET *SDDS_dataset) |
epicsShareFuncSDDS int32_t | SDDS_RestoreLayout (SDDS_DATASET *SDDS_dataset) |
epicsShareFuncSDDS int32_t | SDDS_StartPage (SDDS_DATASET *SDDS_dataset, int64_t expected_n_rows) |
epicsShareFuncSDDS int32_t | SDDS_ClearPage (SDDS_DATASET *SDDS_dataset) |
epicsShareFuncSDDS int32_t | SDDS_LengthenTable (SDDS_DATASET *SDDS_dataset, int64_t n_additional_rows) |
epicsShareFuncSDDS int32_t | SDDS_ShortenTable (SDDS_DATASET *SDDS_dataset, int64_t rows) |
epicsShareFuncSDDS int32_t | SDDS_SetParameters (SDDS_DATASET *SDDS_dataset, int32_t mode,...) |
epicsShareFuncSDDS int32_t | SDDS_SetParameter (SDDS_DATASET *SDDS_dataset, int32_t mode,...) |
epicsShareFuncSDDS int32_t | SDDS_SetRowValues (SDDS_DATASET *SDDS_dataset, int32_t mode, int64_t row,...) |
epicsShareFuncSDDS int32_t | SDDS_WritePage (SDDS_DATASET *SDDS_dataset) |
Writes the current data table to the output file. | |
epicsShareFuncSDDS int32_t | SDDS_UpdatePage (SDDS_DATASET *SDDS_dataset, uint32_t mode) |
Updates the current page of the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_SyncDataSet (SDDS_DATASET *SDDS_dataset) |
Synchronizes the SDDS dataset with the disk by flushing buffered data. | |
epicsShareFuncSDDS int32_t | SDDS_SetColumn (SDDS_DATASET *SDDS_dataset, int32_t mode, void *data, int64_t rows,...) |
Sets the values for one data column in the current data table of an SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_SetColumnFromDoubles (SDDS_DATASET *SDDS_dataset, int32_t mode, double *data, int64_t rows,...) |
Sets the values for a single data column using double-precision floating-point numbers. | |
epicsShareFuncSDDS int32_t | SDDS_SetColumnFromFloats (SDDS_DATASET *SDDS_dataset, int32_t mode, float *data, int64_t rows,...) |
Sets the values for a single data column using single-precision floating-point numbers. | |
epicsShareFuncSDDS int32_t | SDDS_SetColumnFromLongs (SDDS_DATASET *SDDS_dataset, int32_t mode, int32_t *data, int64_t rows,...) |
Sets the values for a single data column using long integer numbers. | |
epicsShareFuncSDDS int32_t | SDDS_SetParametersFromDoubles (SDDS_DATASET *SDDS_dataset, int32_t mode,...) |
epicsShareFuncSDDS int32_t | SDDS_GetColumnInformation (SDDS_DATASET *SDDS_dataset, char *field_name, void *memory, int32_t mode,...) |
Retrieves information about a specified column in the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_GetParameterInformation (SDDS_DATASET *SDDS_dataset, char *field_name, void *memory, int32_t mode,...) |
Retrieves information about a specified parameter in the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_GetArrayInformation (SDDS_DATASET *SDDS_dataset, char *field_name, void *memory, int32_t mode,...) |
Retrieves information about a specified array in the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_GetAssociateInformation (SDDS_DATASET *SDDS_dataset, char *field_name, void *memory, int32_t mode,...) |
Retrieves information about a specified associate in the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_ChangeColumnInformation (SDDS_DATASET *SDDS_dataset, char *field_name, void *memory, int32_t mode,...) |
Modifies a specific field in a column definition within the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_ChangeParameterInformation (SDDS_DATASET *SDDS_dataset, char *field_name, void *memory, int32_t mode,...) |
Modifies a specific field in a parameter definition within the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_ChangeArrayInformation (SDDS_DATASET *SDDS_dataset, char *field_name, void *memory, int32_t mode,...) |
Modifies a specific field in an array definition within the SDDS dataset. | |
epicsShareFuncSDDS void | SDDS_SetReadRecoveryMode (SDDS_DATASET *SDDS_dataset, int32_t mode) |
Sets the read recovery mode for an SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_SetDefaultIOBufferSize (int32_t bufferSize) |
epicsShareFuncSDDS int32_t | SDDS_InitializeInputFromSearchPath (SDDS_DATASET *SDDSin, char *file) |
epicsShareFuncSDDS int32_t | SDDS_InitializeInput (SDDS_DATASET *SDDS_dataset, char *filename) |
epicsShareFuncSDDS int32_t | SDDS_ReadLayout (SDDS_DATASET *SDDS_dataset, FILE *fp) |
epicsShareFuncSDDS int32_t | SDDS_InitializeHeaderlessInput (SDDS_DATASET *SDDS_dataset, char *filename) |
Initializes the SDDS dataset for headerless input. | |
epicsShareFuncSDDS int64_t | SDDS_GetRowLimit () |
epicsShareFuncSDDS int64_t | SDDS_SetRowLimit (int64_t limit) |
epicsShareFuncSDDS int32_t | SDDS_GotoPage (SDDS_DATASET *SDDS_dataset, int32_t page_number) |
Sets the current page of the SDDS dataset to the specified page number. | |
epicsShareFuncSDDS int32_t | SDDS_CheckEndOfFile (SDDS_DATASET *SDDS_dataset) |
epicsShareFuncSDDS int32_t | SDDS_ReadPage (SDDS_DATASET *SDDS_dataset) |
epicsShareFuncSDDS int32_t | SDDS_ReadPageSparse (SDDS_DATASET *SDDS_dataset, uint32_t mode, int64_t sparse_interval, int64_t sparse_offset, int32_t sparse_statistics) |
epicsShareFuncSDDS int32_t | SDDS_ReadPageLastRows (SDDS_DATASET *SDDS_dataset, int64_t last_rows) |
epicsShareFuncSDDS int32_t | SDDS_ReadAsciiPage (SDDS_DATASET *SDDS_dataset, int64_t sparse_interval, int64_t sparse_offset, int32_t sparse_statistics) |
Reads the next SDDS ASCII page into memory with optional data sparsity and statistics. | |
epicsShareFuncSDDS int32_t | SDDS_ReadRecoveryPossible (SDDS_DATASET *SDDS_dataset) |
Checks if any data in an SDDS page was recovered after an error was detected. | |
epicsShareFuncSDDS int32_t | SDDS_SetColumnFlags (SDDS_DATASET *SDDS_dataset, int32_t column_flag_value) |
Sets the acceptance flags for all columns in the current data table of a data set. | |
epicsShareFuncSDDS int32_t | SDDS_SetRowFlags (SDDS_DATASET *SDDS_dataset, int32_t row_flag_value) |
Sets the acceptance flags for all rows in the current data table of a data set. | |
epicsShareFuncSDDS int32_t | SDDS_GetRowFlag (SDDS_DATASET *SDDS_dataset, int64_t row) |
Retrieves the acceptance flag of a specific row in the current data table. | |
epicsShareFuncSDDS int32_t | SDDS_GetRowFlags (SDDS_DATASET *SDDS_dataset, int32_t *flag, int64_t rows) |
Retrieves the acceptance flags for all rows in the current data table. | |
epicsShareFuncSDDS int32_t | SDDS_BufferedRead (void *target, int64_t targetSize, FILE *fp, SDDS_FILEBUFFER *fBuffer, int32_t type, int32_t byteOrder) |
epicsShareFuncSDDS int32_t | SDDS_AssertRowFlags (SDDS_DATASET *SDDS_dataset, uint32_t mode,...) |
Sets acceptance flags for rows based on specified criteria. | |
epicsShareFuncSDDS int32_t | SDDS_MatchColumns (SDDS_DATASET *SDDS_dataset, char ***match, int32_t matchMode, int32_t typeMode,...) |
Matches and retrieves column names from an SDDS dataset based on specified criteria. | |
epicsShareFuncSDDS int32_t | SDDS_MatchParameters (SDDS_DATASET *SDDS_dataset, char ***match, int32_t matchMode, int32_t typeMode,...) |
Matches and retrieves parameter names from an SDDS dataset based on specified criteria. | |
epicsShareFuncSDDS int32_t | SDDS_MatchArrays (SDDS_DATASET *SDDS_dataset, char ***match, int32_t matchMode, int32_t typeMode,...) |
Matches and retrieves array names from an SDDS dataset based on specified criteria. | |
epicsShareFuncSDDS int32_t | SDDS_Logic (int32_t previous, int32_t match, uint32_t logic) |
Applies logical operations to determine the new state of a row flag based on previous and current match conditions. | |
epicsShareFuncSDDS int32_t | SDDS_SetColumnsOfInterest (SDDS_DATASET *SDDS_dataset, int32_t mode,...) |
Sets the acceptance flags for columns based on specified naming criteria. | |
epicsShareFuncSDDS int32_t | SDDS_AssertColumnFlags (SDDS_DATASET *SDDS_dataset, uint32_t mode,...) |
Sets acceptance flags for columns based on specified criteria. | |
epicsShareFuncSDDS int64_t | SDDS_SetRowsOfInterest (SDDS_DATASET *SDDS_dataset, char *selection_column, int32_t mode,...) |
Sets the rows of interest in an SDDS dataset based on various selection criteria. | |
epicsShareFuncSDDS int64_t | SDDS_MatchRowsOfInterest (SDDS_DATASET *SDDS_dataset, char *selection_column, char *label_to_match, int32_t logic) |
Matches and marks rows of interest in an SDDS dataset based on label matching. | |
epicsShareFuncSDDS int32_t | SDDS_DeleteColumn (SDDS_DATASET *SDDS_dataset, char *column_name) |
Deletes a specified column from an SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_DeleteParameter (SDDS_DATASET *SDDS_dataset, char *parameter_name) |
Deletes a specified parameter from an SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_DeleteUnsetColumns (SDDS_DATASET *SDDS_dataset) |
Deletes all columns from an SDDS dataset that are not marked as "of interest". | |
epicsShareFuncSDDS int32_t | SDDS_CountColumnsOfInterest (SDDS_DATASET *SDDS_dataset) |
Counts the number of columns marked as "of interest" in the current data table. | |
epicsShareFuncSDDS int32_t | SDDS_ColumnIsOfInterest (SDDS_DATASET *SDDS_dataset, char *name) |
Determines if a specified column is marked as of interest in the dataset. | |
epicsShareFuncSDDS int32_t | SDDS_ColumnCount (SDDS_DATASET *dataset) |
Retrieves the number of columns in the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_ParameterCount (SDDS_DATASET *dataset) |
Retrieves the number of parameters in the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_ArrayCount (SDDS_DATASET *dataset) |
Retrieves the number of arrays in the SDDS dataset. | |
epicsShareFuncSDDS int64_t | SDDS_CountRowsOfInterest (SDDS_DATASET *SDDS_dataset) |
Counts the number of rows marked as "of interest" in the current data table. | |
epicsShareFuncSDDS int32_t | SDDS_DeleteUnsetRows (SDDS_DATASET *SDDS_dataset) |
Deletes rows from an SDDS dataset that are not marked as "of interest". | |
epicsShareFuncSDDS int64_t | SDDS_FilterRowsOfInterest (SDDS_DATASET *SDDS_dataset, char *filter_column, double lower, double upper, int32_t logic) |
Filters rows of interest in an SDDS dataset based on numeric ranges in a specified column. | |
epicsShareFuncSDDS int32_t | SDDS_ItemInsideWindow (void *data, int64_t index, int32_t type, double lower_limit, double upper_limit) |
Checks whether a data item is within a specified numeric window. | |
epicsShareFuncSDDS int64_t | SDDS_FilterRowsByNumScan (SDDS_DATASET *SDDS_dataset, char *filter_column, uint32_t mode) |
Filters rows of interest in an SDDS dataset based on numeric scanning of a specified column. | |
epicsShareFuncSDDS void * | SDDS_GetColumn (SDDS_DATASET *SDDS_dataset, char *column_name) |
Retrieves a copy of the data for a specified column, including only rows marked as "of interest". | |
epicsShareFuncSDDS void * | SDDS_GetInternalColumn (SDDS_DATASET *SDDS_dataset, char *column_name) |
Retrieves an internal pointer to the data of a specified column, including all rows. | |
epicsShareFuncSDDS double * | SDDS_GetColumnInDoubles (SDDS_DATASET *SDDS_dataset, char *column_name) |
Retrieves the data of a specified numerical column as an array of doubles, considering only rows marked as "of interest". | |
epicsShareFuncSDDS float * | SDDS_GetColumnInFloats (SDDS_DATASET *SDDS_dataset, char *column_name) |
Retrieves the data of a specified numerical column as an array of floats, considering only rows marked as "of interest". | |
epicsShareFuncSDDS int32_t * | SDDS_GetColumnInLong (SDDS_DATASET *SDDS_dataset, char *column_name) |
Retrieves the data of a specified numerical column as an array of 32-bit integers, considering only rows marked as "of interest". | |
epicsShareFuncSDDS short * | SDDS_GetColumnInShort (SDDS_DATASET *SDDS_dataset, char *column_name) |
Retrieves the data of a specified numerical column as an array of short integers, considering only rows marked as "of interest". | |
epicsShareFuncSDDS char ** | SDDS_GetColumnInString (SDDS_DATASET *SDDS_dataset, char *column_name) |
Retrieves the data of a specified column as an array of strings, considering only rows marked as "of interest". | |
epicsShareFuncSDDS void * | SDDS_GetNumericColumn (SDDS_DATASET *SDDS_dataset, char *column_name, int32_t desiredType) |
Retrieves the data of a specified numerical column as an array of a desired numerical type, considering only rows marked as "of interest". | |
epicsShareFuncSDDS void * | SDDS_GetRow (SDDS_DATASET *SDDS_dataset, int64_t srow_index, void *memory) |
Retrieves the data of a specific selected row as an array, considering only columns marked as "of interest". | |
epicsShareFuncSDDS void * | SDDS_GetValue (SDDS_DATASET *SDDS_dataset, char *column_name, int64_t srow_index, void *memory) |
Retrieves the value from a specified column and selected row, optionally storing it in provided memory. | |
epicsShareFuncSDDS double | SDDS_GetValueAsDouble (SDDS_DATASET *SDDS_dataset, char *column_name, int64_t srow_index) |
Retrieves the value from a specified column and selected row, casting it to a double. | |
epicsShareFuncSDDS double | SDDS_GetValueByIndexAsDouble (SDDS_DATASET *SDDS_dataset, int32_t column_index, int64_t srow_index) |
Retrieves the value from a specified column and selected row, casting it to a double. | |
epicsShareFuncSDDS void * | SDDS_GetValueByIndex (SDDS_DATASET *SDDS_dataset, int32_t column_index, int64_t srow_index, void *memory) |
Retrieves the value from a specified column and selected row, optionally storing it in provided memory. | |
epicsShareFuncSDDS void * | SDDS_GetValueByAbsIndex (SDDS_DATASET *SDDS_dataset, int32_t column_index, int64_t srow_index, void *memory) |
Retrieves the value from a specified column and absolute row index, optionally storing it in provided memory. | |
epicsShareFuncSDDS void * | SDDS_GetParameter (SDDS_DATASET *SDDS_dataset, char *parameter_name, void *memory) |
Retrieves the value of a specified parameter from the current data table of a data set. | |
epicsShareFuncSDDS void * | SDDS_GetParameterByIndex (SDDS_DATASET *SDDS_dataset, int32_t index, void *memory) |
Retrieves the value of a specified parameter by its index from the current data table of a data set. | |
epicsShareFuncSDDS long double * | SDDS_GetParameterAsLongDouble (SDDS_DATASET *SDDS_dataset, char *parameter_name, long double *data) |
Retrieves the value of a specified parameter as a long double from the current data table of an SDDS dataset. | |
epicsShareFuncSDDS double * | SDDS_GetParameterAsDouble (SDDS_DATASET *SDDS_dataset, char *parameter_name, double *data) |
Retrieves the value of a specified parameter as a double from the current data table of an SDDS dataset. | |
epicsShareFuncSDDS int32_t * | SDDS_GetParameterAsLong (SDDS_DATASET *SDDS_dataset, char *parameter_name, int32_t *data) |
Retrieves the value of a specified parameter as a 32-bit integer from the current data table of a data set. | |
epicsShareFuncSDDS int64_t * | SDDS_GetParameterAsLong64 (SDDS_DATASET *SDDS_dataset, char *parameter_name, int64_t *data) |
Retrieves the value of a specified parameter as a 64-bit integer from the current data table of an SDDS dataset. | |
epicsShareFuncSDDS char * | SDDS_GetParameterAsString (SDDS_DATASET *SDDS_dataset, char *parameter_name, char **memory) |
Retrieves the value of a specified parameter as a string from the current data table of an SDDS dataset. | |
epicsShareFuncSDDS char * | SDDS_GetParameterAsFormattedString (SDDS_DATASET *SDDS_dataset, char *parameter_name, char **memory, char *suppliedformat) |
Retrieves the value of a specified parameter as a formatted string from the current data table of an SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_GetParameters (SDDS_DATASET *SDDS_dataset,...) |
Retrieves multiple parameter values from the current data table of a data set. | |
epicsShareFuncSDDS void * | SDDS_GetFixedValueParameter (SDDS_DATASET *SDDS_dataset, char *parameter_name, void *memory) |
Retrieves the fixed value of a specified parameter from an SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_GetDescription (SDDS_DATASET *SDDS_dataset, char **text, char **contents) |
Retrieves the text and contents descriptions from an SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_SetArrayUnitsConversion (SDDS_DATASET *SDDS_dataset, char *column_name, char *new_units, char *old_units, double factor) |
Sets unit conversions for a specified array in an SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_SetColumnUnitsConversion (SDDS_DATASET *SDDS_dataset, char *column_name, char *new_units, char *old_units, double factor) |
Sets unit conversions for a specified column in an SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_SetParameterUnitsConversion (SDDS_DATASET *SDDS_dataset, char *column_name, char *new_units, char *old_units, double factor) |
Sets unit conversions for a specified parameter in an SDDS dataset. | |
epicsShareFuncSDDS void * | SDDS_GetMatrixOfRows (SDDS_DATASET *SDDS_dataset, int64_t *n_rows) |
Retrieves all rows marked as "of interest" as a matrix (array of row arrays). | |
epicsShareFuncSDDS void * | SDDS_GetCastMatrixOfRows (SDDS_DATASET *SDDS_dataset, int64_t *n_rows, int32_t sddsType) |
Retrieves all rows marked as "of interest" as a matrix, casting each value to a specified numerical type. | |
epicsShareFuncSDDS void * | SDDS_GetMatrixFromColumn (SDDS_DATASET *SDDS_dataset, char *column_name, int64_t dimension1, int64_t dimension2, int32_t mode) |
Extracts a matrix from a specified column in the current data table of an SDDS dataset. | |
epicsShareFuncSDDS void * | SDDS_GetDoubleMatrixFromColumn (SDDS_DATASET *SDDS_dataset, char *column_name, int64_t dimension1, int64_t dimension2, int32_t mode) |
Extracts a matrix of doubles from a specified column in the current data table of an SDDS dataset. | |
epicsShareFuncSDDS SDDS_ARRAY * | SDDS_GetArray (SDDS_DATASET *SDDS_dataset, char *array_name, SDDS_ARRAY *memory) |
Retrieves an array from the current data table of an SDDS dataset. | |
epicsShareFuncSDDS double * | SDDS_GetArrayInDoubles (SDDS_DATASET *SDDS_dataset, char *array_name, int32_t *values) |
Retrieves an array from the current data table of an SDDS dataset and converts its elements to doubles. | |
epicsShareFuncSDDS int32_t * | SDDS_GetArrayInLong (SDDS_DATASET *SDDS_dataset, char *array_name, int32_t *values) |
Retrieves an array from the current data table of an SDDS dataset and converts its elements to 32-bit integers. | |
epicsShareFuncSDDS char ** | SDDS_GetArrayInString (SDDS_DATASET *SDDS_dataset, char *array_name, int32_t *values) |
Retrieves an array from the current data table of an SDDS dataset and converts its elements to strings. | |
epicsShareFuncSDDS int32_t | SDDS_SetArrayVararg (SDDS_DATASET *SDDS_dataset, char *array_name, int32_t mode, void *data_pointer,...) |
Sets the values of an array variable in the SDDS dataset using variable arguments for dimensions. | |
epicsShareFuncSDDS int32_t | SDDS_SetArray (SDDS_DATASET *SDDS_dataset, char *array_name, int32_t mode, void *data_pointer, int32_t *dimension) |
Sets the values of an array variable in the SDDS dataset using specified dimensions. | |
epicsShareFuncSDDS int32_t | SDDS_AppendToArrayVararg (SDDS_DATASET *SDDS_dataset, char *array_name, int32_t mode, void *data_pointer, int32_t elements,...) |
Appends data to an existing array variable in the SDDS dataset using variable arguments for dimensions. | |
epicsShareFuncSDDS void * | SDDS_Realloc (void *old_ptr, size_t new_size) |
Reallocates memory to a new size. | |
epicsShareFuncSDDS void * | SDDS_Malloc (size_t size) |
Allocates memory of a specified size. | |
epicsShareFuncSDDS void | SDDS_Free (void *mem) |
Free memory previously allocated by SDDS_Malloc. | |
epicsShareFuncSDDS void * | SDDS_Calloc (size_t nelem, size_t elem_size) |
Allocates zero-initialized memory for an array of elements. | |
epicsShareFuncSDDS int32_t | SDDS_NumberOfErrors (void) |
Retrieves the number of errors recorded by SDDS library routines. | |
epicsShareFuncSDDS void | SDDS_ClearErrors (void) |
Clears all recorded error messages from the SDDS error stack. | |
epicsShareFuncSDDS void | SDDS_SetError (char *error_text) |
Records an error message in the SDDS error stack. | |
epicsShareFuncSDDS void | SDDS_SetError0 (char *error_text) |
Internal function to record an error message in the SDDS error stack. | |
epicsShareFuncSDDS void | SDDS_Bomb (char *message) |
Terminates the program after printing an error message and recorded errors. | |
epicsShareFuncSDDS void | SDDS_Warning (char *message) |
Prints a warning message to stderr . | |
epicsShareFuncSDDS void | SDDS_RegisterProgramName (const char *name) |
Registers the executable program name for use in error messages. | |
epicsShareFuncSDDS void | SDDS_PrintErrors (FILE *fp, int32_t mode) |
Prints recorded error messages to a specified file stream. | |
epicsShareFuncSDDS char ** | SDDS_GetErrorMessages (int32_t *number, int32_t mode) |
Retrieves recorded error messages from the SDDS error stack. | |
epicsShareFuncSDDS char ** | SDDS_GetColumnNames (SDDS_DATASET *SDDS_dataset, int32_t *number) |
Retrieves the names of all columns in the SDDS dataset. | |
epicsShareFuncSDDS char ** | SDDS_GetParameterNames (SDDS_DATASET *SDDS_dataset, int32_t *number) |
Retrieves the names of all parameters in the SDDS dataset. | |
epicsShareFuncSDDS char ** | SDDS_GetAssociateNames (SDDS_DATASET *SDDS_dataset, int32_t *number) |
Retrieves the names of all associates in the SDDS dataset. | |
epicsShareFuncSDDS char ** | SDDS_GetArrayNames (SDDS_DATASET *SDDS_dataset, int32_t *number) |
Retrieves the names of all arrays in the SDDS dataset. | |
epicsShareFuncSDDS COLUMN_DEFINITION * | SDDS_GetColumnDefinition (SDDS_DATASET *SDDS_dataset, char *name) |
Retrieves the definition of a specified column from the SDDS dataset. | |
epicsShareFuncSDDS COLUMN_DEFINITION * | SDDS_CopyColumnDefinition (COLUMN_DEFINITION **target, COLUMN_DEFINITION *source) |
Creates a copy of a column definition. | |
epicsShareFuncSDDS int32_t | SDDS_FreeColumnDefinition (COLUMN_DEFINITION *source) |
Frees memory allocated for a column definition. | |
epicsShareFuncSDDS int32_t | SDDS_TransferColumnDefinition (SDDS_DATASET *target, SDDS_DATASET *source, char *name, char *newName) |
Transfers a column definition from a source dataset to a target dataset. | |
epicsShareFuncSDDS int32_t | SDDS_DefineColumnLikeParameter (SDDS_DATASET *target, SDDS_DATASET *source, char *name, char *newName) |
Defines a column in the target dataset based on a parameter definition from the source dataset. | |
epicsShareFuncSDDS int32_t | SDDS_DefineColumnLikeArray (SDDS_DATASET *target, SDDS_DATASET *source, char *name, char *newName) |
Defines a column in the target dataset based on an array definition from the source dataset. | |
epicsShareFuncSDDS int32_t | SDDS_TransferAllColumnDefinitions (SDDS_DATASET *SDDS_target, SDDS_DATASET *SDDS_source, uint32_t mode) |
Transfers all column definitions from a source dataset to a target dataset. | |
epicsShareFuncSDDS 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. | |
epicsShareFuncSDDS PARAMETER_DEFINITION * | SDDS_GetParameterDefinition (SDDS_DATASET *SDDS_dataset, char *name) |
Retrieves the definition of a specified parameter from the SDDS dataset. | |
epicsShareFuncSDDS PARAMETER_DEFINITION * | SDDS_CopyParameterDefinition (PARAMETER_DEFINITION **target, PARAMETER_DEFINITION *source) |
Creates a copy of a parameter definition. | |
epicsShareFuncSDDS int32_t | SDDS_FreeParameterDefinition (PARAMETER_DEFINITION *source) |
Frees memory allocated for a parameter definition. | |
epicsShareFuncSDDS int32_t | SDDS_TransferParameterDefinition (SDDS_DATASET *target, SDDS_DATASET *source, char *name, char *newName) |
Transfers a parameter definition from a source dataset to a target dataset. | |
epicsShareFuncSDDS int32_t | SDDS_DefineParameterLikeColumn (SDDS_DATASET *target, SDDS_DATASET *source, char *name, char *newName) |
Defines a parameter in the target dataset based on a column definition from the source dataset. | |
epicsShareFuncSDDS int32_t | SDDS_DefineParameterLikeArray (SDDS_DATASET *target, SDDS_DATASET *source, char *name, char *newName) |
Defines a parameter in the target dataset based on an array definition from the source dataset. | |
epicsShareFuncSDDS int32_t | SDDS_TransferAllParameterDefinitions (SDDS_DATASET *SDDS_target, SDDS_DATASET *SDDS_source, uint32_t mode) |
Transfers all parameter definitions from a source dataset to a target dataset. | |
epicsShareFuncSDDS ARRAY_DEFINITION * | SDDS_GetArrayDefinition (SDDS_DATASET *SDDS_dataset, char *name) |
Retrieves the definition of a specified array from the SDDS dataset. | |
epicsShareFuncSDDS ARRAY_DEFINITION * | SDDS_CopyArrayDefinition (ARRAY_DEFINITION **target, ARRAY_DEFINITION *source) |
Creates a copy of an array definition. | |
epicsShareFuncSDDS int32_t | SDDS_FreeArrayDefinition (ARRAY_DEFINITION *source) |
Frees memory allocated for an array definition. | |
epicsShareFuncSDDS int32_t | SDDS_TransferArrayDefinition (SDDS_DATASET *target, SDDS_DATASET *source, char *name, char *newName) |
Transfers an array definition from a source dataset to a target dataset. | |
epicsShareFuncSDDS int32_t | SDDS_TransferAllArrayDefinitions (SDDS_DATASET *SDDS_target, SDDS_DATASET *SDDS_source, uint32_t mode) |
Transfers all array definitions from a source dataset to a target dataset. | |
epicsShareFuncSDDS ASSOCIATE_DEFINITION * | SDDS_GetAssociateDefinition (SDDS_DATASET *SDDS_dataset, char *name) |
Retrieves the definition of a specified associate from the SDDS dataset. | |
epicsShareFuncSDDS ASSOCIATE_DEFINITION * | SDDS_CopyAssociateDefinition (ASSOCIATE_DEFINITION **target, ASSOCIATE_DEFINITION *source) |
Creates a copy of an associate definition. | |
epicsShareFuncSDDS int32_t | SDDS_FreeAssociateDefinition (ASSOCIATE_DEFINITION *source) |
Frees memory allocated for an associate definition. | |
epicsShareFuncSDDS int32_t | SDDS_TransferAssociateDefinition (SDDS_DATASET *target, SDDS_DATASET *source, char *name, char *newName) |
Transfers an associate definition from a source dataset to a target dataset. | |
epicsShareFuncSDDS int32_t | SDDS_GetColumnIndex (SDDS_DATASET *SDDS_dataset, char *name) |
Retrieves the index of a named column in the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_GetParameterIndex (SDDS_DATASET *SDDS_dataset, char *name) |
Retrieves the index of a named parameter in the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_GetArrayIndex (SDDS_DATASET *SDDS_dataset, char *name) |
Retrieves the index of a named array in the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_GetAssociateIndex (SDDS_DATASET *SDDS_dataset, char *name) |
Retrieves the index of a named associate in the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_GetColumnType (SDDS_DATASET *SDDS_dataset, int32_t index) |
Retrieves the data type of a column in the SDDS dataset by its index. | |
epicsShareFuncSDDS int32_t | SDDS_GetNamedColumnType (SDDS_DATASET *SDDS_dataset, char *name) |
Retrieves the data type of a column in the SDDS dataset by its name. | |
epicsShareFuncSDDS int32_t | SDDS_GetParameterType (SDDS_DATASET *SDDS_dataset, int32_t index) |
Retrieves the data type of a parameter in the SDDS dataset by its index. | |
epicsShareFuncSDDS int32_t | SDDS_GetNamedParameterType (SDDS_DATASET *SDDS_dataset, char *name) |
Retrieves the data type of a parameter in the SDDS dataset by its name. | |
epicsShareFuncSDDS int32_t | SDDS_GetArrayType (SDDS_DATASET *SDDS_dataset, int32_t index) |
Retrieves the data type of an array in the SDDS dataset by its index. | |
epicsShareFuncSDDS int32_t | SDDS_GetNamedArrayType (SDDS_DATASET *SDDS_dataset, char *name) |
Retrieves the data type of an array in the SDDS dataset by its name. | |
epicsShareFuncSDDS int32_t | SDDS_GetTypeSize (int32_t type) |
Retrieves the size in bytes of a specified SDDS data type. | |
epicsShareFuncSDDS char * | SDDS_GetTypeName (int32_t type) |
Retrieves the name of a specified SDDS data type as a string. | |
epicsShareFuncSDDS int32_t | SDDS_IdentifyType (char *typeName) |
Identifies the SDDS data type based on its string name. | |
epicsShareFuncSDDS char * | SDDS_FindColumn (SDDS_DATASET *SDDS_dataset, int32_t mode,...) |
Finds the first column in the SDDS dataset that matches the specified criteria. | |
epicsShareFuncSDDS char * | SDDS_FindParameter (SDDS_DATASET *SDDS_dataset, int32_t mode,...) |
Finds the first parameter in the SDDS dataset that matches the specified criteria. | |
epicsShareFuncSDDS char * | SDDS_FindArray (SDDS_DATASET *SDDS_dataset, int32_t mode,...) |
Finds the first array in the SDDS dataset that matches the specified criteria. | |
epicsShareFuncSDDS int32_t | SDDS_CheckColumn (SDDS_DATASET *SDDS_dataset, char *name, char *units, int32_t type, FILE *fp_message) |
Checks if a column exists in the SDDS dataset with the specified name, units, and type. | |
epicsShareFuncSDDS int32_t | SDDS_CheckParameter (SDDS_DATASET *SDDS_dataset, char *name, char *units, int32_t type, FILE *fp_message) |
Checks if a parameter exists in the SDDS dataset with the specified name, units, and type. | |
epicsShareFuncSDDS int32_t | SDDS_CheckArray (SDDS_DATASET *SDDS_dataset, char *name, char *units, int32_t type, FILE *fp_message) |
Checks if an array exists in the SDDS dataset with the specified name, units, and type. | |
epicsShareFuncSDDS int32_t | SDDS_VerifyArrayExists (SDDS_DATASET *SDDS_dataset, int32_t mode,...) |
Verifies the existence of an array in the SDDS dataset based on specified criteria. | |
epicsShareFuncSDDS int32_t | SDDS_VerifyColumnExists (SDDS_DATASET *SDDS_dataset, int32_t mode,...) |
Verifies the existence of a column in the SDDS dataset based on specified criteria. | |
epicsShareFuncSDDS int32_t | SDDS_VerifyParameterExists (SDDS_DATASET *SDDS_dataset, int32_t mode,...) |
Verifies the existence of a parameter in the SDDS dataset based on specified criteria. | |
epicsShareFuncSDDS int32_t | SDDS_PrintCheckText (FILE *fp, char *name, char *units, int32_t type, char *class_name, int32_t error_code) |
Prints detailed error messages related to SDDS entity checks. | |
epicsShareFuncSDDS int32_t | SDDS_IsActive (SDDS_DATASET *SDDS_dataset) |
Checks whether an SDDS dataset is currently active. | |
epicsShareFuncSDDS int32_t | SDDS_ForceInactive (SDDS_DATASET *SDDS_dataset) |
Marks an SDDS dataset as inactive. | |
epicsShareFuncSDDS int32_t | SDDS_LockFile (FILE *fp, const char *filename, const char *callerName) |
Attempts to lock a specified file. | |
epicsShareFuncSDDS int32_t | SDDS_FileIsLocked (const char *filename) |
Determines if a specified file is locked. | |
epicsShareFuncSDDS int32_t | SDDS_BreakIntoLockedFile (char *filename) |
Attempts to override a locked file by creating a temporary copy. | |
epicsShareFuncSDDS int32_t | SDDS_CopyString (char **target, const char *source) |
Copies a source string to a target string with memory allocation. | |
epicsShareFuncSDDS int32_t | SDDS_CopyStringArray (char **target, char **source, int64_t n_strings) |
Copies an array of strings from source to target. | |
epicsShareFuncSDDS int32_t | SDDS_FreeStringArray (char **string, int64_t strings) |
Frees an array of strings by deallocating each individual string. | |
epicsShareFuncSDDS int32_t | SDDS_VerifyPrintfFormat (const char *format_string, int32_t type) |
Verifies that a printf format string is compatible with a specified data type. | |
epicsShareFuncSDDS int32_t | SDDS_HasWhitespace (char *string) |
Checks if a string contains any whitespace characters. | |
epicsShareFuncSDDS char * | fgetsSkipComments (SDDS_DATASET *SDDS_dataset, char *s, int32_t slen, FILE *fp, char skip_char) |
Reads a line from a file while skipping comment lines. | |
epicsShareFuncSDDS char * | fgetsSkipCommentsResize (SDDS_DATASET *SDDS_dataset, char **s, int32_t *slen, FILE *fp, char skip_char) |
Reads a line from a file with dynamic buffer resizing while skipping comment lines. | |
epicsShareFuncSDDS void | SDDS_CutOutComments (SDDS_DATASET *SDDS_dataset, char *s, char cc) |
Removes comments from a string based on a specified comment character. | |
epicsShareFuncSDDS void | SDDS_EscapeNewlines (char *s) |
Escapes newline characters in a string by replacing them with "\\n". | |
epicsShareFuncSDDS void | SDDS_EscapeQuotes (char *s, char quote_char) |
Escapes quote characters within a string by inserting backslashes. | |
epicsShareFuncSDDS void | SDDS_UnescapeQuotes (char *s, char quote_char) |
Removes escape characters from quote characters within a string. | |
epicsShareFuncSDDS int32_t | SDDS_IsQuoted (char *string, char *position, char quotation_mark) |
Checks if a position in a string is within a quoted section. | |
epicsShareFuncSDDS int32_t | SDDS_GetToken (char *s, char *buffer, int32_t buflen) |
Extracts the next token from a string, handling quoted substrings and escape characters. | |
epicsShareFuncSDDS int32_t | SDDS_GetToken2 (char *s, char **st, int32_t *strlength, char *buffer, int32_t buflen) |
Extracts the next token from a string, handling quoted substrings and escape characters, with updated string pointers. | |
epicsShareFuncSDDS int32_t | SDDS_PadToLength (char *string, int32_t length) |
Pads a string with spaces to reach a specified length. | |
epicsShareFuncSDDS void | SDDS_EscapeCommentCharacters (char *string, char cc) |
Escapes comment characters within a string by inserting backslashes. | |
epicsShareFuncSDDS void | SDDS_InterpretEscapes (char *s) |
Interprets and converts escape sequences in a string. | |
epicsShareFuncSDDS int32_t | SDDS_ZeroMemory (void *mem, int64_t n_bytes) |
Sets a block of memory to zero. | |
epicsShareFuncSDDS int32_t | SDDS_SetMemory (void *mem, int64_t n_elements, int32_t data_type,...) |
Initializes a memory block with a sequence of values based on a specified data type. | |
epicsShareFuncSDDS int32_t | SDDS_SprintTypedValue (void *data, int64_t index, int32_t type, const char *format, char *buffer, uint32_t mode) |
Formats a data value of a specified type into a string buffer using an optional printf format string. | |
epicsShareFuncSDDS int32_t | SDDS_SprintTypedValueFactor (void *data, int64_t index, int32_t type, const char *format, char *buffer, uint32_t mode, double factor) |
Reallocates memory to a new size and zero-initializes the additional space. | |
epicsShareFuncSDDS int32_t | SDDS_PrintTypedValue (void *data, int64_t index, int32_t type, char *format, FILE *fp, uint32_t mode) |
Prints a data value of a specified type using an optional printf format string. | |
epicsShareFuncSDDS int32_t | SDDS_WriteTypedValue (void *data, int64_t index, int32_t type, char *format, FILE *fp) |
Writes a typed value to an ASCII file stream. | |
epicsShareFuncSDDS void * | SDDS_CastValue (void *data, int64_t index, int32_t data_type, int32_t desired_type, void *memory) |
Casts a value from one SDDS data type to another. | |
epicsShareFuncSDDS void | SDDS_RemovePadding (char *s) |
Removes leading and trailing whitespace from a string. | |
epicsShareFuncSDDS int32_t | SDDS_StringIsBlank (char *s) |
Checks if a string is blank (contains only whitespace characters). | |
epicsShareFuncSDDS void * | SDDS_AllocateMatrix (int32_t size, int64_t dim1, int64_t dim2) |
Allocates a two-dimensional matrix with zero-initialized elements. | |
epicsShareFuncSDDS void | SDDS_FreeMatrix (void **ptr, int64_t dim1) |
Frees memory allocated for a two-dimensional matrix. | |
epicsShareFuncSDDS void | SDDS_FreeArray (SDDS_ARRAY *array) |
Frees memory allocated for an SDDS array structure. | |
epicsShareFuncSDDS void * | SDDS_MakePointerArray (void *data, int32_t type, int32_t dimensions, int32_t *dimension) |
Creates a multi-dimensional pointer array from a contiguous data block. | |
epicsShareFuncSDDS int32_t | SDDS_ApplyFactorToParameter (SDDS_DATASET *SDDS_dataset, char *name, double factor) |
Applies a scaling factor to a specific parameter in the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_ApplyFactorToColumn (SDDS_DATASET *SDDS_dataset, char *name, double factor) |
Applies a scaling factor to all elements of a specific column in the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_DeleteParameterFixedValues (SDDS_DATASET *SDDS_dataset) |
Deletes fixed values from all parameters in the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_SetDataMode (SDDS_DATASET *SDDS_dataset, int32_t newmode) |
Sets the data mode (ASCII or Binary) for the SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_CheckDataset (SDDS_DATASET *SDDS_dataset, const char *caller) |
Validates the SDDS dataset pointer. | |
epicsShareFuncSDDS int32_t | SDDS_CheckTabularData (SDDS_DATASET *SDDS_dataset, const char *caller) |
Validates the consistency of tabular data within an SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_CheckDatasetStructureSize (int32_t size) |
Verifies that the size of the SDDS_DATASET structure matches the expected size. | |
epicsShareFuncSDDS uint32_t | SDDS_SetAutoCheckMode (uint32_t newMode) |
Sets the automatic check mode for SDDS dataset validation. | |
epicsShareFuncSDDS int32_t | SDDS_FlushBuffer (FILE *fp, SDDS_FILEBUFFER *fBuffer) |
epicsShareFuncSDDS int32_t | SDDS_BufferedWrite (void *target, int64_t targetSize, FILE *fp, SDDS_FILEBUFFER *fBuffer) |
epicsShareFuncSDDS int32_t | SDDS_ScanData (char *string, int32_t type, int32_t field_length, void *data, int64_t index, int32_t is_parameter) |
Scans a string and saves the parsed value into a data pointer according to the specified data type. | |
epicsShareFuncSDDS int32_t | SDDS_ScanData2 (char *string, char **pstring, int32_t *strlength, int32_t type, int32_t field_length, void *data, int64_t index, int32_t is_parameter) |
Scans a string and saves the parsed value into a data pointer, optimized for long strings. | |
epicsShareFuncSDDS long double | SDDS_ConvertToLongDouble (int32_t type, void *data, int64_t index) |
Converts a value to long double based on its type. | |
epicsShareFuncSDDS double | SDDS_ConvertToDouble (int32_t type, void *data, int64_t index) |
Converts a value to double based on its type. | |
epicsShareFuncSDDS int64_t | SDDS_ConvertToLong64 (int32_t type, void *data, int64_t index) |
Converts a value to a 64-bit integer based on its type. | |
epicsShareFuncSDDS int32_t | SDDS_ConvertToLong (int32_t type, void *data, int64_t index) |
Converts a value to a 32-bit integer based on its type. | |
epicsShareFuncSDDS int32_t | SDDS_WriteBinaryString (char *string, FILE *fp, SDDS_FILEBUFFER *fBuffer) |
Writes a binary string to a file with buffering. | |
epicsShareFuncSDDS int64_t | SDDS_CreateRpnMemory (const char *name, short is_string) |
Stub function for creating RPN memory when RPN_SUPPORT is not enabled. | |
epicsShareFuncSDDS int64_t | SDDS_CreateRpnArray (char *name) |
Stub function for creating RPN arrays when RPN_SUPPORT is not enabled. | |
epicsShareFuncSDDS int32_t | SDDS_IsBigEndianMachine () |
Determines whether the current machine uses big-endian byte ordering. | |
void | SDDS_SwapShort (short *data) |
Swaps the endianness of a short integer. | |
void | SDDS_SwapUShort (unsigned short *data) |
Swaps the endianness of an unsigned short integer. | |
epicsShareFuncSDDS void | SDDS_SwapLong (int32_t *data) |
Swaps the endianness of a 32-bit integer. | |
epicsShareFuncSDDS void | SDDS_SwapULong (uint32_t *data) |
Swaps the endianness of a 32-bit unsigned integer. | |
epicsShareFuncSDDS void | SDDS_SwapLong64 (int64_t *data) |
Swaps the endianness of a 64-bit integer. | |
epicsShareFuncSDDS void | SDDS_SwapULong64 (uint64_t *data) |
Swaps the endianness of a 64-bit unsigned integer. | |
void | SDDS_SwapFloat (float *data) |
Swaps the endianness of a float. | |
void | SDDS_SwapDouble (double *data) |
Swaps the endianness of a double. | |
void | SDDS_SwapLongDouble (long double *data) |
Swaps the endianness of a long double. | |
epicsShareFuncSDDS int32_t | SDDS_SwapEndsArrayData (SDDS_DATASET *SDDSin) |
Swaps the endianness of the array data in an SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_SwapEndsParameterData (SDDS_DATASET *SDDSin) |
Swaps the endianness of the parameter data in an SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_SwapEndsColumnData (SDDS_DATASET *SDDSin) |
Swaps the endianness of the column data in an SDDS dataset. | |
epicsShareFuncSDDS int32_t | SDDS_ReadNonNativePage (SDDS_DATASET *SDDS_dataset) |
Reads a non-native endian page from an SDDS dataset. | |
int32_t | SDDS_ReadNonNativePageSparse (SDDS_DATASET *SDDS_dataset, uint32_t mode, int64_t sparse_interval, int64_t sparse_offset) |
Reads a sparse non-native endian page from an SDDS dataset. | |
int32_t | SDDS_ReadNonNativeBinaryPage (SDDS_DATASET *SDDS_dataset, int64_t sparse_interval, int64_t sparse_offset) |
Reads a non-native endian binary page from an SDDS dataset. | |
int32_t | SDDS_ReadNonNativeBinaryParameters (SDDS_DATASET *SDDS_dataset) |
Reads non-native endian binary parameters from an SDDS dataset. | |
int32_t | SDDS_ReadNonNativeBinaryArrays (SDDS_DATASET *SDDS_dataset) |
Reads non-native endian binary arrays from an SDDS dataset. | |
int32_t | SDDS_ReadNonNativeBinaryRow (SDDS_DATASET *SDDS_dataset, int64_t row, int32_t skip) |
Reads a non-native endian binary row from an SDDS dataset. | |
char * | SDDS_ReadNonNativeBinaryString (FILE *fp, SDDS_FILEBUFFER *fBuffer, int32_t skip) |
Reads a non-native endian binary string from a file. | |
epicsShareFuncSDDS int32_t | SDDS_WriteNonNativeBinaryPage (SDDS_DATASET *SDDS_dataset) |
Writes a non-native endian binary page to an SDDS dataset. | |
int32_t | SDDS_WriteNonNativeBinaryParameters (SDDS_DATASET *SDDS_dataset) |
Writes non-native endian binary parameters to an SDDS dataset. | |
int32_t | SDDS_WriteNonNativeBinaryArrays (SDDS_DATASET *SDDS_dataset) |
Writes non-native endian binary arrays to an SDDS dataset. | |
int32_t | SDDS_WriteNonNativeBinaryRow (SDDS_DATASET *SDDS_dataset, int64_t row) |
Writes a non-native endian binary row to an SDDS dataset. | |
int32_t | SDDS_WriteNonNativeBinaryString (char *string, FILE *fp, SDDS_FILEBUFFER *fBuffer) |
Writes a non-native endian binary string to a file. | |
epicsShareFuncSDDS char ** | getMatchingSDDSNames (SDDS_DATASET *dataset, char **matchName, int32_t matches, int32_t *names, short match_type) |
Retrieves an array of matching SDDS entity names based on specified criteria. | |
epicsShareFuncSDDS SDDS_DATASET * | SDDS_CreateEmptyDataset (void) |
Creates an empty SDDS dataset. | |
Variables | |
epicsShareExtern char * | SDDS_type_name [SDDS_NUM_TYPES] |
epicsShareExtern int32_t | SDDS_type_size [SDDS_NUM_TYPES] |
char * | SDDS_data_mode [SDDS_NUM_DATA_MODES] |
Array of supported data modes. | |
SDDS_FIELD_INFORMATION | SDDS_ArrayFieldInformation [SDDS_ARRAY_FIELDS] |
Field information for array definitions. | |
SDDS_FIELD_INFORMATION | SDDS_ColumnFieldInformation [SDDS_COLUMN_FIELDS] |
Field information for column definitions. | |
SDDS_FIELD_INFORMATION | SDDS_ParameterFieldInformation [SDDS_PARAMETER_FIELDS] |
Field information for parameter definitions. | |
SDDS_FIELD_INFORMATION | SDDS_AssociateFieldInformation [SDDS_ASSOCIATE_FIELDS] |
Field information for associate definitions. | |
SDDS_FIELD_INFORMATION | SDDS_DescriptionFieldInformation [SDDS_DESCRIPTION_FIELDS] |
Field information for SDDS layout descriptions. | |
SDDS_FIELD_INFORMATION | SDDS_IncludeFieldInformation [SDDS_INCLUDE_FIELDS] |
Field information for include directives. | |
SDDS_FIELD_INFORMATION | SDDS_DataFieldInformation [SDDS_DATA_FIELDS] |
Field information for data mode settings. | |
SDDS (Self Describing Data Set) Data Types Definitions and Function Prototypes.
This header file defines the data types, macros, structures, and function prototypes used for handling SDDS files. SDDS is a file protocol designed to store and transfer scientific data efficiently.
Definition in file SDDS.h.
#define SDDS_CheckTableStructureSize | ( | a | ) |
#define SDDS_CopyTable | ( | a, | |
b ) |
#define SDDS_IsDisconnected | ( | SDDSptr | ) |
#define SDDS_LayoutWritten | ( | SDDSptr | ) |
#define SDDS_ReadTable | ( | a | ) |
#define SDDS_RowCount | ( | SDDS_dataset | ) |
#define SDDS_StartTable | ( | a, | |
b ) |
#define SDDS_UpdateTable | ( | a | ) |
#define SDDS_WriteTable | ( | a | ) |
typedef SDDS_DATASET SDDS_TABLE |
|
extern |
Reads a line from a file while skipping comment lines.
This function reads lines from the specified file stream, ignoring lines that begin with the specified skip_char
. It also processes special comment lines that start with !#
by parsing them using SDDS_ParseSpecialComments
.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure, used for processing comments. |
[out] | s | Pointer to a character array where the read line will be stored. |
[in] | slen | The maximum number of characters to read into s . |
[in] | fp | Pointer to the FILE stream to read from. |
[in] | skip_char | Character indicating the start of a comment line. Lines beginning with this character will be skipped. |
s
containing the read line. If the end of the file is reached or an error occurs, returns NULL
.s
by removing comments as determined by SDDS_CutOutComments
.Definition at line 1451 of file SDDS_utils.c.
|
extern |
Reads a line from a file with dynamic buffer resizing while skipping comment lines.
This function reads lines from the specified file stream, ignoring lines that begin with the specified skip_char
. If a line exceeds the current buffer size, the buffer is dynamically resized to accommodate the entire line. It also processes special comment lines that start with !#
by parsing them using SDDS_ParseSpecialComments
.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure, used for processing comments. |
[in,out] | s | Pointer to a pointer to a character array where the read line will be stored. This buffer may be resized if necessary. |
[in,out] | slen | Pointer to an int32_t variable specifying the current size of the buffer s . This value may be updated if the buffer is resized. |
[in] | fp | Pointer to the FILE stream to read from. |
[in] | skip_char | Character indicating the start of a comment line. Lines beginning with this character will be skipped. |
*s
containing the read line. If the end of the file is reached or an error occurs, returns NULL
.*s
, including freeing it when no longer needed.Definition at line 1482 of file SDDS_utils.c.
|
extern |
Retrieves an array of matching SDDS entity names based on specified criteria.
This function processes a list of SDDS entity names (columns, parameters, or arrays) and selects those that match the provided criteria. It supports wildcard matching and exact matching based on the presence of wildcards in the names.
[in] | dataset | Pointer to the SDDS_DATASET structure representing the dataset to be searched. |
[in] | matchName | Array of strings containing the names or patterns to match against the dataset's entities. |
[in] | matches | The number of names/patterns provided in matchName . |
[out] | names | Pointer to an int32_t that will be set to the number of matched names. |
[in] | type | Specifies the type of SDDS entity to match. Valid values are:
|
char **
) containing the names of the matched SDDS entities.NULL
.wild_match
for pattern matching when wildcards are present in the matchName
entries.type
parameter is correctly specified to match the intended SDDS entity class.type
value will cause the function to terminate the program with an error message.Definition at line 5556 of file SDDS_utils.c.
|
extern |
Allocates a two-dimensional matrix with zero-initialized elements.
This function allocates memory for a two-dimensional matrix based on the specified dimensions and element size. Each row of the matrix is individually allocated and initialized to zero.
[in] | size | The size in bytes of each element in the matrix. |
[in] | dim1 | The number of rows in the matrix. |
[in] | dim2 | The number of columns in the matrix. |
NULL
if memory allocation fails.calloc
to ensure that all elements are zero-initialized.SDDS_FreeMatrix
.Definition at line 2739 of file SDDS_utils.c.
|
extern |
Appends layout definitions (columns, parameters, associates, arrays) from one SDDS_DATASET to another. Only definitions that do not already exist in the target dataset are added.
SDDS_target | Address of the SDDS_DATASET structure to which layout definitions will be appended. |
SDDS_source | Address of the SDDS_DATASET structure from which layout definitions will be taken. |
mode | Mode flag (currently unused; can be set to 0). |
Definition at line 158 of file SDDS_copy.c.
|
extern |
Appends data to an existing array variable in the SDDS dataset using variable arguments for dimensions.
This function appends additional data to a specified array within the current SDDS dataset. The elements
parameter specifies the number of new elements to append. The mode
parameter controls how the data is interpreted and stored. The dimensions of the array are provided as variable arguments, allowing for flexible handling of multi-dimensional arrays.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
array_name | The name of the array to append data to within the dataset. |
mode | Bitwise flags that determine how the array is set. Valid flags include:
|
data_pointer | Pointer to the data to be appended to the array. The data must match the type defined for the array. |
elements | The number of elements to append to the array. |
... | Variable arguments specifying the dimensions of the array. The number of dimensions should match the array definition. |
1
on successful appending of the array data. On failure, returns 0
and records an appropriate error message.Definition at line 1392 of file SDDS_dataprep.c.
|
extern |
Applies a scaling factor to all elements of a specific column in the SDDS dataset.
This function multiplies each value in the specified column by the given factor
. It first retrieves the column's index and verifies that it is of a numeric type. The scaling operation is performed in-place on each element of the column's data array.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A NULL-terminated string specifying the name of the column to scale. |
[in] | factor | The scaling factor to apply to each element of the column. |
1
on successful application of the factor to all elements.0
if the column is not found, is non-numeric, or if the dataset lacks the necessary data array.Definition at line 3123 of file SDDS_utils.c.
|
extern |
Applies a scaling factor to a specific parameter in the SDDS dataset.
This function multiplies the value of a specified parameter by the given factor
. It first retrieves the parameter's index and verifies that it is of a numeric type. The scaling operation is performed in-place on the parameter's data.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A NULL-terminated string specifying the name of the parameter to scale. |
[in] | factor | The scaling factor to apply to the parameter's value. |
1
on successful application of the factor.0
if the parameter is not found, is non-numeric, or if the dataset lacks the necessary data array.Definition at line 3046 of file SDDS_utils.c.
|
extern |
Retrieves the number of arrays in the SDDS dataset.
This function returns the total count of arrays defined in the layout of the provided SDDS dataset.
[in] | page | Pointer to the SDDS_DATASET structure representing the dataset. |
int32_t
) in the dataset.0
if the provided dataset pointer is NULL
.Definition at line 5053 of file SDDS_utils.c.
|
extern |
Sets acceptance flags for columns based on specified criteria.
This function allows setting column flags in two modes:
A non-zero flag indicates that a column is "of interest", while a zero flag marks it for rejection.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
mode | Operation mode determining how flags are set. Possible values:
|
... | Variable arguments based on the selected mode:
|
SDDS_FLAG_ARRAY
, if columnsInArray
exceeds the number of allocated columns, it is truncated to fit.SDDS_INDEX_LIMITS
, if end
exceeds the number of columns, it is adjusted to the last valid column index.Definition at line 273 of file SDDS_extract.c.
|
extern |
Sets acceptance flags for rows based on specified criteria.
This function allows setting row flags in two modes:
A non-zero flag indicates that a row is "of interest", while a zero flag marks it for rejection.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
mode | Operation mode determining how flags are set. Possible values:
|
... | Variable arguments based on the selected mode:
|
SDDS_FLAG_ARRAY
, if rowsInArray
exceeds the number of allocated rows, it is truncated to fit.SDDS_INDEX_LIMITS
, if end
exceeds the number of rows, it is adjusted to the last valid row index.Definition at line 148 of file SDDS_extract.c.
|
extern |
Terminates the program after printing an error message and recorded errors.
This function prints a termination message to stderr
, invokes SDDS_PrintErrors
to display all recorded errors, and then exits the program with a non-zero status.
[in] | message | The termination message to be printed. If NULL , a default message "?" is used. |
Definition at line 342 of file SDDS_utils.c.
|
extern |
Attempts to override a locked file by creating a temporary copy.
This function tries to break into a locked file by creating a temporary backup and replacing the original file with this backup. The process involves:
.blXXX
suffix, where XXX
ranges from 1000
to 1019
.On Windows systems (_WIN32
defined), the function currently does not support breaking into locked files and will output an error message.
[in] | filename | The path to the locked file that needs to be overridden. |
0
on successful override of the locked file.1
if the operation fails or is not supported on the current platform.cp
and mv
system commands on Unix-like systems.Definition at line 3372 of file SDDS_utils.c.
|
extern |
Reads data from a file into a buffer, optimizing performance with buffering.
This function reads targetSize
bytes from the file fp
into the memory pointed to by target
. It uses the provided fBuffer
to buffer file data, improving read performance. If the data type is SDDS_LONGDOUBLE
and the long double
precision is not 18 digits, it handles conversion to double precision if the environment variable SDDS_LONGDOUBLE_64BITS
is not set.
If target
is NULL, the function skips over targetSize
bytes in the file.
target | Pointer to the memory location where the data will be stored. If NULL, the data is skipped. |
targetSize | The number of bytes to read from the file. |
fp | The file pointer from which data is read. |
fBuffer | Pointer to an SDDS_FILEBUFFER structure used for buffering file data. |
type | The SDDS data type of the data being read (e.g., SDDS_LONGDOUBLE ). |
byteOrder | The byte order of the data (SDDS_LITTLEENDIAN or SDDS_BIGENDIAN ). |
Definition at line 96 of file SDDS_binary.c.
|
extern |
Writes data to a file using a buffer to optimize performance.
This function writes targetSize
bytes from the memory pointed to by target
to the file fp
. It uses the provided fBuffer
to buffer file data, improving write performance. If the buffer is full, it flushes the buffer to the file before writing more data.
target | Pointer to the memory location of the data to write. |
targetSize | The number of bytes to write to the file. |
fp | The file pointer to which data is written. |
fBuffer | Pointer to an SDDS_FILEBUFFER structure used for buffering file data. |
Definition at line 484 of file SDDS_binary.c.
|
extern |
Allocates zero-initialized memory for an array of elements.
This function is a wrapper around the standard calloc
function, used by SDDS routines to allocate memory. It ensures that even if the requested number of elements or element size is zero or negative, a minimum of 1 element with a size of 4 bytes is allocated.
[in] | nelem | Number of elements to allocate. |
[in] | elem_size | Size in bytes of each element. |
NULL
.nelem
or elem_size
is less than or equal to zero, the function allocates memory for one element of 4 bytes by default.Definition at line 617 of file SDDS_utils.c.
|
extern |
Casts a value from one SDDS data type to another.
This function converts a value from its original SDDS data type (data_type
) to a desired SDDS data type (desired_type
). It retrieves the value at the specified index
from the data
array and stores the converted value in the provided memory
location.
[in] | data | Pointer to the data array containing the original values. |
[in] | index | The zero-based index of the value to be casted within the data array. |
[in] | data_type | The original SDDS data type of the value. Must be one of the SDDS type constants:
|
[in] | desired_type | The desired SDDS data type to which the value should be casted. Must be one of the SDDS type constants listed above. |
[out] | memory | Pointer to the memory location where the casted value will be stored. |
memory
location containing the casted value on success.NULL
if the casting fails due to invalid data types or other errors.SDDS_STRING
types.memory
location has sufficient space to store the casted value.Definition at line 2628 of file SDDS_utils.c.
|
extern |
Modifies a specific field in an array definition within the SDDS dataset.
This function allows you to change a particular field of an array definition, identified either by its name or index. The new value for the field can be provided either as a direct value or as a string, depending on the field type.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | field_name | A null-terminated string specifying the name of the field to be modified. |
[in] | memory | Pointer to the new value for the field. The type of this pointer should correspond to the data type of the field being modified:
|
[in] | mode | A bitwise combination of the following constants to specify how to identify the array and how to pass the new value:
|
The valid combinations of mode
are:
SDDS_SET_BY_INDEX | SDDS_PASS_BY_VALUE
: SDDS_SET_BY_NAME | SDDS_PASS_BY_VALUE
: SDDS_SET_BY_INDEX | SDDS_PASS_BY_STRING
: SDDS_SET_BY_NAME | SDDS_PASS_BY_STRING
: mode
parameter.Definition at line 597 of file SDDS_info.c.
|
extern |
Modifies a specific field in a column definition within the SDDS dataset.
This function allows you to change a particular field of a column definition, identified either by its name or index. The new value for the field can be provided either as a direct value or as a string, depending on the field type.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | field_name | A null-terminated string specifying the name of the field to be modified. |
[in] | memory | Pointer to the new value for the field. The type of this pointer should correspond to the data type of the field being modified:
|
[in] | mode | A bitwise combination of the following constants to specify how to identify the column and how to pass the new value:
|
The valid combinations of mode
are:
SDDS_SET_BY_INDEX | SDDS_PASS_BY_VALUE
: SDDS_SET_BY_NAME | SDDS_PASS_BY_VALUE
: SDDS_SET_BY_INDEX | SDDS_PASS_BY_STRING
: SDDS_SET_BY_NAME | SDDS_PASS_BY_STRING
: mode
parameter.Definition at line 364 of file SDDS_info.c.
|
extern |
Modifies a specific field in a parameter definition within the SDDS dataset.
This function allows you to change a particular field of a parameter definition, identified either by its name or index. The new value for the field can be provided either as a direct value or as a string, depending on the field type.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | field_name | A null-terminated string specifying the name of the field to be modified. |
[in] | memory | Pointer to the new value for the field. The type of this pointer should correspond to the data type of the field being modified:
|
[in] | mode | A bitwise combination of the following constants to specify how to identify the parameter and how to pass the new value:
|
The valid combinations of mode
are:
SDDS_SET_BY_INDEX | SDDS_PASS_BY_VALUE
: SDDS_SET_BY_NAME | SDDS_PASS_BY_VALUE
: SDDS_SET_BY_INDEX | SDDS_PASS_BY_STRING
: SDDS_SET_BY_NAME | SDDS_PASS_BY_STRING
: mode
parameter.Definition at line 485 of file SDDS_info.c.
|
extern |
Checks if an array exists in the SDDS dataset with the specified name, units, and type.
This function verifies whether an array with the given name exists within the provided SDDS dataset. Additionally, it can check if the array's units and type match the specified criteria.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to be checked. |
[in] | name | The name of the array to check. |
[in] | units | The units of the array. This parameter may be NULL if units are not to be validated. |
[in] | type | Specifies the expected type of the array. Valid values are:
|
[in] | fp_message | File pointer where error messages will be sent. Typically, this is stderr . |
SDDS_CHECK_OKAY
if the array exists and matches the specified criteria.SDDS_CHECK_NONEXISTENT
if the array does not exist.SDDS_CHECK_WRONGTYPE
if the array exists but does not match the specified type.SDDS_CHECK_WRONGUNITS
if the array exists but does not match the specified units.units
is NULL
, the function does not perform units validation.SDDS_GetArrayInformation
and SDDS_GetArrayType
.SDDS_SetError
if it encounters issues accessing array information.Definition at line 4742 of file SDDS_utils.c.
|
extern |
Checks if a column exists in the SDDS dataset with the specified name, units, and type.
This function verifies whether a column with the given name exists in the SDDS dataset and optionally checks if its units and type match the specified criteria.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to be checked. |
[in] | name | The name of the column to check. |
[in] | units | The units of the column. May be NULL if units are not to be checked. |
[in] | type | Specifies the expected type of the column. Valid values are:
|
[in] | fp_message | File pointer where error messages will be sent. Typically, this is stderr . |
SDDS_CHECK_OKAY
if the column exists and matches the specified criteria.SDDS_CHECK_NONEXISTENT
if the column does not exist.SDDS_CHECK_WRONGTYPE
if the column exists but does not match the specified type.SDDS_CHECK_WRONGUNITS
if the column exists but does not match the specified units.units
is NULL
, the function does not check for units.SDDS_GetColumnInformation
and SDDS_GetColumnType
.SDDS_SetError
if it encounters issues accessing column information.Definition at line 4562 of file SDDS_utils.c.
|
extern |
Validates the SDDS dataset pointer.
This function checks whether the provided SDDS_DATASET
pointer is valid (non-NULL). If the check fails, it records an appropriate error message.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure to be validated. |
[in] | caller | Name of the calling function, used for error reporting. |
1
if the dataset pointer is valid; otherwise, returns 0
and records an error message.Definition at line 552 of file SDDS_utils.c.
|
extern |
Verifies that the size of the SDDS_DATASET structure matches the expected size.
This function ensures that the size of the SDDS_DATASET
structure used by the program matches the size expected by the SDDS library. This check is crucial to prevent issues related to structure size mismatches, which can occur due to differences in compiler settings or library versions.
[in] | size | The size of the SDDS_DATASET structure as determined by the calling program (typically using sizeof(SDDS_DATASET) ). |
1
if the provided size matches the expected size of the SDDS_DATASET
structure.0
if there is a size mismatch, indicating potential incompatibility issues.Definition at line 4979 of file SDDS_utils.c.
|
extern |
Checks if the end of the SDDS dataset file has been reached.
SDDS_dataset | The SDDS dataset structure. |
Definition at line 1020 of file SDDS_input.c.
|
extern |
Checks if a parameter exists in the SDDS dataset with the specified name, units, and type.
This function verifies whether a parameter with the given name exists in the SDDS dataset and optionally checks if its units and type match the specified criteria.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to be checked. |
[in] | name | The name of the parameter to check. |
[in] | units | The units of the parameter. May be NULL if units are not to be checked. |
[in] | type | Specifies the expected type of the parameter. Valid values are:
|
[in] | fp_message | File pointer where error messages will be sent. Typically, this is stderr . |
SDDS_CHECK_OKAY
if the parameter exists and matches the specified criteria.SDDS_CHECK_NONEXISTENT
if the parameter does not exist.SDDS_CHECK_WRONGTYPE
if the parameter exists but does not match the specified type.SDDS_CHECK_WRONGUNITS
if the parameter exists but does not match the specified units.units
is NULL
, the function does not check for units.SDDS_GetParameterInformation
and SDDS_GetParameterType
.SDDS_SetError
if it encounters issues accessing parameter information.Definition at line 4653 of file SDDS_utils.c.
|
extern |
Validates the consistency of tabular data within an SDDS dataset.
This function checks the integrity of tabular data in the given SDDS_DATASET
. It verifies that if columns are defined, corresponding row flags and data arrays exist, and that the number of rows matches the column definitions.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure to be validated. |
[in] | caller | Name of the calling function, used for error reporting. |
1
if the tabular data is consistent and valid; otherwise, returns 0
and records an error message.AutoCheckMode
includes TABULAR_DATA_CHECKS
.Definition at line 577 of file SDDS_utils.c.
|
extern |
Clears all recorded error messages from the SDDS error stack.
This function removes all error messages that have been recorded by SDDS library routines, resetting the error count to zero. It should be called after handling or logging the errors to prepare for future error recording.
SDDS_NumberOfErrors
will return zero until new errors are recorded.Definition at line 318 of file SDDS_utils.c.
|
extern |
Clears the current page in the SDDS dataset, resetting all data and flags.
This function resets the current data page in the specified SDDS dataset by reinitializing column flags and order. It frees any allocated string data and zeros out the data arrays, parameters, and arrays in the dataset.
SDDS_dataset | Pointer to the SDDS_DATASET structure whose current page will be cleared. |
Definition at line 188 of file SDDS_dataprep.c.
|
extern |
Retrieves the number of columns in the SDDS dataset.
This function returns the total count of columns defined in the layout of the provided SDDS dataset.
[in] | page | Pointer to the SDDS_DATASET structure representing the dataset. |
int32_t
) in the dataset.0
if the provided dataset pointer is NULL
.Definition at line 5007 of file SDDS_utils.c.
|
extern |
Determines if a specified column is marked as of interest in the dataset.
This function checks whether the column with the given name
is flagged as of interest within the provided SDDS_dataset
. It verifies the dataset's validity and then iterates through the columns to find a match based on the column_flag
array.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A NULL-terminated string specifying the name of the column to check. |
1
if the column is marked as of interest.0
if the column is not marked as of interest or if column_flag
is not set.-1
if the dataset is invalid.Definition at line 2428 of file SDDS_utils.c.
int SDDS_CompareIndexedNames | ( | const void * | s1, |
const void * | s2 ) |
Compares two SORTED_INDEX
structures by their name fields.
This function is used as a comparison callback for sorting functions like qsort
. It compares the name
fields of two SORTED_INDEX
structures lexicographically.
[in] | s1 | Pointer to the first SORTED_INDEX structure. |
[in] | s2 | Pointer to the second SORTED_INDEX structure. |
name
of s1
is found, respectively, to be less than, to match, or be greater than the name
of s2
.Definition at line 1272 of file SDDS_utils.c.
int SDDS_CompareIndexedNamesPtr | ( | const void * | s1, |
const void * | s2 ) |
Compares two pointers to SORTED_INDEX
structures by their name fields.
This function is used as a comparison callback for sorting functions like qsort
. It compares the name
fields of two SORTED_INDEX
structure pointers lexicographically.
[in] | s1 | Pointer to the first SORTED_INDEX* structure. |
[in] | s2 | Pointer to the second SORTED_INDEX* structure. |
name
of *s1
is found, respectively, to be less than, to match, or be greater than the name
of *s2
.Definition at line 1292 of file SDDS_utils.c.
|
extern |
Converts a value to double based on its type.
type | The SDDS data type of the value. |
data | Pointer to the data array. |
index | Index of the element to convert. |
Definition at line 199 of file SDDS_rpn.c.
|
extern |
Converts a value to a 32-bit integer based on its type.
type | The SDDS data type of the value. |
data | Pointer to the data array. |
index | Index of the element to convert. |
Definition at line 279 of file SDDS_rpn.c.
|
extern |
Converts a value to a 64-bit integer based on its type.
type | The SDDS data type of the value. |
data | Pointer to the data array. |
index | Index of the element to convert. |
Definition at line 239 of file SDDS_rpn.c.
|
extern |
Converts a value to long double based on its type.
type | The SDDS data type of the value. |
data | Pointer to the data array. |
index | Index of the element to convert. |
Definition at line 159 of file SDDS_rpn.c.
|
extern |
Copies additional rows from one SDDS_DATASET to another. The rows from SDDS_source are appended to the existing rows in SDDS_target.
SDDS_target | Pointer to the SDDS_DATASET structure where rows will be appended. |
SDDS_source | Pointer to the SDDS_DATASET structure from which rows will be copied. |
Definition at line 519 of file SDDS_copy.c.
|
extern |
Creates a copy of an array definition.
This function allocates memory for a new ARRAY_DEFINITION
structure and copies the contents from the source array definition to the target. All string fields are duplicated to ensure independent memory management.
[out] | target | Pointer to a ARRAY_DEFINITION* where the copied definition will be stored. |
[in] | source | Pointer to the ARRAY_DEFINITION structure to be copied. If source is NULL , the target is set to NULL . |
ARRAY_DEFINITION
structure on success. Returns NULL
on failure (e.g., memory allocation failure).SDDS_FreeArrayDefinition
.Definition at line 1208 of file SDDS_utils.c.
|
extern |
Copies array data from one SDDS_DATASET structure into another for arrays with matching names.
SDDS_target | Address of the SDDS_DATASET structure into which array data will be copied. |
SDDS_source | Address of the SDDS_DATASET structure from which array data will be copied. |
Definition at line 334 of file SDDS_copy.c.
|
extern |
Creates a copy of an associate definition.
This function allocates memory for a new ASSOCIATE_DEFINITION
structure and copies the contents from the source associate definition to the target. All string fields are duplicated to ensure independent memory management.
[out] | target | Pointer to a ASSOCIATE_DEFINITION* where the copied definition will be stored. |
[in] | source | Pointer to the ASSOCIATE_DEFINITION structure to be copied. If source is NULL , the target is set to NULL . |
ASSOCIATE_DEFINITION
structure on success. Returns NULL
on failure (e.g., memory allocation failure).SDDS_FreeAssociateDefinition
.Definition at line 920 of file SDDS_utils.c.
|
extern |
Creates a copy of a column definition.
This function allocates memory for a new COLUMN_DEFINITION
structure and copies the contents from the source column definition to the target. All string fields are duplicated to ensure independent memory management.
[out] | target | Pointer to a COLUMN_DEFINITION* where the copied definition will be stored. |
[in] | source | Pointer to the COLUMN_DEFINITION structure to be copied. If source is NULL , the target is set to NULL . |
COLUMN_DEFINITION
structure on success. Returns NULL
on failure (e.g., memory allocation failure).SDDS_FreeColumnDefinition
.Definition at line 1012 of file SDDS_utils.c.
|
extern |
Copies column data from one SDDS_DATASET structure into another for columns with matching names.
SDDS_target | Address of the SDDS_DATASET structure into which column data will be copied. |
SDDS_source | Address of the SDDS_DATASET structure from which column data will be copied. |
Definition at line 387 of file SDDS_copy.c.
|
extern |
Copies the entire layout (including version, data mode, description, contents, columns, parameters, associates, and arrays) from one SDDS_DATASET to another. The target dataset's existing layout will be replaced.
SDDS_target | Address of the SDDS_DATASET structure into which the layout will be copied. |
SDDS_source | Address of the SDDS_DATASET structure from which the layout will be copied. |
Definition at line 222 of file SDDS_copy.c.
|
extern |
Copies the data from one SDDS_DATASET structure to another. This includes parameters, arrays, and columns.
SDDS_target | Pointer to the SDDS_DATASET structure where data will be copied to. |
SDDS_source | Pointer to the SDDS_DATASET structure from which data will be copied. |
Definition at line 578 of file SDDS_copy.c.
|
extern |
Creates a copy of a parameter definition.
This function allocates memory for a new PARAMETER_DEFINITION
structure and copies the contents from the source parameter definition to the target. All string fields are duplicated to ensure independent memory management.
[out] | target | Pointer to a PARAMETER_DEFINITION* where the copied definition will be stored. |
[in] | source | Pointer to the PARAMETER_DEFINITION structure to be copied. If source is NULL , the target is set to NULL . |
PARAMETER_DEFINITION
structure on success. Returns NULL
on failure (e.g., memory allocation failure).SDDS_FreeParameterDefinition
.Definition at line 1109 of file SDDS_utils.c.
|
extern |
Copies parameter values from one SDDS_DATASET structure into another for parameters with matching names.
SDDS_target | Address of the SDDS_DATASET structure into which parameter values will be copied. |
SDDS_source | Address of the SDDS_DATASET structure from which parameter values will be copied. |
Definition at line 286 of file SDDS_copy.c.
|
extern |
Copies a row from the source SDDS_DATASET to the target SDDS_DATASET. Only columns that exist in both datasets are copied. The source row is determined by its position among the selected rows.
SDDS_target | Pointer to the SDDS_DATASET structure where the row will be copied to. |
target_row | Index of the row in the target dataset where data will be placed. |
SDDS_source | Pointer to the SDDS_DATASET structure from which the row will be copied. |
source_srow | Index of the selected row (among rows of interest) in the source dataset. |
Definition at line 778 of file SDDS_copy.c.
|
extern |
Copies a specific row from the source SDDS_DATASET to the target SDDS_DATASET. Only columns that exist in both datasets are copied.
SDDS_target | Pointer to the SDDS_DATASET structure where the row will be copied to. |
target_row | Index of the row in the target dataset where data will be placed. |
SDDS_source | Pointer to the SDDS_DATASET structure from which the row will be copied. |
source_row | Index of the row in the source dataset to be copied. |
Definition at line 834 of file SDDS_copy.c.
|
extern |
Copies a range of rows from the source SDDS_DATASET to the target SDDS_DATASET. Only columns that exist in both datasets are copied.
SDDS_target | Pointer to the SDDS_DATASET structure where rows will be copied to. |
SDDS_source | Pointer to the SDDS_DATASET structure from which rows will be copied. |
firstRow | Index of the first row to copy from the source dataset. |
lastRow | Index of the last row to copy from the source dataset. |
Definition at line 882 of file SDDS_copy.c.
|
extern |
Copies rows of interest from the source SDDS_DATASET to the target SDDS_DATASET for columns with matching names. Rows of interest are those that have their row flags set in the source dataset.
SDDS_target | Address of the SDDS_DATASET structure into which rows will be copied. |
SDDS_source | Address of the SDDS_DATASET structure from which rows will be copied. |
Definition at line 439 of file SDDS_copy.c.
|
extern |
Copies a source string to a target string with memory allocation.
This function allocates memory for the target string and copies the contents of the source string into it. If the source string is NULL
, the target string is set to NULL
.
[out] | target | Pointer to a char* variable where the copied string will be stored. Memory is allocated within this function and should be freed by the caller to avoid memory leaks. |
[in] | source | The source string to be copied. If NULL , the target is set to NULL . |
1
on successful copy and memory allocation. Returns 0
on error (e.g., memory allocation failure).Definition at line 856 of file SDDS_utils.c.
|
extern |
Copies an array of strings from source to target.
This function duplicates each string from the source
array into the target
array. It handles memory allocation for each individual string using SDDS_CopyString
.
[in] | target | Pointer to the destination array of strings where the copied strings will be stored. |
[in] | source | Pointer to the source array of strings to be copied. |
[in] | n_strings | The number of strings to copy from the source to the target. |
1
on successful copying of all strings.0
if either source
or target
is NULL
, or if any string copy operation fails.target
array has sufficient space allocated.target
array.Definition at line 2837 of file SDDS_utils.c.
|
extern |
Counts the number of columns marked as "of interest" in the current data table.
This function returns the total number of columns that have been flagged as "of interest" based on their acceptance flags.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
Definition at line 342 of file SDDS_extract.c.
|
extern |
Counts the number of rows marked as "of interest" in the current data table.
This function iterates through the row acceptance flags and tallies the number of rows that are flagged as "of interest" (non-zero).
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
Definition at line 364 of file SDDS_extract.c.
|
extern |
Creates an empty SDDS dataset.
This function allocates and initializes an empty SDDS_DATASET
structure. The returned dataset can then be configured and populated with columns, parameters, and arrays as needed.
SDDS_DATASET
structure.NULL
if memory allocation fails.NULL
before using it.Definition at line 5628 of file SDDS_utils.c.
|
extern |
Stub function for creating RPN arrays when RPN_SUPPORT is not enabled.
name | Name of the RPN array. |
Definition at line 795 of file SDDS_rpn.c.
|
extern |
Stub function for creating RPN memory when RPN_SUPPORT is not enabled.
name | Name of the RPN memory. |
is_string | Flag indicating if the memory is for string data. |
Definition at line 785 of file SDDS_rpn.c.
|
extern |
Removes comments from a string based on a specified comment character.
This function processes a string s
, removing any content that follows the comment character cc
. It also handles special comment lines that start with !#
by parsing them using SDDS_ParseSpecialComments
. The function ensures that quoted sections within the string are preserved and not mistakenly identified as comments.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure used for processing special comments. |
[in,out] | s | Pointer to the character array containing the string to process. The string will be modified in place. |
[in] | cc | The comment character indicating the start of a comment. |
Definition at line 1680 of file SDDS_utils.c.
|
extern |
Sets the flag to defer or resume saving the layout of an SDDS_DATASET.
SDDS_dataset | Pointer to the SDDS_DATASET structure. |
mode | Non-zero value to defer saving the layout; zero to resume saving. |
Definition at line 603 of file SDDS_copy.c.
|
extern |
Defines a data array within the SDDS dataset.
This function processes the definition of a data array in the SDDS dataset. It allows the user to specify the array's name, symbol, units, description, format string, data type, field length, number of dimensions, and associated group name. The function ensures that the array name is valid and unique within the dataset before defining it.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A NULL-terminated string specifying the name of the array. This name must be unique within the dataset. |
[in] | symbol | A NULL-terminated string specifying the symbol for the array. Pass NULL if no symbol is desired. |
[in] | units | A NULL-terminated string specifying the units of the array. Pass NULL if no units are desired. |
[in] | description | A NULL-terminated string providing a description of the array. Pass NULL if no description is desired. |
[in] | format_string | A NULL-terminated string specifying the printf-style format for ASCII output. If NULL is passed, a default format is selected based on the array type. |
[in] | type | An integer representing the data type of the array. Must be one of the following:
|
[in] | field_length | An integer specifying the length of the field allotted to the array for ASCII output. If set to 0 , the field length is ignored. If negative, the field length is set to the absolute value, and leading and trailing white-space are eliminated for SDDS_STRING types upon reading. |
[in] | dimensions | An integer specifying the number of dimensions of the array. Must be greater than 0 . |
[in] | group_name | A NULL-terminated string specifying the name of the array group to which this array belongs. This allows related arrays to be grouped together (e.g., parallel arrays). |
-1
on failure, with an error message set internally.dimensions
parameter.Definition at line 1592 of file SDDS_output.c.
|
extern |
Defines an associate for the SDDS dataset.
This function defines an associate for the SDDS dataset, allowing the association of additional files or data with the primary dataset. Associates can provide supplementary information or link related datasets together. The function sets up the necessary attributes such as name, filename, path, description, contents, and SDDS flag to describe the associate.
Note: This function is NOT USED in the current implementation and will always return 0
unless compiled with RW_ASSOCIATES
defined.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A NULL-terminated string specifying the name of the associate. This name must be unique within the dataset. |
[in] | filename | A NULL-terminated string specifying the filename of the associate. Must be a valid filename. |
[in] | path | A NULL-terminated string specifying the path to the associate. Pass NULL if no path is desired. |
[in] | description | A NULL-terminated string providing a description of the associate. Pass NULL if no description is desired. |
[in] | contents | A NULL-terminated string detailing the contents of the associate. Pass NULL if no contents are desired. |
[in] | sdds | An integer flag indicating the type of associate. Typically used to specify whether the associate is an SDDS file. |
0
if RW_ASSOCIATES
is not defined.RW_ASSOCIATES
must be defined during compilation to use this feature.filename
and path
(if provided) are valid and accessible. Definition at line 2153 of file SDDS_output.c.
|
extern |
Defines a data column within the SDDS dataset.
This function processes the definition of a data column in the SDDS dataset. It allows the user to specify the column's name, symbol, units, description, format string, data type, and field length. The function ensures that the column name is valid and unique within the dataset before defining it.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A NULL-terminated string specifying the name of the column. This name must be unique within the dataset. |
[in] | symbol | A NULL-terminated string specifying the symbol for the column. Pass NULL if no symbol is desired. |
[in] | units | A NULL-terminated string specifying the units of the column. Pass NULL if no units are desired. |
[in] | description | A NULL-terminated string providing a description of the column. Pass NULL if no description is desired. |
[in] | format_string | A NULL-terminated string specifying the printf-style format for ASCII output. If NULL is passed, a default format is selected based on the column type. |
[in] | type | An integer representing the data type of the column. Must be one of the following:
|
[in] | field_length | An integer specifying the length of the field allotted to the column for ASCII output. If set to 0 , the field length is ignored. If negative, the field length is set to the absolute value, and leading and trailing white-space are eliminated for SDDS_STRING types upon reading. |
-1
on failure, with an error message set internally.Definition at line 1709 of file SDDS_output.c.
|
extern |
Defines a column in the target dataset based on an array definition from the source dataset.
This function creates a column in the target SDDS dataset with properties matching those of a specified array in the source dataset.
target | Pointer to the SDDS_DATASET structure representing the target dataset. |
source | Pointer to the SDDS_DATASET structure representing the source dataset. |
name | The name of the array in the source dataset whose definition is to be used. |
newName | The name of the column in the target dataset. If NULL , the original name is used. |
1
on success; 0
on failure. On failure, an error message is recorded. Definition at line 302 of file SDDS_transfer.c.
|
extern |
Defines a column in the target dataset based on a parameter definition from the source dataset.
This function creates a column in the target SDDS dataset with properties matching those of a specified parameter in the source dataset.
target | Pointer to the SDDS_DATASET structure representing the target dataset. |
source | Pointer to the SDDS_DATASET structure representing the source dataset. |
name | The name of the parameter in the source dataset whose definition is to be used. |
newName | The name of the column in the target dataset. If NULL , the original name is used. |
1
on success; 0
on failure. On failure, an error message is recorded. Definition at line 264 of file SDDS_transfer.c.
|
extern |
Defines a data parameter with a fixed string value.
This function processes the definition of a data parameter within the SDDS dataset. It allows the specification of a fixed string value for the parameter, which remains constant across all data entries. The function validates the parameter name, type, and format string before defining the parameter in the dataset.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A NULL-terminated string specifying the name of the parameter. This name must be unique within the dataset. |
[in] | symbol | A NULL-terminated string specifying the symbol for the parameter. Pass NULL if no symbol is desired. |
[in] | units | A NULL-terminated string specifying the units of the parameter. Pass NULL if no units are desired. |
[in] | description | A NULL-terminated string providing a description of the parameter. Pass NULL if no description is desired. |
[in] | format_string | A NULL-terminated string specifying the printf-style format for ASCII output. If NULL is passed, a default format is selected based on the parameter type. |
[in] | type | An integer representing the data type of the parameter. Must be one of the following:
|
[in] | fixed_value | A NULL-terminated string specifying the fixed value of the parameter. For non-string types, this string should be formatted appropriately using functions like sprintf . |
-1
on failure, with an error message set internally.Definition at line 1466 of file SDDS_output.c.
|
extern |
Defines a data parameter with a fixed numerical value.
This function processes the definition of a data parameter within the SDDS dataset. It allows the specification of a fixed numerical value for the parameter, which remains constant across all data entries. The function validates the parameter name, type, and format string before defining the parameter in the dataset.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A NULL-terminated string specifying the name of the parameter. This name must be unique within the dataset. |
[in] | symbol | A NULL-terminated string specifying the symbol for the parameter. Pass NULL if no symbol is desired. |
[in] | units | A NULL-terminated string specifying the units of the parameter. Pass NULL if no units are desired. |
[in] | description | A NULL-terminated string providing a description of the parameter. Pass NULL if no description is desired. |
[in] | format_string | A NULL-terminated string specifying the printf-style format for ASCII output. If NULL is passed, a default format is selected based on the parameter type. |
[in] | type | An integer representing the data type of the parameter. Must be one of the following:
|
[in] | fixed_value | A pointer to the numerical value that remains constant for this parameter across all data entries. This value is used to initialize the parameter's fixed value. |
-1
on failure, with an error message set internally.SDDS_STRING
.Definition at line 1401 of file SDDS_output.c.
|
extern |
Defines a parameter in the target dataset based on an array definition from the source dataset.
This function creates a parameter in the target SDDS dataset with properties matching those of a specified array in the source dataset.
target | Pointer to the SDDS_DATASET structure representing the target dataset. |
source | Pointer to the SDDS_DATASET structure representing the source dataset. |
name | The name of the array in the source dataset whose definition is to be used. |
newName | The name of the parameter in the target dataset. If NULL , the original name is used. |
1
on success; 0
on failure. On failure, an error message is recorded. Definition at line 226 of file SDDS_transfer.c.
|
extern |
Defines a parameter in the target dataset based on a column definition from the source dataset.
This function creates a parameter in the target SDDS dataset with properties matching those of a specified column in the source dataset.
target | Pointer to the SDDS_DATASET structure representing the target dataset. |
source | Pointer to the SDDS_DATASET structure representing the source dataset. |
name | The name of the column in the source dataset whose definition is to be used. |
newName | The name of the parameter in the target dataset. If NULL , the original name is used. |
1
on success; 0
on failure. On failure, an error message is recorded. Definition at line 188 of file SDDS_transfer.c.
|
extern |
Defines a simple data column within the SDDS dataset.
This function provides a simplified interface for defining a data column in the SDDS dataset. It allows the user to specify only the column's name, units, and data type, while omitting optional parameters such as symbol, description, format string, and field length. Internally, it calls SDDS_DefineColumn
with default values for the omitted parameters.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A NULL-terminated string specifying the name of the column. This name must be unique within the dataset. |
[in] | unit | A NULL-terminated string specifying the units of the column. Pass NULL if no units are desired. |
[in] | type | An integer representing the data type of the column. Must be one of the following:
|
1
on successful definition of the column.0
on failure, with an error message set internally.Definition at line 1846 of file SDDS_output.c.
|
extern |
Defines multiple simple data columns of the same data type within the SDDS dataset.
This function provides a streamlined way to define multiple data columns in the SDDS dataset that share the same data type. It allows the user to specify the names and units of the columns, while omitting optional attributes such as symbol, description, format string, and field length. Internally, it calls SDDS_DefineColumn
for each column with default values for the omitted parameters.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | number | The number of columns to define. Must be greater than or equal to 0 . |
[in] | name | An array of NULL-terminated strings specifying the names of the columns. Each name must be unique within the dataset. |
[in] | unit | An array of NULL-terminated strings specifying the units of the columns. Pass NULL for elements where no units are desired. |
[in] | type | An integer representing the data type for all the columns. Must be one of the following:
|
1
on successful definition of all specified columns.0
on failure to define any of the columns, with an error message set internally.name
array must contain unique and valid names for each column.type
must be a supported data type.number
as 0
results in no action and returns success.name
and unit
arrays are properly allocated and contain valid strings. Definition at line 1945 of file SDDS_output.c.
|
extern |
Defines a simple data parameter within the SDDS dataset.
This function provides a simplified interface for defining a data parameter in the SDDS dataset. It allows the user to specify only the parameter's name, units, and data type, while omitting optional attributes such as symbol, description, format string, and fixed value. Internally, it calls SDDS_DefineParameter
with default values for the omitted parameters.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A NULL-terminated string specifying the name of the parameter. This name must be unique within the dataset. |
[in] | unit | A NULL-terminated string specifying the units of the parameter. Pass NULL if no units are desired. |
[in] | type | An integer representing the data type of the parameter. Must be one of the following:
|
1
on successful definition of the parameter.0
on failure, with an error message set internally.Definition at line 1894 of file SDDS_output.c.
|
extern |
Defines multiple simple data parameters of the same data type within the SDDS dataset.
This function provides a streamlined way to define multiple data parameters in the SDDS dataset that share the same data type. It allows the user to specify the names and units of the parameters, while omitting optional attributes such as symbol, description, format string, and fixed value. Internally, it calls SDDS_DefineParameter
for each parameter with default values for the omitted parameters.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | number | The number of parameters to define. Must be greater than or equal to 0 . |
[in] | name | An array of NULL-terminated strings specifying the names of the parameters. Each name must be unique within the dataset. |
[in] | unit | An array of NULL-terminated strings specifying the units of the parameters. Pass NULL for elements where no units are desired. |
[in] | type | An integer representing the data type for all the parameters. Must be one of the following:
|
1
on successful definition of all specified parameters.0
on failure to define any of the parameters, with an error message set internally.name
array must contain unique and valid names for each parameter.type
must be a supported data type.number
as 0
results in no action and returns success.name
and unit
arrays are properly allocated and contain valid strings. Definition at line 2002 of file SDDS_output.c.
|
extern |
Deletes a specified column from an SDDS dataset.
Note: This function is currently non-functional and will abort execution if called.
This function is intended to remove a column identified by column_name
from the provided SDDS dataset. It handles the reordering of remaining columns and updates the dataset's layout accordingly. However, as indicated by the current implementation, the function is not operational and will terminate the program when invoked.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
column_name | A null-terminated string specifying the name of the column to be deleted. |
1
on success and 0
on failure.Definition at line 3845 of file SDDS_extract.c.
|
extern |
Deletes a specified parameter from an SDDS dataset.
This function removes a parameter identified by parameter_name
from the provided SDDS dataset. It shifts all subsequent parameters up to fill the gap left by the deleted parameter and updates the dataset's parameter count accordingly.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
parameter_name | A null-terminated string specifying the name of the parameter to be deleted. |
1
. On failure, returns 0
and sets an appropriate error message.1 | Indicates that the parameter was successfully deleted. |
0 | Indicates that an error occurred (e.g., invalid dataset, unrecognized parameter name, error copying parameters). |
Definition at line 3978 of file SDDS_extract.c.
|
extern |
Deletes fixed values from all parameters in the SDDS dataset.
This function iterates through all parameters in the provided SDDS dataset and removes any fixed values associated with them. It ensures that both the current layout and the original layout of the dataset have their fixed values cleared.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset from which fixed values will be deleted. |
1
on successful deletion of all fixed values.0
if the dataset check fails or if saving the layout fails.Definition at line 4883 of file SDDS_utils.c.
|
extern |
Deletes all columns from an SDDS dataset that are not marked as "of interest".
This function iterates through all columns in the provided SDDS dataset and removes those that have not been flagged as "of interest". It ensures that only desired columns are retained, updating the dataset's layout and column order accordingly.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
1
. On failure, returns 0
and sets an appropriate error message.1 | Indicates that columns were successfully deleted. |
0 | Indicates that an error occurred (e.g., invalid dataset, failure to delete a column). |
Definition at line 3893 of file SDDS_extract.c.
|
extern |
Deletes rows from an SDDS dataset that are not marked as "of interest".
This function removes all rows in the provided SDDS dataset that have not been flagged as "of interest" using prior selection functions. It effectively compacts the dataset by retaining only the desired rows and updating the row count accordingly.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
1
. On failure, returns 0
and sets an appropriate error message.1 | Indicates that rows were successfully deleted. |
0 | Indicates that an error occurred (e.g., invalid dataset, problem copying rows). |
Definition at line 3760 of file SDDS_extract.c.
|
extern |
Disables file synchronization for the SDDS dataset.
This function disables the file synchronization feature for the specified SDDS dataset. File synchronization ensures that all buffered data is immediately written to disk, enhancing data integrity. By disabling this feature, the dataset will no longer perform synchronous writes, which can improve performance but may risk data loss in the event of a system failure.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
SDDS_SyncDataSet
will not call fsync
.Definition at line 2374 of file SDDS_output.c.
|
extern |
Disconnects the SDDS dataset from its associated file.
This function terminates the connection between the SDDS dataset and the file it is currently linked to. It ensures that all pending data is flushed to the file, closes the file handle, and updates the dataset's internal state to reflect that it is no longer connected to any file.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure to be disconnected. |
1
on successful disconnection.0
if an error occurred during disconnection. In this case, an error message is set internally.Definition at line 70 of file SDDS_output.c.
|
extern |
Disconnects the input file from the SDDS dataset.
This function severs the connection between the SDDS dataset and its input file. It closes the file handle, updates the dataset's internal state to indicate disconnection, and returns the current file position before closing. After disconnection, the dataset cannot read further data from the input file until it is reconnected.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure whose input file is to be disconnected. |
ftell
) before disconnection.-1
and sets an internal error message.Definition at line 170 of file SDDS_output.c.
|
extern |
Synchronizes the SDDS dataset's file to disk.
Performs a file synchronization operation on the specified SDDS dataset to ensure that all buffered data is flushed to the storage medium. This is crucial for maintaining data integrity, especially in scenarios where unexpected shutdowns or crashes may occur.
1
.fsync
system call.1
if fsync
succeeds, indicating successful synchronization.0
if fsync
fails or if the dataset/file pointer is invalid.[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to be synchronized. |
1
on successful synchronization.0
on failure. Definition at line 2423 of file SDDS_output.c.
|
extern |
Enables file synchronization for the SDDS dataset.
This function enables the file synchronization feature for the specified SDDS dataset. File synchronization ensures that all buffered data is immediately written to disk, enhancing data integrity. Enabling this feature can be crucial for applications where data consistency and reliability are paramount.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
SDDS_SyncDataSet
will call fsync
to flush buffers to disk.Definition at line 2398 of file SDDS_output.c.
|
extern |
Erases all data entries in the SDDS dataset.
This function removes all data from the specified SDDS dataset, effectively resetting it to an empty state. It frees any allocated memory associated with data columns, parameters, and arrays, ensuring that all dynamic data is properly cleared. This is useful for reusing the dataset for new data without retaining previous entries.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
1
on successful erasure of all data.0
on failure, with an error message set internally.Definition at line 2244 of file SDDS_output.c.
|
extern |
Escapes comment characters within a string by inserting backslashes.
This function scans the input string string
and inserts a backslash (\
) before each occurrence of the specified comment character cc
, provided it is not already escaped. This is useful for preparing strings to include comment characters without them being interpreted as actual comments.
[in,out] | string | Pointer to the string in which comment characters will be escaped. The string will be modified in place. |
[in] | cc | The comment character to escape (e.g., # ). |
string
is updated correctly. The caller must ensure that string
has sufficient space to accommodate the additional backslashes.Definition at line 1955 of file SDDS_utils.c.
|
extern |
Escapes newline characters in a string by replacing them with "\\n".
This function modifies the input string s
in place by replacing each newline character (‘’
') with the two-character sequence
'\'and
'n'`. It shifts the subsequent characters in the string to accommodate the additional character introduced by the escape sequence.
[in,out] | s | Pointer to the null-terminated string to be modified. Important: The buffer pointed to by s must have sufficient space to accommodate the additional characters resulting from the escape sequences. Failure to ensure adequate space may lead to buffer overflows. |
Definition at line 3189 of file SDDS_utils.c.
|
extern |
Escapes quote characters within a string by inserting backslashes.
This function scans the input string s
and inserts a backslash (\
) before each occurrence of the specified quote_char
, provided it is not already escaped. This is useful for preparing strings for formats that require escaped quotes.
[in,out] | s | Pointer to the string in which quotes will be escaped. The string will be modified in place. |
[in] | quote_char | The quote character to escape (e.g., " ). |
s
is updated correctly. The caller must ensure that s
has sufficient space to accommodate the additional backslashes.Definition at line 1901 of file SDDS_utils.c.
|
extern |
Determines if a specified file is locked.
This function checks whether the given file is currently locked. If file locking is enabled through the F_TEST
and ALLOW_FILE_LOCKING
macros, it attempts to open the file and apply a test lock using lockf
. The function returns 1
if the file is locked and 0
otherwise.
If file locking is not enabled (i.e., the F_TEST
and ALLOW_FILE_LOCKING
macros are not defined), the function always returns 0
, indicating that the file is not locked.
[in] | filename | The path to the file to be checked for a lock. |
1
if the file is locked.0
if the file is not locked or if file locking is not enabled.F_TEST
and ALLOW_FILE_LOCKING
macros are appropriately defined to enable file locking functionality.Definition at line 3282 of file SDDS_utils.c.
|
extern |
Filters rows of interest in an SDDS dataset based on numeric scanning of a specified column.
This function marks rows in the provided SDDS dataset as "of interest" based on whether the entries in the specified filter column can be interpreted as valid numbers. It supports inversion of the filtering criterion through the mode
parameter.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
filter_column | A null-terminated string specifying the name of the column used for numeric scanning. This column must not be of string type. |
mode | An unsigned integer representing mode flags. Supported flags include:
|
-1
and sets an appropriate error message.-1 | Indicates that an error occurred (e.g., invalid dataset, unrecognized filter column, filter column is of string type). |
Non-negative | Integer representing the count of rows marked as "of interest". |
tokenIsNumber
to determine if an entry is a valid number.Definition at line 3697 of file SDDS_extract.c.
|
extern |
Filters rows of interest in an SDDS dataset based on numeric ranges in a specified column.
This function marks rows in the provided SDDS dataset as "of interest" if the values in the specified filter column fall within the defined numeric range (lower_limit
to upper_limit
). Logical operations specified by the logic
parameter determine how the filtering interacts with existing row flags.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
filter_column | A null-terminated string specifying the name of the column used for numeric filtering. This column must be of a numeric type. |
lower_limit | The lower bound of the numeric range. Rows with values below this limit are excluded. |
upper_limit | The upper bound of the numeric range. Rows with values above this limit are excluded. |
logic | An integer representing logical operation flags. Supported flags include:
|
-1
and sets an appropriate error message.-1 | Indicates that an error occurred (e.g., invalid dataset, unrecognized filter column, non-numeric filter column). |
Non-negative | Integer representing the count of rows marked as "of interest". |
SDDS_SHORT
, SDDS_USHORT
, SDDS_LONG
, SDDS_ULONG
, SDDS_LONG64
, SDDS_ULONG64
, SDDS_FLOAT
, SDDS_DOUBLE
, SDDS_LONGDOUBLE
).Definition at line 3628 of file SDDS_extract.c.
|
extern |
Finds the first array in the SDDS dataset that matches the specified criteria.
This function searches through the arrays of the provided SDDS dataset and returns the name of the first array that matches the given criteria based on the specified mode.
The function supports the following modes:
int32_t type
, char *name1, char *name2, ..., NULL
char *name1, char *name2, ..., NULL
char *name1, char *name2, ..., NULL
char *name1, char *name2, ..., NULL
char *name1, char *name2, ..., NULL
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure containing the dataset. |
[in] | mode | Specifies the mode for matching arrays. Valid modes are:
|
[in] | ... | Variable arguments depending on mode :
|
NULL
if no matching array is found or if an error occurs (e.g., memory allocation failure).free()
or an appropriate memory deallocation function.mode
.Definition at line 4491 of file SDDS_utils.c.
|
extern |
Finds the first column in the SDDS dataset that matches the specified criteria.
This function searches through the columns of the provided SDDS dataset and returns the name of the first column that matches the given criteria based on the specified mode.
The function supports the following modes:
int32_t type
, char *name1, char *name2, ..., NULL
char *name1, char *name2, ..., NULL
char *name1, char *name2, ..., NULL
char *name1, char *name2, ..., NULL
char *name1, char *name2, ..., NULL
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure containing the dataset. |
[in] | mode | Specifies the mode for matching columns. Valid modes are:
|
[in] | ... | Variable arguments depending on mode :
|
NULL
if no matching column is found or if an error occurs (e.g., memory allocation failure).free()
or an appropriate memory deallocation function.mode
.Definition at line 4312 of file SDDS_utils.c.
|
extern |
Finds the first parameter in the SDDS dataset that matches the specified criteria.
This function searches through the parameters of the provided SDDS dataset and returns the name of the first parameter that matches the given criteria based on the specified mode.
The function supports the following modes:
int32_t type
, char *name1, char *name2, ..., NULL
char *name1, char *name2, ..., NULL
char *name1, char *name2, ..., NULL
char *name1, char *name2, ..., NULL
char *name1, char *name2, ..., NULL
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure containing the dataset. |
[in] | mode | Specifies the mode for matching parameters. Valid modes are:
|
[in] | ... | Variable arguments depending on mode :
|
NULL
if no matching parameter is found or if an error occurs (e.g., memory allocation failure).free()
or an appropriate memory deallocation function.mode
.Definition at line 4404 of file SDDS_utils.c.
|
extern |
Flushes the buffered data to a file to ensure all data is written.
This function writes any remaining data in the buffer (fBuffer
) to the file pointed to by fp
. If the buffer contains data, it writes the data to the file, resets the buffer, and flushes the file's output buffer using fflush
. This ensures that all buffered data is physically written to the file.
fp | The file pointer to which buffered data will be written. |
fBuffer | Pointer to an SDDS_FILEBUFFER structure containing the buffered data. |
fBuffer->bufferSize
is zero, the function will only call fflush(fp)
.fp
or fBuffer
is NULL
, the function sets an error message and returns 0. Definition at line 632 of file SDDS_binary.c.
|
extern |
Marks an SDDS dataset as inactive.
This function forces the provided SDDS dataset to become inactive by setting its file pointer to NULL
. An inactive dataset is typically not associated with any open file operations.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure to be marked as inactive. |
1
on successful operation.-1
if a NULL
pointer is passed, indicating an error.Definition at line 3223 of file SDDS_utils.c.
|
extern |
Free memory previously allocated by SDDS_Malloc.
This function frees memory that wsa previously allocated by SDDS_Malloc.
[in] | mem | Pointer to the memory block. |
Definition at line 655 of file SDDS_utils.c.
|
extern |
Frees memory allocated for an SDDS array structure.
This function deallocates all memory associated with an SDDS_ARRAY
structure, including its data and definition. It handles the freeing of string elements if the array type is SDDS_STRING
and ensures that all pointers are set to NULL
after deallocation to prevent dangling references.
[in] | array | Pointer to the SDDS_ARRAY structure to be freed. |
array
pointer becomes invalid and should not be used.Definition at line 2766 of file SDDS_utils.c.
|
extern |
Frees memory allocated for an array definition.
This function deallocates all memory associated with an ARRAY_DEFINITION
structure, including its string fields. After freeing, the structure is zeroed out to prevent dangling pointers.
[in] | source | Pointer to the ARRAY_DEFINITION structure to be freed. |
1
on successful deallocation. Returns 0
if the source
is NULL
.source
pointer becomes invalid and should not be used.Definition at line 1238 of file SDDS_utils.c.
|
extern |
Frees memory allocated for an associate definition.
This function deallocates all memory associated with an ASSOCIATE_DEFINITION
structure, including its string fields. After freeing, the structure is zeroed out to prevent dangling pointers.
[in] | source | Pointer to the ASSOCIATE_DEFINITION structure to be freed. |
1
on successful deallocation. Returns 0
if the source
is NULL
or if required fields are missing.source
pointer becomes invalid and should not be used.Definition at line 944 of file SDDS_utils.c.
|
extern |
Frees memory allocated for a column definition.
This function deallocates all memory associated with a COLUMN_DEFINITION
structure, including its string fields. After freeing, the structure is zeroed out to prevent dangling pointers.
[in] | source | Pointer to the COLUMN_DEFINITION structure to be freed. |
1
on successful deallocation. Returns 0
if the source
is NULL
or if required fields are missing.source
pointer becomes invalid and should not be used.Definition at line 1042 of file SDDS_utils.c.
|
extern |
Frees memory allocated for a two-dimensional matrix.
This function deallocates a two-dimensional matrix by freeing each row individually followed by the matrix pointer itself.
[in] | ptr | Pointer to the two-dimensional matrix to be freed. |
[in] | dim1 | The number of rows in the matrix. |
SDDS_AllocateMatrix
or similar memory allocation functions.Definition at line 2808 of file SDDS_utils.c.
|
extern |
Frees memory allocated for a parameter definition.
This function deallocates all memory associated with a PARAMETER_DEFINITION
structure, including its string fields. After freeing, the structure is zeroed out to prevent dangling pointers.
[in] | source | Pointer to the PARAMETER_DEFINITION structure to be freed. |
1
on successful deallocation. Returns 0
if the source
is NULL
or if required fields are missing.source
pointer becomes invalid and should not be used.Definition at line 1139 of file SDDS_utils.c.
|
extern |
Frees an array of strings by deallocating each individual string.
This function iterates through an array of strings, freeing each non-NULL string and setting its pointer to NULL
to prevent dangling references.
[in,out] | string | Array of strings to be freed. |
[in] | strings | The number of elements in the string array. |
1
if the array is successfully freed.0
if the string
pointer is NULL
.NULL
.Definition at line 2865 of file SDDS_utils.c.
|
extern |
Frees all allocated string data in the SDDS dataset.
This function frees any strings allocated for parameters, arrays, and columns within the SDDS dataset. It is typically called during termination to clean up allocated memory.
SDDS_dataset | The SDDS dataset to free string data from. |
Definition at line 1374 of file SDDS_input.c.
|
extern |
Retrieves an array from the current data table of an SDDS dataset.
This function returns a pointer to a SDDS_ARRAY
structure containing the data and other information about a specified array within the current data table of an SDDS dataset. The function can either populate a provided SDDS_ARRAY
structure or allocate a new one if memory
is NULL
.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
array_name | A null-terminated string specifying the name of the SDDS array to retrieve. |
memory | Optional pointer to an existing SDDS_ARRAY structure where the array information will be stored. If NULL , a new SDDS_ARRAY structure is allocated and returned. |
SDDS_ARRAY
structure containing the array data and metadata. If memory
is not NULL
, the function populates the provided structure. On failure, returns NULL
and sets an appropriate error message.NULL | Indicates that an error occurred (e.g., invalid dataset, unrecognized array name, memory allocation failure). |
Non-NULL | Pointer to a SDDS_ARRAY structure containing the array data and metadata. |
SDDS_ARRAY
structure if memory
is NULL
.definition
field in the returned structure points to the internal copy of the array definition.Definition at line 4209 of file SDDS_extract.c.
|
extern |
Retrieves the definition of a specified array from the SDDS dataset.
This function searches for an array by its name within the provided SDDS dataset. If found, it creates a copy of the array's definition and returns a pointer to it. The returned pointer should be freed by the caller using SDDS_FreeArrayDefinition
to avoid memory leaks.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A null-terminated string specifying the name of the array to retrieve. |
ARRAY_DEFINITION
structure containing the array's information. On failure (e.g., if the array is not found or a copy fails), returns NULL
and records an error message.ARRAY_DEFINITION
pointer using SDDS_FreeArrayDefinition
.Definition at line 1174 of file SDDS_utils.c.
|
extern |
Retrieves the index of a named array in the SDDS dataset.
This function searches for an array by its name within the provided SDDS dataset and returns its index. The index can then be used with other routines for faster access to the array's data or metadata.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A null-terminated string specifying the name of the array whose index is desired. |
-1
and records an error message.Definition at line 1367 of file SDDS_utils.c.
|
extern |
Retrieves an array from the current data table of an SDDS dataset and converts its elements to doubles.
This function extracts the specified array from the provided SDDS dataset and converts each of its elements into a double
value. It ensures that the array is of a compatible numeric type before performing the conversion.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
array_name | A null-terminated string specifying the name of the SDDS array to retrieve and convert. |
values | Pointer to an integer where the number of elements in the array will be stored upon successful completion. |
double
values representing the SDDS array elements. On failure, returns NULL
and sets an appropriate error message.NULL | Indicates that an error occurred (e.g., invalid dataset, unrecognized array name, incompatible array type, memory allocation failure). |
Non-NULL | Pointer to an array of double values representing the SDDS array elements. |
double
array.Definition at line 4413 of file SDDS_extract.c.
|
extern |
Retrieves information about a specified array in the SDDS dataset.
This function is the preferred alternative to SDDS_GetArrayDefinition
. It allows you to obtain information about a specific field of an array, either by the array's name or index.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | field_name | A null-terminated string specifying the name of the field for which information is requested. |
[out] | memory | Pointer to a variable where the retrieved information will be stored. The variable should be of type data_type* , where data_type corresponds to the type of the requested information. For STRING information, use char* . If memory is NULL , the function will verify the existence and type of the information, returning the data type without storing any data. |
[in] | mode | Specifies how to identify the array. Valid values are:
|
mode
parameter.Definition at line 192 of file SDDS_info.c.
|
extern |
Retrieves an array from the current data table of an SDDS dataset and converts its elements to 32-bit integers.
This function extracts the specified array from the provided SDDS dataset and converts each of its elements into a 32-bit integer (int32_t
). It ensures that the array is of a compatible numeric type before performing the conversion.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
array_name | A null-terminated string specifying the name of the SDDS array to retrieve and convert. |
values | Pointer to an integer where the number of elements in the array will be stored upon successful completion. |
int32_t
values representing the SDDS array elements. On failure, returns NULL
and sets an appropriate error message.NULL | Indicates that an error occurred (e.g., invalid dataset, unrecognized array name, incompatible array type, memory allocation failure). |
Non-NULL | Pointer to an array of int32_t values representing the SDDS array elements. |
int32_t
array.Definition at line 4518 of file SDDS_extract.c.
|
extern |
Retrieves an array from the current data table of an SDDS dataset and converts its elements to strings.
This function extracts the specified array from the provided SDDS dataset and converts each of its elements into a null-terminated string representation. The conversion respects the data type of the array elements, ensuring accurate string formatting.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
array_name | A null-terminated string specifying the name of the SDDS array to retrieve and convert. |
values | Pointer to an integer where the number of elements in the array will be stored upon successful completion. |
char **
). Each string represents an element of the original SDDS array. On failure, returns NULL
and sets an appropriate error message.NULL | Indicates that an error occurred (e.g., invalid dataset, unrecognized array name, memory allocation failure). |
Non-NULL | Pointer to an array of strings representing the SDDS array elements. |
Definition at line 4291 of file SDDS_extract.c.
|
extern |
Retrieves the names of all arrays in the SDDS dataset.
This function allocates and returns an array of NULL-terminated strings containing the names of the arrays in the provided SDDS_dataset
.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[out] | number | Pointer to an int32_t variable where the number of retrieved array names will be stored. |
NULL
on failure (e.g., if the dataset is invalid or memory allocation fails) and records an error message.SDDS_FreeStringArray
or similar functions.Definition at line 2539 of file SDDS_utils.c.
|
extern |
Retrieves the data type of an array in the SDDS dataset by its index.
This function returns the SDDS data type of the specified array within the dataset. The data type corresponds to one of the predefined SDDS type constants, such as SDDS_LONGDOUBLE
, SDDS_DOUBLE
, SDDS_FLOAT
, etc.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | index | The zero-based index of the array whose data type is to be retrieved. The index should be obtained from SDDS_DefineArray or SDDS_GetArrayIndex . |
int32_t
. On failure (e.g., if the index is out of range or the dataset is invalid), returns 0
and records an error message.Definition at line 2202 of file SDDS_utils.c.
|
extern |
Retrieves the definition of a specified associate from the SDDS dataset.
This function searches for an associate by its name within the provided SDDS dataset. If found, it creates a copy of the associate's definition and returns a pointer to it. The returned pointer should be freed by the caller using SDDS_FreeAssociateDefinition
to avoid memory leaks.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A null-terminated string specifying the name of the associate to retrieve. |
ASSOCIATE_DEFINITION
structure containing the associate's information. On failure (e.g., if the associate is not found or a copy fails), returns NULL
and records an error message.ASSOCIATE_DEFINITION
pointer using SDDS_FreeAssociateDefinition
.Definition at line 883 of file SDDS_utils.c.
|
extern |
Retrieves the index of a named associate in the SDDS dataset.
This function searches for an associate by its name within the provided SDDS dataset and returns its index. The index can then be used with other routines for faster access to the associate's data or metadata.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A null-terminated string specifying the name of the associate whose index is desired. |
-1
and records an error message.Definition at line 1396 of file SDDS_utils.c.
|
extern |
Retrieves information about a specified associate in the SDDS dataset.
This function allows you to obtain information about a specific field of an associate, either by the associate's name or index.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | field_name | A null-terminated string specifying the name of the field for which information is requested. |
[out] | memory | Pointer to a variable where the retrieved information will be stored. The variable should be of type data_type* , where data_type corresponds to the type of the requested information. For STRING information, use char* . If memory is NULL , the function will verify the existence and type of the information, returning the data type without storing any data. |
[in] | mode | Specifies how to identify the associate. Valid values are:
|
mode
parameter.Definition at line 267 of file SDDS_info.c.
|
extern |
Retrieves the names of all associates in the SDDS dataset.
This function allocates and returns an array of NULL-terminated strings containing the names of the associates in the provided SDDS_dataset
.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[out] | number | Pointer to an int32_t variable where the number of retrieved associate names will be stored. |
NULL
on failure (e.g., if the dataset is invalid or memory allocation fails) and records an error message.SDDS_FreeStringArray
or similar functions.Definition at line 2577 of file SDDS_utils.c.
|
extern |
Retrieves all rows marked as "of interest" as a matrix, casting each value to a specified numerical type.
This function extracts all rows that are flagged as "of interest" within the current data table of a dataset and casts each value to a specified numerical type. It processes only those columns that are flagged as "of interest" and returns the data as a matrix, where each row is an array of casted values corresponding to the selected columns.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
n_rows | Pointer to an int64_t variable where the number of rows retrieved will be stored. |
sddsType | Integer constant representing the desired data type for casting (e.g., SDDS_DOUBLE , SDDS_FLOAT , etc.). Must be a valid numerical type as defined by SDDS. |
sddsType
, memory allocation failure). In this case, an error message is recorded internally.sddsType
is a valid numerical type supported by SDDS.n_rows
.SDDS_CastValue
. If casting fails for any value, the function will terminate and return NULL
.DONT_TRACK_COLUMN_MEMORY_AFTER_ACCESS
, the internal data for the columns may be freed after access.Definition at line 2343 of file SDDS_extract.c.
|
extern |
Retrieves a copy of the data for a specified column, including only rows marked as "of interest".
This function returns a newly allocated array containing data from the specified column for all rows that are flagged as "of interest". The data type of the returned array matches the column's data type.
For columns of type SDDS_STRING
, the returned array is of type char**
, with each element being a dynamically allocated string.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
column_name | NULL-terminated string specifying the name of the column to retrieve. |
SDDS_STRING
types, each string within the array should be freed individually, followed by the array itself.SDDS_CountRowsOfInterest
.DONT_TRACK_COLUMN_MEMORY_AFTER_ACCESS
, the internal data may be freed after access.Definition at line 611 of file SDDS_extract.c.
|
extern |
Retrieves the definition of a specified column from the SDDS dataset.
This function searches for a column by its name within the provided SDDS dataset. If found, it creates a copy of the column's definition and returns a pointer to it. The returned pointer should be freed by the caller using SDDS_FreeColumnDefinition
to avoid memory leaks.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A null-terminated string specifying the name of the column to retrieve. |
COLUMN_DEFINITION
structure containing the column's information. On failure (e.g., if the column is not found or a copy fails), returns NULL
and records an error message.COLUMN_DEFINITION
pointer using SDDS_FreeColumnDefinition
.Definition at line 978 of file SDDS_utils.c.
|
extern |
Retrieves the index of a named column in the SDDS dataset.
This function searches for a column by its name within the provided SDDS dataset and returns its index. The index can then be used with other routines for faster access to the column's data or metadata.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A null-terminated string specifying the name of the column whose index is desired. |
-1
and records an error message.Definition at line 1309 of file SDDS_utils.c.
|
extern |
Retrieves the data of a specified numerical column as an array of doubles, considering only rows marked as "of interest".
This function extracts data from a specified column within the current data table of a dataset. It processes only those rows that are flagged as "of interest" (i.e., have a non-zero acceptance flag). The extracted data is returned as a newly allocated array of double
values.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
column_name | NULL-terminated string specifying the name of the column from which data is to be retrieved. |
double
containing the data from the specified column for all rows marked as "of interest".SDDS_CHARACTER
) will result in an error.SDDS_CountRowsOfInterest
.DONT_TRACK_COLUMN_MEMORY_AFTER_ACCESS
, the internal data for the column may be freed after access.Definition at line 872 of file SDDS_extract.c.
|
extern |
Retrieves the data of a specified numerical column as an array of floats, considering only rows marked as "of interest".
This function extracts data from a specified column within the current data table of a dataset. It processes only those rows that are flagged as "of interest" (i.e., have a non-zero acceptance flag). The extracted data is returned as a newly allocated array of float
values.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
column_name | NULL-terminated string specifying the name of the column from which data is to be retrieved. |
float
containing the data from the specified column for all rows marked as "of interest".SDDS_CHARACTER
) will result in an error.SDDS_CountRowsOfInterest
.DONT_TRACK_COLUMN_MEMORY_AFTER_ACCESS
, the internal data for the column may be freed after access.Definition at line 1014 of file SDDS_extract.c.
|
extern |
Retrieves information about a specified column in the SDDS dataset.
This function is the preferred alternative to SDDS_GetColumnDefinition
. It allows you to obtain information about a specific field of a column, either by the column's name or index.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | field_name | A null-terminated string specifying the name of the field for which information is requested. |
[out] | memory | Pointer to a variable where the retrieved information will be stored. The variable should be of type data_type* , where data_type corresponds to the type of the requested information. For STRING information, use char* . If memory is NULL , the function will verify the existence and type of the information, returning the data type without storing any data. |
[in] | mode | Specifies how to identify the column. Valid values are:
|
mode
parameter.Definition at line 41 of file SDDS_info.c.
|
extern |
Retrieves the data of a specified numerical column as an array of 32-bit integers, considering only rows marked as "of interest".
This function extracts data from a specified column within the current data table of a dataset. It processes only those rows that are flagged as "of interest" (i.e., have a non-zero acceptance flag). The extracted data is returned as a newly allocated array of int32_t
values.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
column_name | NULL-terminated string specifying the name of the column from which data is to be retrieved. |
int32_t
containing the data from the specified column for all rows marked as "of interest".SDDS_CHARACTER
) will result in an error.SDDS_CountRowsOfInterest
.DONT_TRACK_COLUMN_MEMORY_AFTER_ACCESS
, the internal data for the column may be freed after access.Definition at line 1157 of file SDDS_extract.c.
|
extern |
Retrieves the data of a specified numerical column as an array of short integers, considering only rows marked as "of interest".
This function extracts data from a specified column within the current data table of a dataset. It processes only those rows that are flagged as "of interest" (i.e., have a non-zero acceptance flag). The extracted data is returned as a newly allocated array of short
values.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
column_name | NULL-terminated string specifying the name of the column from which data is to be retrieved. |
short
containing the data from the specified column for all rows marked as "of interest".SDDS_CHARACTER
) will result in an error.SDDS_CountRowsOfInterest
.DONT_TRACK_COLUMN_MEMORY_AFTER_ACCESS
, the internal data for the column may be freed after access.Definition at line 1298 of file SDDS_extract.c.
|
extern |
Retrieves the data of a specified column as an array of strings, considering only rows marked as "of interest".
This function extracts data from a specified column within the current data table of a dataset. It processes only those rows that are flagged as "of interest" (i.e., have a non-zero acceptance flag). The extracted data is returned as a newly allocated array of char*
(strings).
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
column_name | NULL-terminated string specifying the name of the column from which data is to be retrieved. |
char*
containing the data from the specified column for all rows marked as "of interest".SDDS_STRING
or SDDS_CHARACTER
). Attempting to retrieve data from a non-string column will result in an error.SDDS_CountRowsOfInterest
.DONT_TRACK_COLUMN_MEMORY_AFTER_ACCESS
, the internal data for the column may be freed after access.Definition at line 1439 of file SDDS_extract.c.
|
extern |
Retrieves the current column memory mode for the SDDS dataset.
SDDS_dataset | The SDDS dataset to query. |
Definition at line 1358 of file SDDS_input.c.
|
extern |
Retrieves the names of all columns in the SDDS dataset.
This function allocates and returns an array of NULL-terminated strings containing the names of the columns in the provided SDDS_dataset
. It only includes columns that are flagged as of interest if column_flag
is set.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[out] | number | Pointer to an int32_t variable where the number of retrieved column names will be stored. |
NULL
on failure (e.g., if the dataset is invalid or memory allocation fails) and records an error message.SDDS_FreeStringArray
or similar functions.Definition at line 2460 of file SDDS_utils.c.
|
extern |
Retrieves the data type of a column in the SDDS dataset by its index.
This function returns the SDDS data type of the specified column within the dataset. The data type corresponds to one of the predefined SDDS type constants, such as SDDS_LONGDOUBLE
, SDDS_DOUBLE
, SDDS_FLOAT
, etc.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | index | The zero-based index of the column whose data type is to be retrieved. The index should be obtained from SDDS_DefineColumn or SDDS_GetColumnIndex . |
int32_t
. On failure (e.g., if the index is out of range or the dataset is invalid), returns 0
and records an error message.Definition at line 2153 of file SDDS_utils.c.
|
extern |
Retrieves the text and contents descriptions from an SDDS dataset.
This function extracts the text description and contents description from the specified SDDS dataset. The descriptions are copied into the provided pointers if they are not NULL
. This allows users to obtain metadata information about the dataset's content and purpose.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
text | Pointer to a char* variable where the text description will be copied. If NULL , the text description is not retrieved. |
contents | Pointer to a char* variable where the contents description will be copied. If NULL , the contents description is not retrieved. |
1
on successful retrieval of the descriptions. On failure, returns 0
and sets an appropriate error message.1 | Indicates that the descriptions were successfully retrieved and copied. |
0 | Indicates that an error occurred (e.g., invalid dataset, memory allocation failure). |
text
and contents
if they are not NULL
.Definition at line 4626 of file SDDS_extract.c.
|
extern |
Extracts a matrix of doubles from a specified column in the current data table of an SDDS dataset.
This function retrieves the data from the specified column as double
values and organizes it into a matrix with the given dimensions. The data is arranged in either row-major or column-major order based on the mode
parameter. The function allocates memory for the matrix, which should be freed by the caller.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
column_name | A null-terminated string specifying the name of the column from which to extract the matrix. |
dimension1 | The number of rows in the resulting matrix. |
dimension2 | The number of columns in the resulting matrix. |
mode | Specifies the data layout in the matrix. Use SDDS_ROW_MAJOR_DATA for row-major order or SDDS_COLUMN_MAJOR_DATA for column-major order. |
double
values. The matrix is an array of pointers, where each pointer refers to a row (for row-major) or a column (for column-major) in the matrix. On failure, returns NULL
and sets an appropriate error message.NULL | Indicates that an error occurred (e.g., invalid dataset, column not found, dimension mismatch, memory allocation failure). |
Non-NULL | Pointer to the allocated matrix containing double values. |
Definition at line 3214 of file SDDS_extract.c.
|
extern |
Retrieves recorded error messages from the SDDS error stack.
This function fetches error messages that have been recorded by SDDS library routines. Depending on the mode
parameter, it can retrieve a single error message or all recorded errors.
[out] | number | Pointer to an int32_t variable where the number of retrieved error messages will be stored. If NULL , the function returns NULL . |
[in] | mode | Flags controlling the retrieval behavior:
|
NULL
if no errors are recorded or if memory allocation fails.Definition at line 480 of file SDDS_utils.c.
|
extern |
Retrieves the fixed value of a specified parameter from an SDDS dataset.
This function accesses the fixed value defined for a given parameter in the dataset's layout and converts it to the appropriate data type. If the memory
pointer is provided, the converted value is stored at the specified memory location. Otherwise, memory is allocated internally to hold the value, which must be freed by the caller.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
parameter_name | A null-terminated string specifying the name of the parameter whose fixed value is to be retrieved. |
memory | Optional pointer to a memory location where the fixed value will be stored. The size of the memory should correspond to the size of the parameter's data type. If NULL , memory is allocated internally to hold the value. |
NULL
and sets an appropriate error message.NULL | Indicates that an error occurred (e.g., invalid dataset, parameter not found, invalid data type, memory allocation failure, or scan failure). |
Non-NULL | Pointer to the memory containing the fixed parameter value. |
memory
parameter is NULL
.Definition at line 3084 of file SDDS_extract.c.
|
extern |
Retrieves an internal pointer to the data of a specified column, including all rows.
This function returns a direct pointer to the internal data array of the specified column. Unlike SDDS_GetColumn
, it includes all rows, regardless of their acceptance flags.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
column_name | NULL-terminated string specifying the name of the column to retrieve. |
DONT_TRACK_COLUMN_MEMORY_AFTER_ACCESS
, the internal data may be freed after access.Definition at line 688 of file SDDS_extract.c.
|
extern |
Extracts a matrix from a specified column in the current data table of an SDDS dataset.
This function retrieves the data from the specified column and organizes it into a matrix with the given dimensions. The data is arranged in either row-major or column-major order based on the mode
parameter. The function allocates memory for the matrix, which should be freed by the caller.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
column_name | A null-terminated string specifying the name of the column from which to extract the matrix. |
dimension1 | The number of rows in the resulting matrix. |
dimension2 | The number of columns in the resulting matrix. |
mode | Specifies the data layout in the matrix. Use SDDS_ROW_MAJOR_DATA for row-major order or SDDS_COLUMN_MAJOR_DATA for column-major order. |
NULL
and sets an appropriate error message.NULL | Indicates that an error occurred (e.g., invalid dataset, column not found, dimension mismatch, memory allocation failure). |
Non-NULL | Pointer to the allocated matrix. |
Definition at line 3142 of file SDDS_extract.c.
|
extern |
Retrieves all rows marked as "of interest" as a matrix (array of row arrays).
This function extracts all rows that are flagged as "of interest" within the current data table of a dataset. It processes only those columns that are flagged as "of interest" and returns the data as a matrix, where each row is an array of values corresponding to the selected columns.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
n_rows | Pointer to an int64_t variable where the number of rows retrieved will be stored. |
n_rows
.SDDS_STRING
), each element in the row arrays is a dynamically allocated string that must be freed individually.DONT_TRACK_COLUMN_MEMORY_AFTER_ACCESS
, the internal data for the columns may be freed after access.Definition at line 2266 of file SDDS_extract.c.
|
extern |
Retrieves the data type of an array in the SDDS dataset by its name.
This function searches for an array by its name within the dataset and returns its SDDS data type. The data type corresponds to one of the predefined SDDS type constants, such as SDDS_LONGDOUBLE
, SDDS_DOUBLE
, SDDS_FLOAT
, etc.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A null-terminated string specifying the name of the array whose data type is to be retrieved. |
int32_t
. On failure (e.g., if the array name is not found or the dataset is invalid), returns 0
and records an error message.SDDS_GetArrayIndex
to find the array's index before retrieving its type.Definition at line 2227 of file SDDS_utils.c.
|
extern |
Retrieves the data type of a column in the SDDS dataset by its name.
This function searches for a column by its name within the dataset and returns its SDDS data type. The data type corresponds to one of the predefined SDDS type constants, such as SDDS_LONGDOUBLE
, SDDS_DOUBLE
, SDDS_FLOAT
, etc.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A null-terminated string specifying the name of the column whose data type is to be retrieved. |
int32_t
. On failure (e.g., if the column name is not found or the dataset is invalid), returns 0
and records an error message.SDDS_GetColumnIndex
to find the column's index before retrieving its type.Definition at line 2178 of file SDDS_utils.c.
|
extern |
Retrieves the data type of a parameter in the SDDS dataset by its name.
This function searches for a parameter by its name within the dataset and returns its SDDS data type. The data type corresponds to one of the predefined SDDS type constants, such as SDDS_LONGDOUBLE
, SDDS_DOUBLE
, SDDS_FLOAT
, etc.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A null-terminated string specifying the name of the parameter whose data type is to be retrieved. |
int32_t
. On failure (e.g., if the parameter name is not found or the dataset is invalid), returns 0
and records an error message.SDDS_GetParameterIndex
to find the parameter's index before retrieving its type.Definition at line 2276 of file SDDS_utils.c.
|
extern |
Retrieves the data of a specified numerical column as an array of a desired numerical type, considering only rows marked as "of interest".
This function extracts data from a specified column within the current data table of a dataset. It processes only those rows that are flagged as "of interest" (i.e., have a non-zero acceptance flag). The extracted data is returned as a newly allocated array of the specified numerical type.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
column_name | NULL-terminated string specifying the name of the column from which data is to be retrieved. |
desiredType | Integer constant representing the desired data type for the returned array. Must be one of the supported SDDS numerical types (e.g., SDDS_DOUBLE , SDDS_FLOAT , etc.). |
SDDS_CHARACTER
) will result in an error.SDDS_CountRowsOfInterest
.DONT_TRACK_COLUMN_MEMORY_AFTER_ACCESS
, the internal data for the column may be freed after access.desiredType
matches the column's data type, this function internally calls SDDS_GetColumn
. Otherwise, it performs type casting using SDDS_CastValue
.Definition at line 1617 of file SDDS_extract.c.
|
extern |
Retrieves the value of a specified parameter from the current data table of a data set.
This function accesses the value of a specific parameter (identified by its name) within the current data table of a dataset. The retrieved value is either copied into user-provided memory or returned as a direct pointer to the internal data.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
parameter_name | NULL-terminated string specifying the name of the parameter from which the value is to be retrieved. |
memory | Pointer to user-allocated memory where the retrieved parameter value will be stored. If NULL , the function allocates memory. |
memory
(if provided) or to newly allocated memory.memory
is NULL
, the function allocates memory that the caller must free to prevent memory leaks.SDDS_STRING
), the function copies the string into memory
. A typical usage would involve passing a pointer to a char*
variable. c char *string; SDDS_GetParameter(&SDDS_dataset, "parameter_name", &string); // or string = *(char**)SDDS_GetParameter(&SDDS_dataset, "parameter_name", NULL);
SDDS_GetParameterType
.DONT_TRACK_PARAMETER_MEMORY_AFTER_ACCESS
, the internal data for the parameter may be freed after access.Definition at line 2481 of file SDDS_extract.c.
|
extern |
Retrieves the value of a specified parameter as a double
from the current data table of an SDDS dataset.
This function searches for the parameter by name within the provided SDDS dataset and retrieves its value as a double
. If the memory
pointer is supplied, the value is stored at the specified memory location. If memory
is NULL
, the function allocates memory for storing the value, which should be freed by the caller.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
parameter_name | A null-terminated string specifying the name of the parameter to retrieve. |
memory | Optional pointer to a double variable where the parameter value will be stored. If NULL , memory is allocated internally to hold the value. |
double
containing the parameter value. On failure, returns NULL
and sets an appropriate error message.NULL | Indicates that an error occurred (e.g., invalid dataset, parameter not found, type mismatch, or memory allocation failure). |
Non-NULL | Pointer to the double containing the parameter value. |
memory
parameter is NULL
.Definition at line 2782 of file SDDS_extract.c.
|
extern |
Retrieves the value of a specified parameter as a formatted string from the current data table of an SDDS dataset.
This function searches for the parameter by name within the provided SDDS dataset, formats its value based on the supplied format string, and returns it as a null-terminated string. If suppliedformat
is NULL
, the function uses the format string defined in the parameter's definition. If the memory
pointer is provided, the formatted string is stored at the specified memory location. Otherwise, memory is allocated internally to hold the string, which must be freed by the caller.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
parameter_name | A null-terminated string specifying the name of the parameter to retrieve. |
memory | Optional pointer to a char* variable where the formatted string will be stored. If NULL , memory is allocated internally to hold the string. |
suppliedformat | A null-terminated format string (similar to printf format specifiers) to format the parameter value. If NULL , the function uses the format string defined in the parameter's definition within the dataset. |
NULL
and sets an appropriate error message.NULL | Indicates that an error occurred (e.g., invalid dataset, parameter not found, invalid format string, type mismatch, memory allocation failure, or unknown data type). |
Non-NULL | Pointer to the null-terminated string containing the formatted parameter value. |
memory
parameter is NULL
.Definition at line 2935 of file SDDS_extract.c.
|
extern |
Retrieves the value of a specified parameter as a 32-bit integer from the current data table of a data set.
This function accesses the value of a specific parameter (identified by its name) within the current data table of a dataset and converts it to a 32-bit integer (int32_t
). The converted value is either stored in user-provided memory or allocated by the function.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
parameter_name | NULL-terminated string specifying the name of the parameter from which the value is to be retrieved. |
memory | Pointer to a 32-bit integer where the converted parameter value will be stored. If NULL , the function allocates memory. |
int32_t
value stored in memory
(if provided) or to newly allocated memory containing the converted value.SDDS_STRING
). In this case, an error message is recorded internally.memory
is NULL
, the function allocates memory that the caller must free to prevent memory leaks.SDDS_STRING
. Attempting to retrieve string parameters as long integers will result in an error.SDDS_ConvertToLong
, which handles casting from various numerical types to int32_t
.Definition at line 2615 of file SDDS_extract.c.
|
extern |
Retrieves the value of a specified parameter as a 64-bit integer from the current data table of an SDDS dataset.
This function looks up the parameter by name within the given SDDS dataset and returns its value as an int64_t
. If the memory
pointer is provided, the value is stored at the given memory location. Otherwise, the function allocates memory to store the value, which must be freed by the caller.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
parameter_name | A null-terminated string specifying the name of the parameter to retrieve. |
memory | Optional pointer to an int64_t variable where the parameter value will be stored. If NULL , memory is allocated internally to hold the value. |
int64_t
containing the parameter value. On failure, returns NULL
and sets an appropriate error message.NULL | Indicates that an error occurred (e.g., invalid dataset, parameter not found, type mismatch, or memory allocation failure). |
Non-NULL | Pointer to the int64_t containing the parameter value. |
memory
parameter is NULL
.Definition at line 2671 of file SDDS_extract.c.
|
extern |
Retrieves the value of a specified parameter as a long double
from the current data table of an SDDS dataset.
This function searches for the parameter by name within the provided SDDS dataset and retrieves its value as a long double
. If the memory
pointer is supplied, the value is stored at the specified memory location. If memory
is NULL
, the function allocates memory for storing the value, which should be freed by the caller.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
parameter_name | A null-terminated string specifying the name of the parameter to retrieve. |
memory | Optional pointer to a long double variable where the parameter value will be stored. If NULL , memory is allocated internally to hold the value. |
long double
containing the parameter value. On failure, returns NULL
and sets an appropriate error message.NULL | Indicates that an error occurred (e.g., invalid dataset, parameter not found, type mismatch, or memory allocation failure). |
Non-NULL | Pointer to the long double containing the parameter value. |
memory
parameter is NULL
.Definition at line 2727 of file SDDS_extract.c.
|
extern |
Retrieves the value of a specified parameter as a string from the current data table of an SDDS dataset.
This function searches for the parameter by name within the provided SDDS dataset and retrieves its value as a string. The function formats the parameter's value based on its data type. If the memory
pointer is provided, the string is stored at the specified memory location. Otherwise, the function allocates memory to hold the string, which must be freed by the caller.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
parameter_name | A null-terminated string specifying the name of the parameter to retrieve. |
memory | Optional pointer to a char* variable where the string will be stored. If NULL , memory is allocated internally to hold the string. |
NULL
and sets an appropriate error message.NULL | Indicates that an error occurred (e.g., invalid dataset, parameter not found, type mismatch, memory allocation failure, or unknown data type). |
Non-NULL | Pointer to the null-terminated string containing the parameter value. |
memory
parameter is NULL
.Definition at line 2838 of file SDDS_extract.c.
|
extern |
Retrieves the value of a specified parameter by its index from the current data table of a data set.
This function accesses the value of a specific parameter (identified by its index) within the current data table of a dataset. The retrieved value is either copied into user-provided memory or returned as a direct pointer to the internal data.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
index | Zero-based index of the parameter to retrieve. Must be within the range [0, n_parameters-1]. |
memory | Pointer to user-allocated memory where the retrieved parameter value will be stored. If NULL , the function allocates memory. |
memory
(if provided) or to newly allocated memory.memory
is NULL
, the function allocates memory that the caller must free to prevent memory leaks.SDDS_STRING
), the function copies the string into memory
. A typical usage would involve passing a pointer to a char*
variable. c char *string; SDDS_GetParameterByIndex(&SDDS_dataset, index, &string); // or string = *(char**)SDDS_GetParameterByIndex(&SDDS_dataset, index, NULL);
SDDS_GetParameterType
.DONT_TRACK_PARAMETER_MEMORY_AFTER_ACCESS
, the internal data for the parameter may be freed after access.Definition at line 2554 of file SDDS_extract.c.
|
extern |
Retrieves the definition of a specified parameter from the SDDS dataset.
This function searches for a parameter by its name within the provided SDDS dataset. If found, it creates a copy of the parameter's definition and returns a pointer to it. The returned pointer should be freed by the caller using SDDS_FreeParameterDefinition
to avoid memory leaks.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A null-terminated string specifying the name of the parameter to retrieve. |
PARAMETER_DEFINITION
structure containing the parameter's information. On failure (e.g., if the parameter is not found or a copy fails), returns NULL
and records an error message.PARAMETER_DEFINITION
pointer using SDDS_FreeParameterDefinition
.Definition at line 1075 of file SDDS_utils.c.
|
extern |
Retrieves the index of a named parameter in the SDDS dataset.
This function searches for a parameter by its name within the provided SDDS dataset and returns its index. The index can then be used with other routines for faster access to the parameter's data or metadata.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | name | A null-terminated string specifying the name of the parameter whose index is desired. |
-1
and records an error message.Definition at line 1338 of file SDDS_utils.c.
|
extern |
Retrieves information about a specified parameter in the SDDS dataset.
This function is the preferred alternative to SDDS_GetParameterDefinition
. It allows you to obtain information about a specific field of a parameter, either by the parameter's name or index.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | field_name | A null-terminated string specifying the name of the field for which information is requested. |
[out] | memory | Pointer to a variable where the retrieved information will be stored. The variable should be of type data_type* , where data_type corresponds to the type of the requested information. For STRING information, use char* . If memory is NULL , the function will verify the existence and type of the information, returning the data type without storing any data. |
[in] | mode | Specifies how to identify the parameter. Valid values are:
|
mode
parameter.Definition at line 117 of file SDDS_info.c.
|
extern |
Retrieves the names of all parameters in the SDDS dataset.
This function allocates and returns an array of NULL-terminated strings containing the names of the parameters in the provided SDDS_dataset
.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[out] | number | Pointer to an int32_t variable where the number of retrieved parameter names will be stored. |
NULL
on failure (e.g., if the dataset is invalid or memory allocation fails) and records an error message.SDDS_FreeStringArray
or similar functions.Definition at line 2501 of file SDDS_utils.c.
|
extern |
Retrieves multiple parameter values from the current data table of a data set.
This variadic function allows the retrieval of multiple parameter values in a single call. Each parameter's name and corresponding memory location are provided as pairs of arguments.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
... | Variable arguments consisting of pairs of:
|
memory
pointers provided are of appropriate types and have sufficient space to hold the parameter values.NULL
as the parameter name. c SDDS_GetParameters(&SDDS_dataset, "param1", &value1, "param2", &value2, NULL);
Definition at line 2420 of file SDDS_extract.c.
|
extern |
Retrieves the data type of a parameter in the SDDS dataset by its index.
This function returns the SDDS data type of the specified parameter within the dataset. The data type corresponds to one of the predefined SDDS type constants, such as SDDS_LONGDOUBLE
, SDDS_DOUBLE
, SDDS_FLOAT
, etc.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | index | The zero-based index of the parameter whose data type is to be retrieved. The index should be obtained from SDDS_DefineParameter or SDDS_GetParameterIndex . |
int32_t
. On failure (e.g., if the index is out of range or the dataset is invalid), returns 0
and records an error message.Definition at line 2251 of file SDDS_utils.c.
|
extern |
Retrieves the data of a specific selected row as an array, considering only columns marked as "of interest".
This function extracts data from a specific selected row (identified by its selected row index among rows marked as "of interest") within the current data table of a dataset. It processes only those columns that are flagged as "of interest" and returns the row's data as a newly allocated array or stores it in user-provided memory.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
srow_index | Zero-based index representing the position of the selected row among all rows marked as "of interest". |
memory | Pointer to user-allocated memory where the retrieved row data will be stored. If NULL , the function allocates memory. |
memory
(if provided) or to newly allocated memory.memory
is NULL
, the function allocates memory that the caller must free to prevent memory leaks.SDDS_STRING
), each element in the returned array is a dynamically allocated string that must be freed individually, followed by the array itself.SDDS_CountColumnsOfInterest
.DONT_TRACK_COLUMN_MEMORY_AFTER_ACCESS
, the internal data for the columns may be freed after access.Definition at line 2201 of file SDDS_extract.c.
|
extern |
Retrieves the acceptance flag of a specific row in the current data table.
This function fetches the acceptance flag for a given row. The flag indicates whether the row is "of interest" (non-zero) or rejected (zero).
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
row | Index of the row whose flag is to be retrieved. Must be within the range [0, n_rows-1]. |
Definition at line 71 of file SDDS_extract.c.
|
extern |
Retrieves the acceptance flags for all rows in the current data table.
This function copies the acceptance flags of each row into a provided array. Each flag indicates whether the corresponding row is "of interest" (non-zero) or rejected (zero).
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
flag | Pointer to an integer array where the row flags will be stored. The array must have at least rows elements. |
rows | Number of rows to retrieve flags for. Typically, this should match the total number of rows in the data table. |
flag
array is adequately allocated to hold the flags for all specified rows.Definition at line 97 of file SDDS_extract.c.
|
extern |
Retrieves the current row limit for the SDDS dataset.
Definition at line 1247 of file SDDS_input.c.
|
extern |
Extracts the next token from a string, handling quoted substrings and escape characters.
This function parses the input string s
to extract the next token, considering quoted substrings and escape characters. If the token is enclosed in double quotes ("
), the function ensures that embedded quotes are handled correctly. After extracting the token, the original string s
is updated to remove the extracted portion.
[in,out] | s | Pointer to the string from which to extract the token. This string will be modified to remove the extracted token. |
[out] | buffer | Pointer to a character array where the extracted token will be stored. |
[in] | buflen | The maximum number of characters to copy into buffer , including the null terminator. |
int32_t
. If no token is found or an error occurs (e.g., buffer overflow), returns -1
.s
is null-terminated. The caller must ensure that buffer
has sufficient space to hold the extracted token.Definition at line 1740 of file SDDS_utils.c.
|
extern |
Extracts the next token from a string, handling quoted substrings and escape characters, with updated string pointers.
This function parses the input string s
to extract the next token, considering quoted substrings and escape characters. If the token is enclosed in double quotes ("
), the function ensures that embedded quotes are handled correctly. After extracting the token, the original string s
is updated by adjusting the string pointer st
and the remaining string length strlength
.
[in,out] | s | Pointer to the string from which to extract the token. This string will be modified to remove the extracted token. |
[in,out] | st | Pointer to the current position in the string s . This will be updated to point to the next character after the extracted token. |
[in,out] | strlength | Pointer to an int32_t variable representing the remaining length of the string s . This will be decremented by the length of the extracted token. |
[out] | buffer | Pointer to a character array where the extracted token will be stored. |
[in] | buflen | The maximum number of characters to copy into buffer , including the null terminator. |
int32_t
. If no token is found or an error occurs (e.g., buffer overflow), returns -1
.buffer
has sufficient space to hold the extracted token. Additionally, st
and strlength
should accurately reflect the current parsing state of the string.Definition at line 1812 of file SDDS_utils.c.
|
extern |
Retrieves the name of a specified SDDS data type as a string.
This function returns a dynamically allocated string containing the name of the specified SDDS data type. The name corresponds to the textual representation of the data type, such as "double"
, "float"
, "int32"
, etc.
[in] | type | The SDDS data type for which the name is requested. Must be one of the predefined constants:
|
NULL
.SDDS_Free
.Definition at line 2337 of file SDDS_utils.c.
|
extern |
Retrieves the size in bytes of a specified SDDS data type.
This function returns the size, in bytes, of the specified SDDS data type. The size corresponds to the memory footprint of the data type when stored in the dataset.
[in] | type | The SDDS data type for which the size is requested. Must be one of the predefined constants:
|
-1
and records an error message.SDDS_type_size
array, which should be properly initialized with the sizes of all supported SDDS data types.Definition at line 2308 of file SDDS_utils.c.
|
extern |
Retrieves the value from a specified column and selected row, optionally storing it in provided memory.
This function accesses the value of a specific column and selected row within the current data table of a dataset. It returns the value as a pointer to the data, allowing for both direct access and optional storage in user-provided memory.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
column_name | NULL-terminated string specifying the name of the column from which the value is to be retrieved. |
srow_index | Zero-based index representing the position of the selected row among all rows marked as "of interest". |
memory | Pointer to user-allocated memory where the retrieved value will be stored. If NULL , the function allocates memory internally, and the caller is responsible for freeing it. |
memory
(if provided) or in newly allocated memory.memory
is NULL
, the function allocates memory that the caller must free to prevent memory leaks.memory
is of the appropriate type matching the column's data type.SDDS_STRING
), the function copies the string into memory
. A typical usage would involve passing a pointer to a char*
variable. c char *string; SDDS_GetValue(&SDDS_dataset, "name", index, &string); // or string = *(char**)SDDS_GetValue(&SDDS_dataset, "name", index, NULL);
SDDS_CountRowsOfInterest
.Definition at line 1754 of file SDDS_extract.c.
|
extern |
Retrieves the value from a specified column and selected row, casting it to a double.
This function accesses the value of a specific column and selected row within the current data table of a dataset. It casts the retrieved value to a double
before returning it.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
column_name | NULL-terminated string specifying the name of the column from which the value is to be retrieved. |
srow_index | Zero-based index representing the position of the selected row among all rows marked as "of interest". |
SDDS_CHARACTER
) will result in an error.Definition at line 1821 of file SDDS_extract.c.
|
extern |
Retrieves the value from a specified column and absolute row index, optionally storing it in provided memory.
This function accesses the value of a specific column (identified by its index) and an absolute row index within the current data table of a dataset. The retrieved value is either copied into user-provided memory or returned as a direct pointer to the internal data.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
column_index | Zero-based index of the column from which the value is to be retrieved. Must be within the range [0, n_columns-1]. |
row_index | Absolute zero-based row index within the dataset's data table. Must be within the range [0, n_rows-1]. |
memory | Pointer to user-allocated memory where the retrieved value will be stored. If NULL , the function returns a pointer to the internal data. |
memory
(if provided) or to the internal data.memory
is NULL
, the function returns a direct pointer to the internal data. Modifying the data through this pointer affects the dataset's internal state.memory
is provided, ensure that it points to sufficient memory to hold the data type of the column.memory
type matches the column's data type.SDDS_GetValueByIndex
, this function uses an absolute row index rather than a selected row index among rows marked as "of interest".SDDS_STRING
), the function copies the string into memory
. A typical usage would involve passing a pointer to a char*
variable. c char *string; SDDS_GetValueByAbsIndex(&SDDS_dataset, column_index, row_index, &string); // or string = *(char**)SDDS_GetValueByAbsIndex(&SDDS_dataset, column_index, row_index, NULL);
Definition at line 2090 of file SDDS_extract.c.
|
extern |
Retrieves the value from a specified column and selected row, optionally storing it in provided memory.
This function accesses the value of a specific column (identified by its index) and a selected row (identified by its selected row index among rows marked as "of interest") within the current data table of a dataset. The retrieved value is either copied into user-provided memory or returned as a direct pointer to the internal data.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
column_index | Zero-based index of the column from which the value is to be retrieved. Must be within the range [0, n_columns-1]. |
srow_index | Zero-based index representing the position of the selected row among all rows marked as "of interest". |
memory | Pointer to user-allocated memory where the retrieved value will be stored. If NULL , the function returns a pointer to the internal data. |
memory
(if provided) or to the internal data.memory
is NULL
, the function returns a direct pointer to the internal data. Modifying the data through this pointer affects the dataset's internal state.memory
is provided, ensure that it points to sufficient memory to hold the data type of the column.memory
type matches the column's data type.SDDS_STRING
), the function copies the string into memory
. A typical usage would involve passing a pointer to a char*
variable. c char *string; SDDS_GetValueByIndex(&SDDS_dataset, column_index, index, &string); // or string = *(char**)SDDS_GetValueByIndex(&SDDS_dataset, column_index, index, NULL);
SDDS_CountRowsOfInterest
.Definition at line 2014 of file SDDS_extract.c.
|
extern |
Retrieves the value from a specified column and selected row, casting it to a double.
This function accesses the value of a specific column (identified by its index) and a selected row (identified by its selected row index among rows marked as "of interest") within the current data table of a dataset. It casts the retrieved value to a double
before returning it.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
column_index | Zero-based index of the column from which the value is to be retrieved. Must be within the range [0, n_columns-1]. |
srow_index | Zero-based index representing the position of the selected row among all rows marked as "of interest". |
SDDS_CHARACTER
) will result in an error.0.0
may be ambiguous if it is a valid data value. Always check for errors using SDDS_CheckError
or similar mechanisms.SDDS_CountRowsOfInterest
.DONT_TRACK_COLUMN_MEMORY_AFTER_ACCESS
, the internal data for the column may be freed after access.Definition at line 1914 of file SDDS_extract.c.
|
extern |
Sets the current page of the SDDS dataset to the specified page number.
This function is used to navigate to a specific page of the SDDS dataset. It is only supported for non-zip files and does not work for pipe input.
SDDS_dataset | The SDDS dataset to operate on. |
page_number | The page number to navigate to. |
Definition at line 1261 of file SDDS_input.c.
|
extern |
Checks if a string contains any whitespace characters.
This function scans through the provided string to determine if it contains any whitespace characters (e.g., space, tab, newline).
[in] | string | Pointer to the null-terminated string to be checked. |
1
if the string contains at least one whitespace character. Returns 0
if no whitespace characters are found or if the input string is NULL
.Definition at line 1422 of file SDDS_utils.c.
|
extern |
Identifies the SDDS data type based on its string name.
This function searches for the SDDS data type that matches the provided string typeName
. It returns the corresponding SDDS data type constant if a match is found.
[in] | typeName | A null-terminated string representing the name of the SDDS data type to identify. |
int32_t
) corresponding to typeName
. On failure (e.g., if typeName
does not match any known data type), returns 0
.typeName
and the names of supported SDDS data types.Definition at line 2360 of file SDDS_utils.c.
|
extern |
Initializes the SDDS dataset for appending data by adding a new page to an existing file.
This function prepares the SDDS dataset for appending additional data to an existing SDDS file by initializing necessary data structures, verifying file integrity, and setting up for the addition of a new data page. It ensures that the file is writable, not compressed, and properly locked to prevent concurrent modifications.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure to be initialized for appending. |
[in] | filename | The name of the existing SDDS file to which data will be appended. If NULL , data will be appended to standard input. |
1
on successful initialization.0
on error. In this case, an internal error message is set describing the failure.filename
is NULL
, the dataset will append data from standard input.Definition at line 287 of file SDDS_output.c.
|
extern |
Initializes the SDDS dataset for appending data to the last page of an existing file.
This function sets up the SDDS dataset to append additional data rows to the last page of an existing SDDS file. It reads the existing file layout, determines the current state of data (including row counts), and prepares internal data structures to accommodate new data. The function also handles file locking, buffer management, and ensures that the file is ready for efficient data appending based on the specified update interval.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure to be initialized for appending. |
[in] | filename | The name of the existing SDDS file to which data will be appended. If NULL , data will be appended to standard input. |
[in] | updateInterval | The number of rows to write before the dataset reallocates memory or flushes data. This parameter controls the frequency of memory allocation and disk I/O operations during the append process. |
[out] | rowsPresentReturn | Pointer to an int64_t variable where the function will store the number of rows present in the dataset after initialization. This provides information on the current dataset size. |
1
on successful initialization.0
on error. In this case, an internal error message is set detailing the issue.rowsPresentReturn
is updated with the current number of rows in the dataset.filename
is NULL
, data will be appended from standard input.Definition at line 396 of file SDDS_output.c.
|
extern |
Initializes an SDDS_DATASET structure in preparation for copying a data table from another SDDS_DATASET structure.
SDDS_target | Address of SDDS_DATASET structure into which to copy data. |
SDDS_source | Address of SDDS_DATASET structure from which to copy data. |
filename | A NULL-terminated character string giving a filename to be associated with the new SDDS_DATASET. Typically, the name of a file to which the copied data will be written after modification. Ignored if NULL. |
filemode | A NULL-terminated character string giving the fopen file mode to be used to open the file named by filename. Ignored if filename is NULL. |
Definition at line 40 of file SDDS_copy.c.
|
extern |
Initializes the SDDS dataset for headerless input.
This function initializes the SDDS dataset structure for reading data from a file without a header.
SDDS_dataset | A pointer to the SDDS_DATASET structure to be initialized. |
filename | The name of the file to read data from. |
Definition at line 175 of file SDDS_input.c.
|
extern |
Initializes a SDDS_DATASET structure for use in reading data from a SDDS file. This involves opening the file and reading the SDDS header.
SDDS_dataset | Address of the SDDS_DATASET structure for the data set. |
filename | A NULL-terminated character string giving the name of the file to set up for input. |
Definition at line 49 of file SDDS_input.c.
|
extern |
Initializes the SDDS_DATASET structure for input from the search path.
The search path is defined by calling setSearchPath
. This function attempts to find the file in the search path and initializes the SDDS dataset for input.
SDDSin | The SDDS_DATASET structure to be initialized. |
file | The name of the file to be opened for input. |
Definition at line 1786 of file SDDS_input.c.
|
extern |
Initializes the SDDS output dataset.
This function sets up the SDDS dataset for output operations by initializing the necessary structures, configuring the data mode (ASCII, Binary, or Parallel), handling file opening (including compressed files), and setting dataset metadata such as description and contents. It ensures that the dataset is ready for writing data according to the specified parameters.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure to be initialized for output. |
[in] | data_mode | The data mode for the output dataset. Acceptable values are:
|
[in] | lines_per_row | The number of lines per row in the output dataset. This parameter is used only for ASCII output and is typically set to 1. |
[in] | description | A string containing the description of the output dataset. Pass NULL if no description is desired. |
[in] | contents | A string detailing the contents of the output dataset. Pass NULL if no contents are desired. |
[in] | filename | The name of the file to which the dataset will be written. If NULL , the dataset will be written to standard output. |
1
on successful initialization.0
if an error occurred during initialization. In this case, an error message is set internally.SDDS_dataset
pointer must be valid and point to a properly allocated SDDS_DATASET structure.SDDS_OUTPUT_ENDIANESS
can be set to "big" or "little" to declare the byte order.lines_per_row
is set appropriately to match the data structure.Definition at line 595 of file SDDS_output.c.
|
extern |
Interprets and converts escape sequences in a string.
This function processes a string containing escape sequences and converts them into their corresponding character representations. Supported escape sequences include:
\n
, \t
, \b
, \r
, \f
, \v
, \\
, \', \"
, \a
, \?
\ddd
\!
, \)
The function modifies the input string s
in place, replacing escape sequences with their actual character values.
[in,out] | s | Pointer to the null-terminated string to be processed. The string will be modified in place. |
s
has sufficient buffer space to accommodate the modified characters, especially when dealing with octal escape sequences that may reduce the overall string length.Definition at line 5082 of file SDDS_utils.c.
|
extern |
Checks whether an SDDS dataset is currently active.
This function determines the active status of the provided SDDS dataset by verifying if its file pointer is non-NULL
.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure to be checked. |
1
if the dataset is active (i.e., the file pointer is non-NULL
).0
if the dataset is inactive (i.e., the file pointer is NULL
).-1
if a NULL
pointer is passed, indicating an error.Definition at line 3250 of file SDDS_utils.c.
|
extern |
Determines whether the current machine uses big-endian byte ordering.
This function checks the byte order of the machine on which the program is running. It returns 1
if the machine is big-endian and 0
if it is little-endian.
1
if the machine is big-endian.0
if the machine is little-endian.int32_t
is 4 bytes in size. If compiled on a system where int32_t
differs in size, the behavior may be incorrect.Definition at line 5283 of file SDDS_utils.c.
|
extern |
Checks if a position in a string is within a quoted section.
Determines whether the specified position within a string falls inside a quoted section delimited by the given quotation mark.
string | The string to examine. |
position | The position within the string to check. |
quotation_mark | The character used as the quotation mark. |
Definition at line 217 of file SDDS_input.c.
|
extern |
Checks if a given name is valid for a specified class within the SDDS dataset.
This function validates whether the provided name adheres to the naming conventions and rules defined by the current name validity flags for the specified class (e.g., parameter, column). It ensures that the name contains only allowed characters and follows the required structure.
[in] | name | The name to be validated. Must be a NULL-terminated string. |
[in] | class | The class type to which the name belongs (e.g., "parameter", "column"). This is used primarily for error reporting. |
1
if the name is valid for the specified class.0
if the name is invalid, with an error message set internally.SDDS_SetNameValidityFlags
.Definition at line 2080 of file SDDS_output.c.
|
extern |
Checks whether a data item is within a specified numeric window.
This function determines if the data item at the given index within the data array falls within the range defined by lower_limit
and upper_limit
. It handles various numeric data types and ensures that the value is neither NaN nor infinity.
data | Pointer to the data array. |
index | The index of the item within the data array to be checked. |
type | The data type of the item. Supported types include:
|
lower_limit | The lower bound of the numeric window. |
upper_limit | The upper bound of the numeric window. |
1
if the item is within the window and valid, otherwise returns 0
.1 | Indicates that the item is within the specified numeric window and is a valid number. |
0 | Indicates that the item is outside the specified window, is NaN, is infinite, or the data type is non-numeric. |
data
array is properly initialized and contains valid data before calling this function.Definition at line 4077 of file SDDS_extract.c.
|
extern |
Increases the number of allocated rows in the SDDS dataset's data table.
This function extends the allocated memory for the data table in the specified SDDS dataset by adding the specified number of additional rows. It reallocates memory for each column's data array and the row flags, initializing the newly allocated memory to zero.
SDDS_dataset | Pointer to the SDDS_DATASET structure whose table will be lengthened. |
n_additional_rows | The number of additional rows to allocate. If n_additional_rows is less than zero, it is treated as zero. |
Definition at line 297 of file SDDS_dataprep.c.
|
extern |
Attempts to lock a specified file.
This function tries to acquire a lock on the provided file using the given file pointer. If file locking is enabled via the F_TEST
and ALLOW_FILE_LOCKING
macros, it first tests whether the file can be locked and then attempts to establish an exclusive lock. If locking fails at any step, an error message is set, and the function returns 0
.
If file locking is not enabled, the function assumes that the file is not locked and returns 1
.
[in] | fp | Pointer to the open FILE stream associated with the file to be locked. |
[in] | filename | The path to the file to be locked. Used primarily for error messaging. |
[in] | caller | A string identifying the caller or the context in which the lock is being attempted. This is used in error messages to provide more information about the lock attempt. |
1
if the file lock is successfully acquired or if file locking is not enabled.0
if the file is already locked or if locking fails for another reason.lockf
system call for file locking, which may not be supported on all platforms.Definition at line 3326 of file SDDS_utils.c.
|
extern |
Applies logical operations to determine the new state of a row flag based on previous and current match conditions.
This function evaluates logical conditions between a previous flag (previous
) and a current match flag (match
) based on the provided logic
flags. It supports various logical operations such as AND, OR, negation of previous flags, and negation of match results.
previous | The previous state of the row flag (typically 0 or 1 ). |
match | The current match result to be combined with the previous flag. |
logic | An unsigned integer representing logical operation flags. Supported flags include:
|
0
or 1
).1 | Indicates that the final logical condition evaluates to true. |
0 | Indicates that the final logical condition evaluates to false. |
Definition at line 4165 of file SDDS_extract.c.
|
extern |
Creates a multi-dimensional pointer array from a contiguous data block.
This function generates a multi-dimensional pointer array that maps to a contiguous block of data. It supports arrays with multiple dimensions by recursively creating pointer layers. The dimensions
parameter specifies the number of dimensions, and the dimension
array provides the size for each dimension.
[in] | data | Pointer to the contiguous data block to be mapped. |
[in] | type | The SDDS data type of the elements in the data block. Must be one of the SDDS type constants:
|
[in] | dimensions | The number of dimensions for the pointer array. |
[in] | dimension | An array specifying the size of each dimension. |
NULL
if the input data is NULL
, the dimension
array is invalid, the type
is unknown, or memory allocation fails.SDDS_MakePointerArrayRecursively
to handle multi-dimensional allocations.SDDS_FreePointerArray
.Definition at line 2971 of file SDDS_utils.c.
|
extern |
Allocates memory of a specified size.
This function is a wrapper around the standard malloc
function, used by SDDS routines to allocate memory. It ensures that a minimum allocation size is enforced.
[in] | size | Number of bytes to allocate. |
size
is less than or equal to zero, it allocates memory for 4 bytes by default. Returns NULL
if memory allocation fails.NULL
before using it.Definition at line 639 of file SDDS_utils.c.
|
extern |
Matches and retrieves array names from an SDDS dataset based on specified criteria.
This function selects arrays from the provided SDDS dataset according to the specified matching mode and type mode. It supports various calling conventions depending on the matching criteria.
The function supports the following matching modes:
int32_t n_entries
, char **name
char *names
char *name1, char *name2, ..., NULL
NULL
pointer.char *name
, int32_t logic_mode
name
, using the specified logical mode.char *name
, char *exclude
, int32_t logic_mode
name
, excluding those that match the exclude
pattern, using the specified logical mode.Additionally, the typeMode
parameter allows filtering based on array types, such as numeric, floating, or integer types.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure containing the dataset. |
[out] | nameReturn | Pointer to a char** that will be allocated and populated with the names of the matched arrays. The caller is responsible for freeing the allocated memory. |
[in] | matchMode | Specifies the matching mode (e.g., SDDS_NAME_ARRAY , SDDS_NAMES_STRING , etc.). |
[in] | typeMode | Specifies the type matching mode (e.g., FIND_SPECIFIED_TYPE , FIND_NUMERIC_TYPE , FIND_FLOATING_TYPE , FIND_INTEGER_TYPE ). |
[in] | ... | Variable arguments depending on matchMode :
|
-1
if an error occurs (e.g., invalid parameters, memory allocation failure).nameReturn
, which must be freed by the caller using appropriate memory deallocation functions.matchMode
.nameReturn
to avoid memory leaks.Definition at line 4040 of file SDDS_utils.c.
|
extern |
Matches and retrieves column names from an SDDS dataset based on specified criteria.
This function selects columns from the provided SDDS dataset according to the specified matching mode and type mode. It supports various calling conventions depending on the matching criteria.
The function supports the following matching modes:
int32_t n_entries
, char **name
char *names
char *name1, char *name2, ..., NULL
NULL
pointer.char *name
, int32_t logic_mode
name
, using the specified logical mode.char *name
, char *exclude
, int32_t logic_mode
name
, excluding those that match the exclude
pattern, using the specified logical mode.Additionally, the typeMode
parameter allows filtering based on column types, such as numeric, floating, or integer types.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure containing the dataset. |
[out] | nameReturn | Pointer to a char** that will be allocated and populated with the names of the matched columns. The caller is responsible for freeing the allocated memory. |
[in] | matchMode | Specifies the matching mode (e.g., SDDS_NAME_ARRAY , SDDS_NAMES_STRING , etc.). |
[in] | typeMode | Specifies the type matching mode (e.g., FIND_SPECIFIED_TYPE , FIND_NUMERIC_TYPE , FIND_FLOATING_TYPE , FIND_INTEGER_TYPE ). |
[in] | ... | Variable arguments depending on matchMode :
|
-1
if an error occurs (e.g., invalid parameters, memory allocation failure).nameReturn
, which must be freed by the caller using appropriate memory deallocation functions.matchMode
.nameReturn
to avoid memory leaks.Definition at line 3484 of file SDDS_utils.c.
|
extern |
Matches and retrieves parameter names from an SDDS dataset based on specified criteria.
This function selects parameters from the provided SDDS dataset according to the specified matching mode and type mode. It supports various calling conventions depending on the matching criteria.
The function supports the following matching modes:
int32_t n_entries
, char **name
char *names
char *name1, char *name2, ..., NULL
NULL
pointer.char *name
, int32_t logic_mode
name
, using the specified logical mode.char *name
, char *exclude
, int32_t logic_mode
name
, excluding those that match the exclude
pattern, using the specified logical mode.Additionally, the typeMode
parameter allows filtering based on parameter types, such as numeric, floating, or integer types.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure containing the dataset. |
[out] | nameReturn | Pointer to a char** that will be allocated and populated with the names of the matched parameters. The caller is responsible for freeing the allocated memory. |
[in] | matchMode | Specifies the matching mode (e.g., SDDS_NAME_ARRAY , SDDS_NAMES_STRING , etc.). |
[in] | typeMode | Specifies the type matching mode (e.g., FIND_SPECIFIED_TYPE , FIND_NUMERIC_TYPE , FIND_FLOATING_TYPE , FIND_INTEGER_TYPE ). |
[in] | ... | Variable arguments depending on matchMode :
|
-1
if an error occurs (e.g., invalid parameters, memory allocation failure).nameReturn
, which must be freed by the caller using appropriate memory deallocation functions.matchMode
.nameReturn
to avoid memory leaks.Definition at line 3762 of file SDDS_utils.c.
|
extern |
Matches and marks rows of interest in an SDDS dataset based on label matching.
This function marks rows in the provided SDDS dataset as "of interest" by matching labels in a specified column against a target label. It supports both direct and indirect matching, as well as case-sensitive and case-insensitive comparisons, based on the provided logic flags.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
selection_column | A null-terminated string specifying the name of the column used for label matching. This column must be of string or character type. |
label_to_match | A null-terminated string specifying the label to match against the entries in the selection column. If logic includes SDDS_INDIRECT_MATCH , this parameter is treated as the name of another column used for indirect matching. |
logic | An integer representing logical operation flags. Supported flags include:
|
-1
and sets an appropriate error message.-1 | Indicates that an error occurred (e.g., invalid dataset, unrecognized selection column, type mismatch, unrecognized indirect column). |
Non-negative | Integer representing the count of rows marked as "of interest". |
SDDS_INDIRECT_MATCH
), the indirect column must exist and be of the same type as the selection column.Definition at line 3506 of file SDDS_extract.c.
|
extern |
Retrieves the number of errors recorded by SDDS library routines.
This function returns the total number of errors that have been recorded by the SDDS library since the last invocation of SDDS_PrintErrors
.
Definition at line 304 of file SDDS_utils.c.
|
extern |
Pads a string with spaces to reach a specified length.
This function appends space characters to the end of the input string string
until it reaches the desired length
. If the original string is longer than the specified length
, the function returns an error without modifying the string.
[in,out] | string | Pointer to the null-terminated string to be padded. |
[in] | length | The target length for the string after padding. |
1
on successful padding. Returns 0
if the input string is NULL
or if the original string length exceeds the specified length
.string
has sufficient space to accommodate the additional padding.Definition at line 1879 of file SDDS_utils.c.
|
extern |
Initializes the SDDS output dataset for parallel processing.
This function configures the SDDS dataset for parallel output operations. It sets the dataset's description, contents, and filename, ensuring that the output is in binary mode as parallel processing with compressed files is not supported. The function initializes necessary structures and prepares the dataset for efficient parallel data writing.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure to be initialized for parallel output. |
[in] | description | A string containing the description of the dataset. Pass NULL if no description is desired. |
[in] | contents | A string detailing the contents of the dataset. Pass NULL if no contents are desired. |
[in] | filename | The name of the file to which the dataset will be written. If NULL , the dataset will be written to standard output. |
1
on successful initialization.0
if an error occurred during initialization. In this case, an error message is set internally.SDDS_dataset
pointer must be valid and point to a properly allocated SDDS_DATASET structure.SDDS_OUTPUT_ENDIANESS
can be set to "big" or "little" to declare the byte order.Definition at line 748 of file SDDS_output.c.
|
extern |
Retrieves the number of parameters in the SDDS dataset.
This function returns the total count of parameters defined in the layout of the provided SDDS dataset.
[in] | page | Pointer to the SDDS_DATASET structure representing the dataset. |
int32_t
) in the dataset.0
if the provided dataset pointer is NULL
.Definition at line 5030 of file SDDS_utils.c.
|
extern |
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.
|
extern |
Prints detailed error messages related to SDDS entity checks.
This function outputs error messages to the specified file pointer based on the provided error code. It is primarily used by functions like SDDS_CheckColumn
, SDDS_CheckParameter
, and SDDS_CheckArray
to report issues during validation checks.
[in] | fp | File pointer where the error messages will be printed. Typically, this is stderr . |
[in] | name | The name of the SDDS entity (e.g., column, parameter, array) being checked. |
[in] | units | The expected units of the SDDS entity. May be NULL if units are not relevant. |
[in] | type | The expected type code of the SDDS entity. This can be a specific type or a general category like SDDS_ANY_NUMERIC_TYPE . |
[in] | class_name | A string representing the class of the SDDS entity (e.g., "column", "parameter", "array"). |
[in] | error_code | The specific error code indicating the type of error encountered. Valid values include:
|
error_code
that was passed as an argument.registeredProgramName
is a globally accessible string containing the name of the program for contextual error messages.fp
, name
, and class_name
are not NULL
to prevent undefined behavior.error_code
values that are not handled in the switch statement will result in a generic error message being printed to stderr
.Definition at line 4830 of file SDDS_utils.c.
|
extern |
Prints recorded error messages to a specified file stream.
This function outputs the errors that have been recorded by SDDS library routines to the given file stream. Depending on the mode
parameter, it can print a single error, all recorded errors, and optionally terminate the program after printing.
[in] | fp | Pointer to the FILE stream where errors will be printed. Typically stderr . |
[in] | mode | Flags controlling the error printing behavior:
|
mode
includes SDDS_EXIT_PrintErrors
, the program will terminate.Definition at line 432 of file SDDS_utils.c.
|
extern |
Prints a data value of a specified type using an optional printf format string.
This function prints a single data value from a data array based on the specified type and index. It supports various data types defined by SDDS constants and allows customization of the output format.
[in] | data | Pointer to the base address of the data array to be printed. |
[in] | index | The index of the item within the data array to be printed. |
[in] | type | The data type of the value to be printed, specified by one of the SDDS constants:
|
[in] | format | (Optional) NULL-terminated string specifying a printf format. If NULL , a default format is used based on the data type. |
[in] | fp | Pointer to the FILE stream where the data will be printed. |
[in] | mode | Flags controlling the printing behavior. Valid values are:
|
1
on success. On failure, returns 0
and records an error message.data
pointer points to an array of the specified type
, and index
is within the bounds of this array.Definition at line 59 of file SDDS_utils.c.
|
extern |
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.
|
extern |
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.
|
extern |
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.
|
extern |
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.
|
extern |
Reads the next SDDS ASCII page into memory with optional data sparsity and statistics.
This function reads the next page of data from an ASCII SDDS file into the provided dataset. It supports reading data with specified sparsity (interval and offset) and can compute statistics such as average, median, minimum, or maximum over the sparse data.
SDDS_dataset | Pointer to the SDDS dataset where the data will be stored. |
sparse_interval | Interval for sparsity; read every nth row if greater than 1. |
sparse_offset | Offset for sparsity; number of initial rows to skip. |
sparse_statistics | Statistic to compute over the sparse data:
|
SDDS_ReadAsciiPageDetailed()
to perform the actual reading. Definition at line 1225 of file SDDS_ascii.c.
|
extern |
Reads the header layout of an SDDS dataset from a file.
SDDS_dataset | The SDDS dataset structure to store the layout information. |
fp | The file pointer to the SDDS file. |
Definition at line 517 of file SDDS_input.c.
|
extern |
Reads new binary rows from the SDDS dataset.
This function updates the SDDS dataset by reading any new rows that have been added to the underlying file since the last read operation. It verifies that the dataset is in a compatible binary format and ensures that byte order and compression settings are supported. If the number of rows in the file exceeds the currently allocated rows in memory, the function expands the dataset's internal storage to accommodate the new rows.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to read from. |
>0 | The number of new rows read and added to the dataset. |
-1 | An error occurred during the read operation, such as unsupported file format, I/O errors, or memory allocation failures. |
Definition at line 2841 of file SDDS_binary.c.
int32_t SDDS_ReadNonNativeBinaryArrays | ( | SDDS_DATASET * | SDDS_dataset | ) |
Reads non-native endian binary arrays from an SDDS dataset.
This function iterates through all array definitions in the specified SDDS dataset and reads their binary data from the underlying file. It handles various data types, including short, unsigned short, long, unsigned long, long long, unsigned long long, float, double, and long double. For string arrays, it reads each string individually, ensuring proper memory allocation and byte order conversion. The function supports different compression formats, including uncompressed, LZMA-compressed, and GZIP-compressed files. After reading, it swaps the endianness of the array data to match the system's native byte order.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to read from. |
1 | All non-native endian arrays were successfully read and byte-swapped. |
0 | An error occurred during the read or byte-swapping process, such as I/O failures, memory allocation issues, or corrupted array definitions. |
Definition at line 4458 of file SDDS_binary.c.
int32_t SDDS_ReadNonNativeBinaryPage | ( | SDDS_DATASET * | SDDS_dataset, |
int64_t | sparse_interval, | ||
int64_t | sparse_offset ) |
Reads a non-native endian binary page from an SDDS dataset.
This function reads a binary page from the specified SDDS dataset, handling data with non-native endianness. It performs necessary byte order conversions to ensure correct data interpretation on the host system. The function supports sparse reading based on the provided interval and offset.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to read from. |
[in] | sparse_interval | Interval between rows to be read for sparsity. |
[in] | sparse_offset | Offset to start reading rows for sparsity. |
>0 | Number of rows successfully read. |
0 | An error occurred during the read operation, such as I/O failures, data corruption, or unsupported data modes. |
Definition at line 4063 of file SDDS_binary.c.
int32_t SDDS_ReadNonNativeBinaryParameters | ( | SDDS_DATASET * | SDDS_dataset | ) |
Reads non-native endian binary parameters from an SDDS dataset.
This function iterates through all parameter definitions in the specified SDDS dataset and reads their binary data from the underlying file. It handles various data types, including short, unsigned short, long, unsigned long, long long, unsigned long long, float, double, and long double. For string parameters, it reads each string individually, ensuring proper memory allocation and byte order conversion. Parameters with fixed values are processed by scanning the fixed value strings into the appropriate data types. The function supports different compression formats, including uncompressed, LZMA-compressed, and GZIP-compressed files.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to read from. |
1 | All non-native endian parameters were successfully read and byte-swapped. |
0 | An error occurred during the read or byte-swapping process, such as I/O failures, memory allocation issues, or corrupted parameter definitions. |
Definition at line 4342 of file SDDS_binary.c.
int32_t SDDS_ReadNonNativeBinaryRow | ( | SDDS_DATASET * | SDDS_dataset, |
int64_t | row, | ||
int32_t | skip ) |
Reads a non-native endian binary row from an SDDS dataset.
This function reads a single row of data from the specified SDDS dataset, handling data with non-native endianness. It iterates through all column definitions and reads each column's data for the given row. For string columns, it ensures proper memory allocation and byte order conversion. For other data types, it reads the binary data and performs necessary byte swapping. The function supports different compression formats, including uncompressed, LZMA-compressed, and GZIP-compressed files.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to read from. |
[in] | row | The index of the row to read. |
[in] | skip | If non-zero, the function will skip reading the row data, useful for sparse reading. |
1 | The row was successfully read and byte-swapped. |
0 | An error occurred during the read or byte-swapping process, such as I/O failures or corrupted data. |
Definition at line 4628 of file SDDS_binary.c.
char * SDDS_ReadNonNativeBinaryString | ( | FILE * | fp, |
SDDS_FILEBUFFER * | fBuffer, | ||
int32_t | skip ) |
Reads a non-native endian binary string from a file.
This function reads a binary string from the specified file pointer, handling non-native endianness. It first reads the length of the string, swaps its byte order if necessary, allocates memory for the string, reads the string data, and null-terminates it.
[in] | fp | Pointer to the FILE from which to read the string. |
[in,out] | fBuffer | Pointer to the SDDS_FILEBUFFER structure used for buffered reading. |
[in] | skip | If non-zero, the function will skip reading the string data, useful for sparse reading. |
Non-NULL | Pointer to the newly allocated string. |
NULL | An error occurred during reading or memory allocation. |
Definition at line 4751 of file SDDS_binary.c.
|
extern |
Reads a non-native endian page from an SDDS dataset.
This function reads a page of data from the specified SDDS dataset, handling data with non-native endianness. It supports both ASCII and binary data modes, performing necessary byte order conversions to ensure correct data interpretation on the host system.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to read from. |
>0 | Number of rows successfully read. |
0 | An error occurred during the read operation, such as I/O failures, data corruption, or unsupported data modes. |
Definition at line 3884 of file SDDS_binary.c.
int32_t SDDS_ReadNonNativePageSparse | ( | SDDS_DATASET * | SDDS_dataset, |
uint32_t | mode, | ||
int64_t | sparse_interval, | ||
int64_t | sparse_offset ) |
Reads a sparse non-native endian page from an SDDS dataset.
This function reads a sparse page of data from the specified SDDS dataset, handling data with non-native endianness. Sparse reading allows for selective row retrieval based on the provided interval and offset.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to read from. |
[in] | mode | Mode flag to support future expansion. |
[in] | sparse_interval | Interval between rows to be read for sparsity. |
[in] | sparse_offset | Offset to start reading rows for sparsity. |
>0 | Number of rows successfully read. |
0 | An error occurred during the read operation, such as I/O failures, data corruption, or unsupported data modes. |
Definition at line 3906 of file SDDS_binary.c.
|
extern |
Reads a page of an SDDS file. Usually called after SDDS_InitializeInput.
SDDS_dataset | Address of the SDDS_DATASET structure for the data set. |
Definition at line 1006 of file SDDS_input.c.
|
extern |
Reads the last specified number of rows from the SDDS dataset.
SDDS_dataset | The pointer to the SDDS dataset structure. |
last_rows | The number of rows to read from the end of the dataset. |
Definition at line 1156 of file SDDS_input.c.
|
extern |
Reads a sparsed page of an SDDS file. Usually called after SDDS_InitializeInput.
SDDS_dataset | A pointer to an SDDS dataset. |
mode | Not used. |
sparse_interval | The column data can be sparsified over row intervals if this is greater than 1. |
sparse_offset | This is used to skip the initial rows of the column data. |
sparse_statistics | Not used. |
Definition at line 1082 of file SDDS_input.c.
|
extern |
Checks if any data in an SDDS page was recovered after an error was detected.
This function inspects the SDDS dataset to determine if any data recovery was possible following an error during data reading. It resets the recovery flag after checking.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
1
if recovery was possible.0
if no recovery was performed or if recovery was not possible.The function performs the following steps:
readRecoveryPossible
flag from the dataset.readRecoveryPossible
flag to 0
.readRecoveryPossible
flag.Definition at line 2054 of file SDDS_binary.c.
|
extern |
Reallocates memory to a new size.
This function extends the standard realloc
functionality by zero-initializing any newly allocated memory beyond the original size. It ensures that memory is consistently reallocated and initialized across different build configurations.
[in] | old_ptr | Pointer to the original memory block. If NULL , the function behaves like SDDS_Malloc . |
[in] | new_size | New size in bytes for the memory block. |
new_size
is less than or equal to zero, a minimum of 4 bytes is allocated. Returns NULL
if memory reallocation fails.Definition at line 677 of file SDDS_utils.c.
|
extern |
Reconnects the SDDS dataset to its previously associated file.
This function re-establishes the connection between the SDDS dataset and the file it was previously linked to before being disconnected. It opens the file in read/write mode, seeks to the appropriate position, and updates the dataset's internal state to reflect that it is connected.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure to be reconnected. |
1
on successful reconnection.0
if an error occurred during reconnection. In this case, an error message is set internally.Definition at line 126 of file SDDS_output.c.
|
extern |
Reconnects the input file for the SDDS dataset at a specified position.
This function re-establishes the connection between the SDDS dataset and its input file, positioning the file pointer at the specified byte offset. This allows the dataset to resume reading from a specific location within the input file.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure to reconnect. |
[in] | position | The byte offset position in the input file where reconnection should occur. |
1
on successful reconnection.0
on failure. In this case, an internal error message is set.Definition at line 229 of file SDDS_output.c.
|
extern |
Registers the executable program name for use in error messages.
This function stores the name of the executing program, which is included in various error and warning messages generated by the SDDS library routines.
[in] | name | The name of the program. If NULL , the registered program name is cleared. |
Definition at line 288 of file SDDS_utils.c.
|
extern |
Removes leading and trailing whitespace from a string.
This function trims all leading and trailing whitespace characters from the input string s
. It modifies the string in place, ensuring that any padding spaces are removed while preserving the internal content.
[in,out] | s | Pointer to the null-terminated string to be trimmed. The string will be modified in place. |
isspace
function. If the string consists entirely of whitespace, the function will result in an empty string.Definition at line 2379 of file SDDS_utils.c.
|
extern |
Restores a previously saved layout of the SDDS_DATASET.
SDDS_dataset | Pointer to the SDDS_DATASET structure whose layout is to be restored. |
Definition at line 697 of file SDDS_copy.c.
|
extern |
Saves the current layout of the SDDS_DATASET. The layout is stored internally for future restoration if needed.
SDDS_dataset | Pointer to the SDDS_DATASET structure whose layout is to be saved. |
Definition at line 615 of file SDDS_copy.c.
|
extern |
Scans a string and saves the parsed value into a data pointer according to the specified data type.
This function extracts data from a string and stores it in the provided data pointer. It handles various SDDS data types, including integers, floating-point numbers, strings, and characters. The function supports both fixed-field and variable-field formats and can process parameters and column data.
string | Pointer to the input string containing the data to be scanned. |
type | The SDDS data type to interpret the scanned data as. Valid types include:
|
field_length | Field length for fixed-field formats. Set to 0 for variable-field formats. If negative, indicates left-padding should be removed. |
data | Void pointer to the data storage where the scanned value will be saved. Must be pre-allocated and appropriate for the specified data type. |
index | The index within the data array where the value should be stored. |
is_parameter | Set to 1 if the data is from an SDDS parameter; set to 0 for column data. |
SDDS_SetError()
.SDDS_InterpretEscapes()
. For string data types, the function manages memory allocation for the data array elements. Definition at line 1748 of file SDDS_ascii.c.
|
extern |
Scans a string and saves the parsed value into a data pointer, optimized for long strings.
This function is similar to SDDS_ScanData
but optimized for very long strings. It modifies the input string by advancing the string pointer and reducing its length after each call, which can improve performance when processing large amounts of data.
string | Pointer to the input string containing the data to be scanned. |
pstring | Pointer to the string pointer; this is updated to point to the next unread character. |
strlength | Pointer to the length of the string; this is updated as the string is consumed. |
type | The SDDS data type to interpret the scanned data as. Valid types include:
|
field_length | Field length for fixed-field formats. Set to 0 for variable-field formats. If negative, indicates left-padding should be removed. |
data | Void pointer to the data storage where the scanned value will be saved. Must be pre-allocated and appropriate for the specified data type. |
index | The index within the data array where the value should be stored. |
is_parameter | Set to 1 if the data is from an SDDS parameter; set to 0 for column data. |
SDDS_SetError()
.SDDS_ScanData
. Definition at line 1953 of file SDDS_ascii.c.
|
extern |
Sets the values of an array variable in the SDDS dataset using specified dimensions.
This function assigns data to a specified array within the current SDDS dataset. The dimensions of the array are provided as an array of integers, allowing for the assignment of multi-dimensional arrays. The mode
parameter controls how the data is interpreted and stored. This function handles both pointer arrays and contiguous data.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
array_name | The name of the array to set within the dataset. |
mode | Bitwise flags that determine how the array is set. Valid flags include:
|
data_pointer | Pointer to the data to be assigned to the array. The data must match the type defined for the array. |
dimension | Pointer to an array of integers specifying the dimensions of the array. The number of dimensions should match the array definition. |
1
on successful assignment of the array data. On failure, returns 0
and records an appropriate error message.Definition at line 1278 of file SDDS_dataprep.c.
|
extern |
Sets unit conversions for a specified array in an SDDS dataset.
This function updates the units of the specified array within the SDDS dataset and applies a conversion factor to all its elements if the dataset has already been read (i.e., pages_read > 0
). The function ensures that the new units are consistent with the old units if provided.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
array_name | A null-terminated string specifying the name of the array to update. |
new_units | A null-terminated string specifying the new units to assign to the array. This parameter must not be NULL . |
old_units | A null-terminated string specifying the expected current units of the array. If NULL , the function does not verify the existing units. |
factor | A double representing the conversion factor to apply to each element of the array. Each element will be multiplied by this factor. |
1
on successful unit conversion and update. On failure, returns 0
and sets an appropriate error message.1 | Indicates that the unit conversion was successfully applied. |
0 | Indicates that an error occurred (e.g., invalid dataset, unrecognized array name, type undefined, memory allocation failure). |
new_units
parameter must not be NULL
. Passing NULL
will result in an error.pages_read == 0
), the conversion factor is stored but not applied immediately.Definition at line 4675 of file SDDS_extract.c.
|
extern |
Sets the values of an array variable in the SDDS dataset using variable arguments for dimensions.
This function assigns data to a specified array within the current SDDS dataset. The dimensions of the array are provided as variable arguments, allowing for flexible assignment of multi-dimensional arrays. The mode
parameter controls how the data is interpreted and stored. This function handles both pointer arrays and contiguous data.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
array_name | The name of the array to set within the dataset. |
mode | Bitwise flags that determine how the array is set. Valid flags include:
|
data_pointer | Pointer to the data to be assigned to the array. The data must match the type defined for the array. |
... | Variable arguments specifying the dimensions of the array. The number of dimensions should match the array definition. |
1
on successful assignment of the array data. On failure, returns 0
and records an appropriate error message.Definition at line 1157 of file SDDS_dataprep.c.
epicsShareFuncSDDS uint32_t SDDS_SetAutoCheckMode | ( | uint32_t | newMode | ) |
Sets the automatic check mode for SDDS dataset validation.
This function updates the auto-check mode, which controls the automatic validation of SDDS datasets during operations. The previous mode is returned.
[in] | newMode | The new auto-check mode to be set. It should be a bitwise combination of the following constants:
|
Definition at line 533 of file SDDS_utils.c.
|
extern |
Sets the auto-read recovery mode for the SDDS dataset.
SDDS_dataset | The SDDS dataset to modify. |
mode | The mode to set (SDDS_AUTOREADRECOVER or SDDS_NOAUTOREADRECOVER). |
Definition at line 1762 of file SDDS_input.c.
|
extern |
Sets the values for one data column in the current data table of an SDDS dataset.
This function assigns data to a specified column within the current data table of the given SDDS dataset. The column can be identified either by its index or by its name. The mode
parameter determines how the column is identified. The function ensures that the number of rows in the new column matches the existing data table.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
mode | Bitwise flags that determine how the column is identified. Valid flags include:
|
data | Pointer to an array of data to be assigned to the column. The elements of the array must be of the same type as the column type. |
rows | The number of rows in the column. This should match the number of rows in the existing data table. |
... | Variable arguments specifying either the column index or column name, depending on the mode parameter:
|
1
on successful assignment of the column data. On failure, returns 0
and records an appropriate error message.SDDS_STRING
, it handles memory allocation and copying of strings appropriately.Definition at line 1536 of file SDDS_dataprep.c.
|
extern |
Sets the acceptance flags for all columns in the current data table of a data set.
This function initializes the acceptance flags for each column. A non-zero flag indicates that the column is "of interest" and should be considered in subsequent operations, while a zero flag marks the column for rejection.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
column_flag_value | Integer value to assign to all column flags.
|
column_flag_value
. It also updates the column_order
array accordingly.Definition at line 218 of file SDDS_extract.c.
|
extern |
Sets the values for a single data column using double-precision floating-point numbers.
This function assigns data to a specified column within the current data table of the given SDDS dataset. The column can be identified either by its index or by its name, based on the provided mode
. The data provided must be in the form of double-precision floating-point numbers (double
). If the target column is of a different numeric type, the function will perform the necessary type casting. For string columns, the function converts the double values to strings with appropriate formatting.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
mode | Bitwise flags that determine how the column is identified. Valid flags include:
|
Mode Requirements:
SDDS_SET_BY_INDEX
or SDDS_SET_BY_NAME
must be set.Syntax Based on Mode Combination:
SDDS_SET_BY_INDEX
: int32_t SDDS_SetColumnFromDoubles(SDDS_DATASET *SDDS_dataset, int32_t mode, double *data, int64_t rows, int32_t index)
SDDS_SET_BY_NAME
: int32_t SDDS_SetColumnFromDoubles(SDDS_DATASET *SDDS_dataset, int32_t mode, double *data, int64_t rows, char *name)
data | Pointer to an array of double-precision floating-point data to be assigned to the column. The array should contain at least rows elements. |
rows | The number of rows (elements) in the column to be set. Must not exceed the allocated memory for the dataset. |
... | Variable arguments specifying either the column index (int32_t ) or column name (char * ), depending on the mode . |
1
on successful assignment of the column data. On failure, returns 0
and records an appropriate error message using SDDS_SetError
.SDDS_STRING
, the function converts each double value to a string with a precision of up to 15 significant digits.SDDS_StartPage
before setting column values.Definition at line 1642 of file SDDS_dataprep.c.
|
extern |
Sets the values for a single data column using single-precision floating-point numbers.
This function assigns data to a specified column within the current data table of the given SDDS dataset. The column can be identified either by its index or by its name, based on the provided mode
. The data provided must be in the form of single-precision floating-point numbers (float
). If the target column is of a different numeric type, the function will perform the necessary type casting. For string columns, the function converts the float values to strings with appropriate formatting.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
mode | Bitwise flags that determine how the column is identified. Valid flags include:
|
Mode Requirements:
SDDS_SET_BY_INDEX
or SDDS_SET_BY_NAME
must be set.Syntax Based on Mode Combination:
SDDS_SET_BY_INDEX
: int32_t SDDS_SetColumnFromFloats(SDDS_DATASET *SDDS_dataset, int32_t mode, float *data, int64_t rows, int32_t index)
SDDS_SET_BY_NAME
: int32_t SDDS_SetColumnFromFloats(SDDS_DATASET *SDDS_dataset, int32_t mode, float *data, int64_t rows, char *name)
data | Pointer to an array of single-precision floating-point data to be assigned to the column. The array should contain at least rows elements. |
rows | The number of rows (elements) in the column to be set. Must not exceed the allocated memory for the dataset. |
... | Variable arguments specifying either the column index (int32_t ) or column name (char * ), depending on the mode . |
1
on successful assignment of the column data. On failure, returns 0
and records an appropriate error message using SDDS_SetError
.SDDS_STRING
, the function converts each float value to a string with a precision of up to 8 significant digits.SDDS_StartPage
before setting column values.Definition at line 1912 of file SDDS_dataprep.c.
|
extern |
Sets the values for a single data column using long integer numbers.
This function assigns data to a specified column within the current data table of the given SDDS dataset. The column can be identified either by its index or by its name, based on the provided mode
. The data provided must be in the form of long integers (int32_t
). If the target column is of a different numeric type, the function will perform the necessary type casting. For string columns, the function converts the integer values to strings with appropriate formatting.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
mode | Bitwise flags that determine how the column is identified. Valid flags include:
|
Mode Requirements:
SDDS_SET_BY_INDEX
or SDDS_SET_BY_NAME
must be set.Syntax Based on Mode Combination:
SDDS_SET_BY_INDEX
: int32_t SDDS_SetColumnFromLongs(SDDS_DATASET *SDDS_dataset, int32_t mode, int32_t *data, int64_t rows, int32_t index)
SDDS_SET_BY_NAME
: int32_t SDDS_SetColumnFromLongs(SDDS_DATASET *SDDS_dataset, int32_t mode, int32_t *data, int64_t rows, char *name)
data | Pointer to an array of long integer data to be assigned to the column. The array should contain at least rows elements. |
rows | The number of rows (elements) in the column to be set. Must not exceed the allocated memory for the dataset. |
... | Variable arguments specifying either the column index (int32_t ) or column name (char * ), depending on the mode . |
1
on successful assignment of the column data. On failure, returns 0
and records an appropriate error message using SDDS_SetError
.SDDS_STRING
, the function converts each long integer value to a string using the sprintf
function with the appropriate format specifier.SDDS_StartPage
before setting column values.Definition at line 2045 of file SDDS_dataprep.c.
|
extern |
Sets the column memory mode for the SDDS dataset.
SDDS_dataset | The SDDS dataset to operate on. |
mode | The column memory mode to set. |
Definition at line 1348 of file SDDS_input.c.
|
extern |
Sets the acceptance flags for columns based on specified naming criteria.
This function allows modifying column acceptance flags using various methods, including specifying column names directly or using pattern matching.
Supported modes:
NULL
.A non-zero flag indicates that a column is "of interest", while a zero flag marks it for rejection.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
mode | Operation mode determining how columns are selected. Possible values:
|
... | Variable arguments based on the selected mode:
|
SDDS_MATCH_STRING
, the pattern
may include wildcards to match multiple column names.Definition at line 432 of file SDDS_extract.c.
|
extern |
Sets unit conversions for a specified column in an SDDS dataset.
This function updates the units of the specified column within the SDDS dataset and applies a conversion factor to all its elements if the dataset has already been read (i.e., pages_read > 0
). The function ensures that the new units are consistent with the old units if provided.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
column_name | A null-terminated string specifying the name of the column to update. |
new_units | A null-terminated string specifying the new units to assign to the column. This parameter must not be NULL . |
old_units | A null-terminated string specifying the expected current units of the column. If NULL , the function does not verify the existing units. |
factor | A double representing the conversion factor to apply to each element of the column. Each element will be multiplied by this factor. |
1
on successful unit conversion and update. On failure, returns 0
and sets an appropriate error message.1 | Indicates that the unit conversion was successfully applied. |
0 | Indicates that an error occurred (e.g., invalid dataset, unrecognized column name, type undefined, memory allocation failure). |
new_units
parameter must not be NULL
. Passing NULL
will result in an error.pages_read == 0
), the conversion factor is stored but not applied immediately.Definition at line 4788 of file SDDS_extract.c.
|
extern |
Sets the data mode (ASCII or Binary) for the SDDS dataset.
This function configures the data mode of the SDDS dataset to either ASCII or Binary. When setting to Binary mode with byte swapping (using -SDDS_BINARY
), it adjusts the byte order based on the machine's endianness to ensure compatibility.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset whose data mode is to be set. |
[in] | newmode | The desired data mode. Valid values are:
|
1
on successful mode change.0
if the mode is invalid, if the dataset is NULL
, or if the dataset has already been written to and the mode cannot be changed.page_number
is 0
and n_rows_written
is 0
).-SDDS_BINARY
, the function automatically determines the appropriate byte order based on the machine's endianness.newmode
parameter is correctly specified to prevent unintended behavior.Definition at line 4932 of file SDDS_utils.c.
|
extern |
Sets the default I/O buffer size used for file operations.
This function updates the global defaultIOBufferSize
variable, which determines the size of the I/O buffer used for file read/write operations. The initial default is SDDS_FILEBUFFER_SIZE
, which is 262144 bytes.
newValue | The new default I/O buffer size in bytes. If newValue is negative, the function returns the current buffer size without changing it. If newValue is between 0 and 128 (inclusive), it is treated as 0, effectively disabling buffering. |
newValue
is greater than or equal to 0; otherwise, returns the current default buffer size without changing it. Definition at line 66 of file SDDS_binary.c.
|
extern |
Records an error message in the SDDS error stack.
This function appends an error message to the internal error stack. These errors can later be retrieved and displayed using SDDS_PrintErrors
.
[in] | error_text | The error message to be recorded. If NULL , a warning is printed to stderr . |
Definition at line 379 of file SDDS_utils.c.
|
extern |
Internal function to record an error message in the SDDS error stack.
This function appends an error message to the internal error stack without adding additional formatting or line breaks. It is typically called by SDDS_SetError
.
[in] | error_text | The error message to be recorded. If NULL , a warning is printed to stderr . |
Definition at line 395 of file SDDS_utils.c.
|
extern |
Initializes a memory block with a sequence of values based on a specified data type.
This function sets a block of memory to a sequence of values, starting from a specified initial value and incrementing by a defined delta. The sequence is determined by the data_type
parameter, which specifies the type of each element in the memory block. The function supports various SDDS data types and handles the initialization accordingly.
[in,out] | mem | Pointer to the memory block to be initialized. |
[in] | n_elements | The number of elements to initialize in the memory block. |
[in] | data_type | The SDDS data type of each element. Must be one of the following constants:
|
[in] | ... | Variable arguments specifying the starting value and increment value. The types of these arguments depend on the data_type :
|
1
on successful memory initialization. Returns 0
if an unknown or invalid data_type
is provided.data_type
parameter.Definition at line 2039 of file SDDS_utils.c.
|
extern |
Sets the validity flags for parameter and column names in the SDDS dataset.
This function allows the user to configure the rules for validating names of parameters and columns within the SDDS dataset. The validity flags determine the set of allowed characters and naming conventions.
[in] | flags | A bitmask representing the desired name validity flags. Possible flags include:
|
Definition at line 2043 of file SDDS_output.c.
|
extern |
Sets the flag to enable or disable row counts in the SDDS dataset.
This function configures the SDDS dataset to either include or exclude row counts in the output. Row counts provide metadata about the number of rows written, which can be useful for data integrity and validation. Disabling row counts can improve performance when such metadata is unnecessary.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure to be configured. |
[in] | value | The flag value to set:
|
1
on successful configuration.0
if an error occurred (e.g., attempting to change the flag after the layout has been written).SDDS_dataset
must be initialized and not have written the layout yet.Definition at line 847 of file SDDS_output.c.
|
extern |
Sets the value of a single parameter in the current data table of an SDDS dataset.
This function assigns a value to a specified parameter in the current data table of the given SDDS dataset. It must be preceded by a call to SDDS_StartPage
to initialize the table. The parameter to be set can be identified either by its index or by its name. The value can be passed either by value or by reference, depending on the specified mode.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
mode | A bitwise combination of the following constants:
|
Mode Requirements:
SDDS_SET_BY_INDEX
or SDDS_SET_BY_NAME
must be set.SDDS_PASS_BY_VALUE
or SDDS_PASS_BY_REFERENCE
must be set.Syntax Based on Mode Combination:
SDDS_SET_BY_INDEX
+ SDDS_PASS_BY_VALUE
: int32_t SDDS_SetParameter(SDDS_DATASET *SDDS_dataset, int32_t mode, int32_t index, value)
SDDS_SET_BY_INDEX
+ SDDS_PASS_BY_REFERENCE
: int32_t SDDS_SetParameter(SDDS_DATASET *SDDS_dataset, int32_t mode, int32_t index, void *data)
SDDS_SET_BY_NAME
+ SDDS_PASS_BY_VALUE
: int32_t SDDS_SetParameter(SDDS_DATASET *SDDS_dataset, int32_t mode, char *name, value)
SDDS_SET_BY_NAME
+ SDDS_PASS_BY_REFERENCE
: int32_t SDDS_SetParameter(SDDS_DATASET *SDDS_dataset, int32_t mode, char *name, void *data)
Note: For parameters of type SDDS_STRING
, passing by value means passing a char *
, whereas passing by reference means passing a char **
.
1
on successful assignment of the parameter value. On failure, returns 0
and records an appropriate error message.Definition at line 533 of file SDDS_dataprep.c.
|
extern |
Sets the values of one or more parameters for the current data table in an SDDS dataset.
This function assigns values to parameters in the current data table of the specified SDDS dataset. It must be preceded by a call to SDDS_StartPage
to initialize the table. The function can be called multiple times to set parameters for different tables, but SDDS_WriteTable
should be used to write each table to disk.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
mode | A bitwise combination of the following constants:
|
Exactly one of SDDS_SET_BY_INDEX
or SDDS_SET_BY_NAME
must be set to indicate how parameters are identified. Additionally, exactly one of SDDS_PASS_BY_VALUE
or SDDS_PASS_BY_REFERENCE
must be set to indicate how parameter values are provided.
The syntax for the four possible mode combinations is as follows:
SDDS_SET_BY_INDEX
+ SDDS_PASS_BY_VALUE
: int32_t SDDS_SetParameters(SDDS_DATASET *SDDS_dataset, int32_t mode, int32_t index1, value1, int32_t index2, value2, ..., -1)
SDDS_SET_BY_INDEX
+ SDDS_PASS_BY_REFERENCE
: int32_t SDDS_SetParameters(SDDS_DATASET *SDDS_dataset, int32_t mode, int32_t index1, void *data1, int32_t index2, void *data2, ..., -1)
SDDS_SET_BY_NAME
+ SDDS_PASS_BY_VALUE
: int32_t SDDS_SetParameters(SDDS_DATASET *SDDS_dataset, int32_t mode, char *name1, value1, char *name2, value2, ..., NULL)
SDDS_SET_BY_NAME
+ SDDS_PASS_BY_REFERENCE
: int32_t SDDS_SetParameters(SDDS_DATASET *SDDS_dataset, int32_t mode, char *name1, void *data1, char *name2, void *data2, ..., NULL)
Note: For parameters of type SDDS_STRING
, passing by value means passing a char *
, whereas passing by reference means passing a char **
.
Definition at line 369 of file SDDS_dataprep.c.
|
extern |
Sets the values of one or more parameters in the current data table of an SDDS dataset using double-precision floating-point numbers.
This function assigns double-precision floating-point values to specified parameters in the current data table of the given SDDS dataset. It must be preceded by a call to SDDS_StartPage
to initialize the table. Parameters can be identified either by their index or by their name. The values can be passed either by value or by reference, depending on the specified mode.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
mode | A bitwise combination of the following constants:
|
Mode Requirements:
SDDS_SET_BY_INDEX
or SDDS_SET_BY_NAME
must be set.SDDS_PASS_BY_VALUE
or SDDS_PASS_BY_REFERENCE
must be set.Syntax Based on Mode Combination:
SDDS_SET_BY_INDEX
+ SDDS_PASS_BY_VALUE
: int32_t SDDS_SetParametersFromDoubles(SDDS_DATASET *SDDS_dataset, int32_t mode, int32_t index, double value)
SDDS_SET_BY_INDEX
+ SDDS_PASS_BY_REFERENCE
: int32_t SDDS_SetParametersFromDoubles(SDDS_DATASET *SDDS_dataset, int32_t mode, int32_t index, double *data)
SDDS_SET_BY_NAME
+ SDDS_PASS_BY_VALUE
: int32_t SDDS_SetParametersFromDoubles(SDDS_DATASET *SDDS_dataset, int32_t mode, char *name, double value)
SDDS_SET_BY_NAME
+ SDDS_PASS_BY_REFERENCE
: int32_t SDDS_SetParametersFromDoubles(SDDS_DATASET *SDDS_dataset, int32_t mode, char *name, double *data)
Note: For parameters of type SDDS_STRING
, setting values using this function is not supported and will result in an error.
1
on successful assignment of all specified parameter values. On failure, returns 0
and records an appropriate error message.Definition at line 697 of file SDDS_dataprep.c.
|
extern |
Sets unit conversions for a specified parameter in an SDDS dataset.
This function updates the units of the specified parameter within the SDDS dataset and applies a conversion factor to its value if the dataset has already been read (i.e., pages_read > 0
). The function ensures that the new units are consistent with the old units if provided.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
parameter_name | A null-terminated string specifying the name of the parameter to update. |
new_units | A null-terminated string specifying the new units to assign to the parameter. This parameter must not be NULL . |
old_units | A null-terminated string specifying the expected current units of the parameter. If NULL , the function does not verify the existing units. |
factor | A double representing the conversion factor to apply to the parameter's value. The parameter's value will be multiplied by this factor. |
1
on successful unit conversion and update. On failure, returns 0
and sets an appropriate error message.1 | Indicates that the unit conversion was successfully applied. |
0 | Indicates that an error occurred (e.g., invalid dataset, unrecognized parameter name, type undefined, memory allocation failure). |
new_units
parameter must not be NULL
. Passing NULL
will result in an error.pages_read == 0
), the conversion factor is stored but not applied immediately.Definition at line 4903 of file SDDS_extract.c.
|
extern |
Sets the read recovery mode for an SDDS dataset.
This function configures whether read recovery is possible for the specified SDDS dataset. Enabling recovery allows the dataset to attempt to recover partial data in case of read errors.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
mode | Integer flag indicating the recovery mode:
|
The function updates the readRecoveryPossible
flag within the dataset structure based on the provided mode
parameter. This flag is later checked by other functions to determine whether to attempt data recovery after encountering read errors.
Definition at line 2082 of file SDDS_binary.c.
|
extern |
Sets the row count mode for the SDDS dataset.
This function configures how row counts are managed within the SDDS dataset. The row count mode determines whether row counts are variable, fixed, or entirely omitted during data writing. Proper configuration of row count modes can enhance data integrity and performance based on specific use cases.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | mode | The row count mode to be set. Must be one of the following:
|
1
on successful configuration of the row count mode.0
on failure, with an error message set internally.SDDS_FIXEDROWCOUNT
mode may require specifying additional parameters such as row increment.Definition at line 2326 of file SDDS_output.c.
|
extern |
Sets the acceptance flags for all rows in the current data table of a data set.
This function initializes the acceptance flags for each row in the data table. A non-zero flag indicates that the row is "of interest" and should be considered in subsequent operations, while a zero flag marks the row for rejection.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
row_flag_value | Integer value to assign to all row flags.
|
row_flag_value
.Definition at line 46 of file SDDS_extract.c.
|
extern |
Sets the row limit for the SDDS dataset.
limit | The maximum number of rows to read. If limit <= 0 , the row limit is set to INT64_MAX . |
Definition at line 1232 of file SDDS_input.c.
|
extern |
Sets the rows of interest in an SDDS dataset based on various selection criteria.
This function marks rows in the provided SDDS dataset as "of interest" based on the specified selection criteria. It supports multiple selection modes, allowing users to specify rows by an array of names, a single string containing multiple names, a variadic list of names, or by matching a specific string with logical operations.
Calling Modes:
NULL
. Additionally, each of these modes has a case-insensitive variant prefixed with SDDS_CI_
(e.g., SDDS_CI_NAME_ARRAY
).
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
selection_column | A null-terminated string specifying the name of the column used for row selection. This column must be of string type. |
mode | An integer representing the selection mode. Supported modes include:
|
... | Variable arguments corresponding to the selected mode:
|
-1
and sets an appropriate error message.-1 | Indicates that an error occurred (e.g., invalid dataset, unrecognized selection column, memory allocation failure, unknown mode). |
Non-negative | Integer representing the count of rows marked as "of interest". |
selection_column
exists and is of string type in the dataset.SDDS_NAMES_STRING
), the function handles memory management internally.Definition at line 3324 of file SDDS_extract.c.
|
extern |
Sets the values of one or more columns in a specified row of the current data table of an SDDS dataset.
This function assigns values to specified columns in a particular row of the current data table within the given SDDS dataset. It must be preceded by a call to SDDS_StartPage
to initialize the table. Columns can be identified either by their index or by their name. The values can be passed either by value or by reference, depending on the specified mode.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
mode | A bitwise combination of the following constants:
|
Mode Requirements:
SDDS_SET_BY_INDEX
or SDDS_SET_BY_NAME
must be set.SDDS_PASS_BY_VALUE
or SDDS_PASS_BY_REFERENCE
must be set.Syntax Based on Mode Combination:
SDDS_SET_BY_INDEX
+ SDDS_PASS_BY_VALUE
: int32_t SDDS_SetRowValues(SDDS_DATASET *SDDS_dataset, int32_t mode, int64_t row, int32_t index, value, ..., -1)
SDDS_SET_BY_INDEX
+ SDDS_PASS_BY_REFERENCE
: int32_t SDDS_SetRowValues(SDDS_DATASET *SDDS_dataset, int32_t mode, int64_t row, int32_t index, void *data, ..., -1)
SDDS_SET_BY_NAME
+ SDDS_PASS_BY_VALUE
: int32_t SDDS_SetRowValues(SDDS_DATASET *SDDS_dataset, int32_t mode, int64_t row, char *name, value, ..., NULL)
SDDS_SET_BY_NAME
+ SDDS_PASS_BY_REFERENCE
: int32_t SDDS_SetRowValues(SDDS_DATASET *SDDS_dataset, int32_t mode, int64_t row, char *name, void *data, ..., NULL)
Note: For columns of type SDDS_STRING
, passing by value means passing a char *
, whereas passing by reference means passing a char **
.
row | The row number in the data table where the column values will be set. Row numbering starts from 1. |
1
on successful assignment of all specified column values. On failure, returns 0
and records an appropriate error message.Definition at line 988 of file SDDS_dataprep.c.
|
extern |
Sets the terminate mode for the SDDS dataset.
mode | The terminate mode to set. |
Definition at line 1338 of file SDDS_input.c.
|
extern |
Shortens the data table in the SDDS dataset to a specified number of rows.
This function reduces the number of allocated rows in the specified SDDS dataset to the given rows
count. It reallocates memory for each column's data array and the row flags, freeing existing data as necessary. All data is reset, and the number of rows is set to zero.
SDDS_dataset | Pointer to the SDDS_DATASET structure whose table will be shortened. |
rows | The new number of rows to allocate in the table. If rows is less than or equal to zero, it defaults to 1. |
Definition at line 238 of file SDDS_dataprep.c.
|
extern |
Formats a data value of a specified type into a string buffer using an optional printf format string.
This function formats a single data value from a data array into a provided buffer. It is a wrapper for SDDS_SprintTypedValueFactor
with a default scaling factor of 1.0.
[in] | data | Pointer to the base address of the data array containing the value to be formatted. |
[in] | index | The index of the item within the data array to be formatted. |
[in] | type | The data type of the value, specified by one of the SDDS constants:
|
[in] | format | (Optional) NULL-terminated string specifying a printf format. If NULL , a default format is used based on the data type. |
[out] | buffer | Pointer to a character array where the formatted string will be stored. |
[in] | mode | Flags controlling the formatting behavior. Valid values are:
|
1
on success. On failure, returns 0
and records an error message.Definition at line 151 of file SDDS_utils.c.
|
extern |
Reallocates memory to a new size and zero-initializes the additional space.
This function extends the standard realloc
functionality by zero-initializing any newly allocated memory beyond the original size. It ensures that memory is consistently reallocated and initialized across different build configurations.
[in] | data | Pointer to the base address of the data array containing the value to be formatted. |
[in] | index | The index of the item within the data array to be formatted. |
[in] | type | The data type of the value, specified by one of the SDDS constants:
|
[in] | format | (Optional) NULL-terminated string specifying a printf format. If NULL , a default format is used based on the data type. |
[out] | buffer | Pointer to a character array where the formatted string will be stored. |
[in] | mode | Flags controlling the formatting behavior. Valid values are:
|
[in] | factor | Scaling factor to be applied to the value before formatting. The value is multiplied by this factor. |
1
on success. On failure, returns 0
and records an error message.SDDS_PRINT_NOQUOTES
is specified in mode
.Definition at line 186 of file SDDS_utils.c.
|
extern |
Initializes an SDDS_DATASET structure in preparation for inserting data into a new table.
This function prepares the specified SDDS dataset for data insertion by initializing necessary data structures and allocating memory based on the expected number of rows. It must be preceded by a call to SDDS_InitializeOutput
. SDDS_StartPage
can be called multiple times to begin writing additional tables within the dataset. After initializing a page, SDDS_WriteTable
should be used to write the table to disk.
SDDS_dataset | Pointer to the SDDS_DATASET structure representing the data set. |
expected_n_rows | The expected number of rows in the data table. This value is used to preallocate memory for storing data values. If expected_n_rows is less than or equal to zero, it defaults to 1. |
Definition at line 64 of file SDDS_dataprep.c.
|
extern |
Checks if a string is blank (contains only whitespace characters).
This function determines whether the provided NULL-terminated string s
consists solely of whitespace characters. If the string is NULL
or contains only whitespace, the function returns 1
. If the string contains any non-whitespace characters, it returns 0
.
[in] | s | Pointer to the NULL-terminated string to be checked. |
1
if the string is NULL
or contains only whitespace characters.0
if the string contains any non-whitespace characters.Definition at line 2404 of file SDDS_utils.c.
void SDDS_SwapDouble | ( | double * | data | ) |
Swaps the endianness of a double.
This function swaps the byte order of a 64-bit double-precision floating-point number pointed to by the provided data pointer. It effectively converts the data between little-endian and big-endian formats.
[in,out] | data | Pointer to the double whose byte order is to be swapped. |
Definition at line 3834 of file SDDS_binary.c.
|
extern |
Swaps the endianness of the array data in an SDDS dataset.
This function iterates through all arrays defined in the specified SDDS dataset and swaps the byte order of each element to match the system's native endianness. It supports various data types including short, unsigned short, long, unsigned long, long long, unsigned long long, float, double, and long double. The function ensures that binary data is correctly interpreted on systems with different byte orders.
[in,out] | SDDSin | Pointer to the SDDS_DATASET structure representing the dataset whose array data endianness is to be swapped. |
1 | The endianness of all applicable array data elements was successfully swapped. |
Definition at line 3623 of file SDDS_binary.c.
|
extern |
Swaps the endianness of the column data in an SDDS dataset.
This function iterates through all columns in the specified SDDS dataset and swaps the byte order of each data element to match the system's native endianness. It supports various data types, including short, unsigned short, long, unsigned long, long long, unsigned long long, float, double, and long double. The function ensures that binary data is correctly interpreted on systems with different byte orders.
[in,out] | SDDSin | Pointer to the SDDS_DATASET structure representing the dataset whose column data endianness is to be swapped. |
1 | The endianness of all applicable column data elements was successfully swapped. |
Definition at line 3458 of file SDDS_binary.c.
|
extern |
Swaps the endianness of the parameter data in an SDDS dataset.
This function iterates through all parameters in the specified SDDS dataset and swaps the byte order of each data element to match the system's native endianness. It handles various data types, including short, unsigned short, long, unsigned long, long long, unsigned long long, float, double, and long double. Parameters with fixed values are skipped as their byte order is already consistent.
[in,out] | SDDSin | Pointer to the SDDS_DATASET structure representing the dataset whose parameter data endianness is to be swapped. |
1 | The endianness of all applicable parameter data elements was successfully swapped. |
Definition at line 3544 of file SDDS_binary.c.
void SDDS_SwapFloat | ( | float * | data | ) |
Swaps the endianness of a float.
This function swaps the byte order of a 32-bit floating-point number pointed to by the provided data pointer. It effectively converts the data between little-endian and big-endian formats.
[in,out] | data | Pointer to the float whose byte order is to be swapped. |
Definition at line 3815 of file SDDS_binary.c.
|
extern |
Swaps the endianness of a 32-bit integer.
This function swaps the byte order of a 32-bit integer pointed to by the provided data pointer. It effectively converts the data between little-endian and big-endian formats.
[in,out] | data | Pointer to the 32-bit integer whose byte order is to be swapped. |
Definition at line 3739 of file SDDS_binary.c.
|
extern |
Swaps the endianness of a 64-bit integer.
This function swaps the byte order of a 64-bit integer pointed to by the provided data pointer. It effectively converts the data between little-endian and big-endian formats.
[in,out] | data | Pointer to the 64-bit integer whose byte order is to be swapped. |
Definition at line 3777 of file SDDS_binary.c.
void SDDS_SwapLongDouble | ( | long double * | data | ) |
Swaps the endianness of a long double.
This function swaps the byte order of a long double floating-point number pointed to by the provided data pointer. It effectively converts the data between little-endian and big-endian formats. The function accounts for different sizes of long double based on the system's architecture.
[in,out] | data | Pointer to the long double whose byte order is to be swapped. |
Definition at line 3854 of file SDDS_binary.c.
void SDDS_SwapShort | ( | short * | data | ) |
Swaps the endianness of a short integer.
This function swaps the byte order of a 16-bit short integer pointed to by the provided data pointer. It effectively converts the data between little-endian and big-endian formats.
[in,out] | data | Pointer to the short integer whose byte order is to be swapped. |
Definition at line 3703 of file SDDS_binary.c.
|
extern |
Swaps the endianness of a 32-bit unsigned integer.
This function swaps the byte order of a 32-bit unsigned integer pointed to by the provided data pointer. It effectively converts the data between little-endian and big-endian formats.
[in,out] | data | Pointer to the 32-bit unsigned integer whose byte order is to be swapped. |
Definition at line 3758 of file SDDS_binary.c.
|
extern |
Swaps the endianness of a 64-bit unsigned integer.
This function swaps the byte order of a 64-bit unsigned integer pointed to by the provided data pointer. It effectively converts the data between little-endian and big-endian formats.
[in,out] | data | Pointer to the 64-bit unsigned integer whose byte order is to be swapped. |
Definition at line 3796 of file SDDS_binary.c.
void SDDS_SwapUShort | ( | unsigned short * | data | ) |
Swaps the endianness of an unsigned short integer.
This function swaps the byte order of a 16-bit unsigned short integer pointed to by the provided data pointer. It effectively converts the data between little-endian and big-endian formats.
[in,out] | data | Pointer to the unsigned short integer whose byte order is to be swapped. |
Definition at line 3721 of file SDDS_binary.c.
|
extern |
Synchronizes the SDDS dataset with the disk by flushing buffered data.
This function attempts to ensure that any buffered data associated with the SDDS dataset is written to the disk using the fsync
system call. However, on certain platforms such as VxWorks, Windows, Linux, and macOS, this functionality is not implemented and the function simply returns success. This behavior should be considered when relying on data synchronization across different operating systems.
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
0
on success, indicating that data synchronization is either not needed or was successful.-1
) on failure to synchronize the data, with an error message set internally.fsync
system call.Definition at line 1333 of file SDDS_output.c.
|
extern |
Closes an SDDS file and frees the related memory.
SDDS_dataset | A pointer to an SDDS dataset. |
Definition at line 1448 of file SDDS_input.c.
|
extern |
Transfers all array definitions from a source dataset to a target dataset.
This function defines all arrays in the target SDDS dataset to match the array definitions in the source SDDS dataset. Currently, only mode 0
is supported, which results in an error if any array already exists in the target dataset.
SDDS_target | Pointer to the SDDS_DATASET structure representing the target dataset. |
SDDS_source | Pointer to the SDDS_DATASET structure representing the source dataset. |
mode | Flags that determine how to handle existing arrays. Valid value:
|
1
on success; 0
on failure. On failure, an error message is recorded.Definition at line 506 of file SDDS_transfer.c.
|
extern |
Transfers all column definitions from a source dataset to a target dataset.
This function defines all columns in the target SDDS dataset to match the column definitions in the source SDDS dataset. It handles existing columns based on the specified mode.
SDDS_target | Pointer to the SDDS_DATASET structure representing the target dataset. |
SDDS_source | Pointer to the SDDS_DATASET structure representing the source dataset. |
mode | Flags that determine how to handle existing columns. Valid flags include:
|
1
on success; 0
on failure. On failure, an error message is recorded. Definition at line 424 of file SDDS_transfer.c.
|
extern |
Transfers all parameter definitions from a source dataset to a target dataset.
This function defines all parameters in the target SDDS dataset to match the parameter definitions in the source SDDS dataset. It handles existing parameters based on the specified mode.
SDDS_target | Pointer to the SDDS_DATASET structure representing the target dataset. |
SDDS_source | Pointer to the SDDS_DATASET structure representing the source dataset. |
mode | Flags that determine how to handle existing parameters. Valid flags include:
|
1
on success; 0
on failure. On failure, an error message is recorded. Definition at line 343 of file SDDS_transfer.c.
|
extern |
Transfers an array definition from a source dataset to a target dataset.
This function defines an array in the target SDDS dataset to match the definition of an array in the source SDDS dataset.
target | Pointer to the SDDS_DATASET structure representing the target dataset. |
source | Pointer to the SDDS_DATASET structure representing the source dataset. |
name | The name of the array in the source dataset to be transferred. |
newName | The name of the array in the target dataset. If NULL , the original name is used. |
1
on success; 0
on failure. On failure, an error message is recorded. Definition at line 111 of file SDDS_transfer.c.
|
extern |
Transfers an associate definition from a source dataset to a target dataset.
This function defines an associate in the target SDDS dataset to match the definition of an associate in the source SDDS dataset.
target | Pointer to the SDDS_DATASET structure representing the target dataset. |
source | Pointer to the SDDS_DATASET structure representing the source dataset. |
name | The name of the associate in the source dataset to be transferred. |
newName | The name of the associate in the target dataset. If NULL , the original name is used. |
1
on success; 0
on failure. On failure, an error message is recorded. Definition at line 149 of file SDDS_transfer.c.
|
extern |
Transfers a column definition from a source dataset to a target dataset.
This function defines a column in the target SDDS dataset to match the definition of a column in the source SDDS dataset.
target | Pointer to the SDDS_DATASET structure representing the target dataset. |
source | Pointer to the SDDS_DATASET structure representing the source dataset. |
name | The name of the column in the source dataset to be transferred. |
newName | The name of the column in the target dataset. If NULL , the original name is used. |
1
on success; 0
on failure. On failure, an error message is recorded. Definition at line 35 of file SDDS_transfer.c.
|
extern |
Transfers a parameter definition from a source dataset to a target dataset.
This function defines a parameter in the target SDDS dataset to match the definition of a parameter in the source SDDS dataset.
target | Pointer to the SDDS_DATASET structure representing the target dataset. |
source | Pointer to the SDDS_DATASET structure representing the source dataset. |
name | The name of the parameter in the source dataset to be transferred. |
newName | The name of the parameter in the target dataset. If NULL , the original name is used. |
1
on success; 0
on failure. On failure, an error message is recorded. Definition at line 73 of file SDDS_transfer.c.
|
extern |
Removes escape characters from quote characters within a string.
This function scans the input string s
and removes backslashes (\
) that precede the specified quote_char
, effectively unescaping the quotes. This is useful for processing strings that have been prepared with escaped quotes.
[in,out] | s | Pointer to the string in which quotes will be unescaped. The string will be modified in place. |
[in] | quote_char | The quote character to unescape (e.g., " ). |
s
by shifting characters to remove the escape backslashes. It assumes that s
is properly null-terminated.Definition at line 1932 of file SDDS_utils.c.
|
extern |
Updates the current page of the SDDS dataset.
This function finalizes and writes the current page of the SDDS dataset based on the specified mode. The mode can be either FLUSH_TABLE
, indicating that the current page is complete and should be written to disk, or 0
for other update operations. Depending on the data mode (ASCII or Binary), the function delegates the update process to the appropriate handler.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
[in] | mode | The update mode, which can be:
|
1
on successful update of the current page.0
if an error occurred during the update process. An error message is set internally in this case.FLUSH_TABLE
mode ensures that all buffered data is written to the disk, which can be useful for data integrity.Definition at line 1285 of file SDDS_output.c.
|
extern |
Updates the row count in the SDDS file for fixed row count mode.
SDDS_dataset | The SDDS dataset to update. |
Definition at line 1702 of file SDDS_input.c.
|
extern |
Verifies the existence of an array in the SDDS dataset based on specified criteria.
This function searches for an array within the SDDS dataset that matches the given criteria defined by the mode
. It returns the index of the first matching array or -1
if no match is found.
The function supports the following modes:
int32_t type
, char *name
char *name
char *name
char *name
char *name
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to be searched. |
[in] | mode | Specifies the mode for matching arrays. Valid modes are:
|
[in] | ... | Variable arguments depending on mode :
|
int32_t
) of the first matched array.-1
if no matching array is found.mode
.Definition at line 5344 of file SDDS_utils.c.
|
extern |
Verifies the existence of a column in the SDDS dataset based on specified criteria.
This function searches for a column within the SDDS dataset that matches the given criteria defined by the mode
. It returns the index of the first matching column or -1
if no match is found.
The function supports the following modes:
int32_t type
, char *name
char *name
char *name
char *name
char *name
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to be searched. |
[in] | mode | Specifies the mode for matching columns. Valid modes are:
|
[in] | ... | Variable arguments depending on mode :
|
int32_t
) of the first matched column.-1
if no matching column is found.mode
.Definition at line 5420 of file SDDS_utils.c.
|
extern |
Verifies the existence of a parameter in the SDDS dataset based on specified criteria.
This function searches for a parameter within the SDDS dataset that matches the given criteria defined by the mode
. It returns the index of the first matching parameter or -1
if no match is found.
The function supports the following modes:
int32_t type
, char *name
char *name
char *name
char *name
char *name
[in] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to be searched. |
[in] | mode | Specifies the mode for matching parameters. Valid modes are:
|
[in] | ... | Variable arguments depending on mode :
|
int32_t
) of the first matched parameter.-1
if no matching parameter is found.mode
.Definition at line 5497 of file SDDS_utils.c.
|
extern |
Verifies that a printf format string is compatible with a specified data type.
This function checks whether the provided printf format string is appropriate for the given SDDS data type. It ensures that the format specifier matches the type, preventing potential formatting errors during data output.
[in] | string | The printf format string to be verified. |
[in] | type | The data type against which the format string is verified. Must be one of the SDDS type constants:
|
1
if the format string is valid for the specified type; otherwise, returns 0
and records an error message.Definition at line 750 of file SDDS_utils.c.
|
extern |
Prints a warning message to stderr
.
This function outputs a warning message to the specified FILE
stream, typically stderr
. If a program name has been registered using SDDS_RegisterProgramName
, it is included in the warning message.
[in] | message | The warning message to be printed. If NULL , a default message "?" is used. |
Definition at line 362 of file SDDS_utils.c.
|
extern |
Writes a binary string to a file with buffering.
This function writes a binary string to the specified file by first writing the length of the string followed by the string's content to ensure proper binary formatting. If the input string is NULL, an empty string is written instead. The writing operation utilizes a buffered approach to enhance performance.
[in] | string | The null-terminated string to be written. If NULL, an empty string is written. |
[in] | fp | The file pointer to write to. Must be an open file in binary write mode. |
[in,out] | fBuffer | Pointer to the file buffer used for buffered writing operations. |
1 | Operation was successful. |
0 | An error occurred during writing. |
Definition at line 2521 of file SDDS_binary.c.
|
extern |
Writes the SDDS layout header to the output file.
This function serializes and writes the layout information of the SDDS dataset to the output file. The layout defines the structure of the data tables, including parameters, arrays, columns, and associates. The function handles different file types, including standard, gzip-compressed, and LZMA-compressed files, and ensures that the layout is written in the correct byte order and format based on the dataset's configuration.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure whose layout is to be written. |
1
on successful writing of the layout.0
if an error occurred during the writing process. An internal error message is set in this case.SDDS_OUTPUT_ENDIANESS
can influence the byte order declared in the layout.Definition at line 893 of file SDDS_output.c.
int32_t SDDS_WriteNonNativeBinaryArrays | ( | SDDS_DATASET * | SDDS_dataset | ) |
Writes non-native endian binary arrays to an SDDS dataset.
This function iterates through all array definitions in the specified SDDS dataset and writes their binary data to the underlying file. It handles various data types, including short, unsigned short, long, unsigned long, long long, unsigned long long, float, double, and long double. For string arrays, it writes each string individually, ensuring proper memory management and byte order conversion. The function supports different compression formats, including uncompressed, LZMA-compressed, and GZIP-compressed files. After writing, it swaps the endianness of the array data to match the system's native byte order.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to write to. |
1 | All non-native endian arrays were successfully written and byte-swapped. |
0 | An error occurred during the write operation, such as I/O failures, memory allocation issues, or corrupted array definitions. |
Definition at line 5226 of file SDDS_binary.c.
|
extern |
Writes a non-native endian binary page to an SDDS dataset.
This function writes a binary page to the specified SDDS dataset, handling byte order reversal to convert between little-endian and big-endian formats. It manages various compression formats, including uncompressed, GZIP-compressed, and LZMA-compressed files. The function performs the following operations:
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to write to. |
1 | The binary page was successfully written and byte-swapped. |
0 | An error occurred during the write operation, such as I/O failures, memory allocation issues, or corrupted dataset definitions. |
Definition at line 4862 of file SDDS_binary.c.
int32_t SDDS_WriteNonNativeBinaryParameters | ( | SDDS_DATASET * | SDDS_dataset | ) |
Writes non-native endian binary parameters to an SDDS dataset.
This function iterates through all parameter definitions in the specified SDDS dataset and writes their binary data to the underlying file. It handles various data types, including short, unsigned short, long, unsigned long, long long, unsigned long long, float, double, and long double. For string parameters, it writes each string individually, ensuring proper memory management and byte order conversion. Parameters with fixed values are skipped during the write process. The function supports different compression formats, including uncompressed, LZMA-compressed, and GZIP-compressed files.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to write to. |
1 | All non-native endian parameters were successfully written and byte-swapped. |
0 | An error occurred during the write operation, such as I/O failures, memory allocation issues, or corrupted parameter definitions. |
Definition at line 5118 of file SDDS_binary.c.
int32_t SDDS_WriteNonNativeBinaryRow | ( | SDDS_DATASET * | SDDS_dataset, |
int64_t | row ) |
Writes a non-native endian binary row to an SDDS dataset.
This function writes a single row of data to the specified SDDS dataset, handling byte order reversal to convert between little-endian and big-endian formats. It supports various compression formats, including uncompressed, GZIP-compressed, and LZMA-compressed files. The function iterates through all column definitions, writing each column's data appropriately based on its type. For string columns, it ensures proper memory management and byte order conversion by utilizing specialized string writing functions. For non-string data types, it writes the binary data directly with the correct byte ordering.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset to write to. |
[in] | row | The index of the row to write to the dataset. |
1 | The binary row was successfully written and byte-swapped. |
0 | An error occurred during the write operation, such as I/O failures or corrupted data. |
Definition at line 5381 of file SDDS_binary.c.
int32_t SDDS_WriteNonNativeBinaryString | ( | char * | string, |
FILE * | fp, | ||
SDDS_FILEBUFFER * | fBuffer ) |
Writes a non-native endian binary string to a file.
This function writes a binary string to the specified file pointer, handling non-native endianness. It first writes the length of the string as a 32-bit integer with byte order swapped. If the string is not to be skipped, it then writes the string data itself followed by a null terminator. If the input string is NULL, an empty string is written instead.
[in] | string | The string to write. If NULL, an empty string is written. |
[in] | fp | Pointer to the FILE where the string will be written. |
[in] | fBuffer | Pointer to the SDDS_FILEBUFFER structure used for buffered writing. |
1 | The string was successfully written and byte-swapped. |
0 | An error occurred during the write operation, such as I/O failures or memory allocation issues. |
fp
is valid and open for writing. This function does not perform memory allocation for the string; it assumes that the string is already allocated and managed appropriately. Definition at line 5473 of file SDDS_binary.c.
|
extern |
Writes the current data table to the output file.
This function serializes and writes the current data table of the SDDS dataset to the output file. It must be preceded by a call to SDDS_WriteLayout
to ensure that the dataset layout is properly defined in the output file. Depending on the data mode (ASCII or Binary), the function delegates the writing process to the appropriate handler.
[in,out] | SDDS_dataset | Pointer to the SDDS_DATASET structure representing the dataset. |
1
on successful writing of the data table.0
if an error occurred during the write process. An error message is set internally in this case.SDDS_WriteLayout
must have been called successfully before writing any pages.Definition at line 1222 of file SDDS_output.c.
|
extern |
Writes a typed value to an ASCII file stream.
This function writes a value of a specified SDDS data type to an ASCII file stream. The data is provided as a void pointer, and the function handles various data types by casting the pointer appropriately based on the type
parameter. For string data, special characters are escaped according to SDDS conventions.
data | Pointer to the data to be written. Should be castable to the type specified by type . |
index | Array index of the data to be printed; use 0 if not an array. |
type | The SDDS data type of the data variable. Possible values include SDDS_SHORT, SDDS_LONG, SDDS_FLOAT, etc. |
format | Optional printf format string to use; pass NULL to use the default format for the data type. |
fp | The FILE pointer to the ASCII file stream where the data will be written. |
Definition at line 57 of file SDDS_ascii.c.
|
extern |
Sets a block of memory to zero.
This function zero-initializes a specified number of bytes in a memory block. It is a wrapper around the standard memset
function, providing a convenient way to clear memory.
[in,out] | mem | Pointer to the memory block to be zeroed. |
[in] | n_bytes | The number of bytes to set to zero. |
1
on successful memory zeroing. Returns 0
if the input memory pointer mem
is NULL
.n_bytes
.Definition at line 1985 of file SDDS_utils.c.
|
extern |
Field information for array definitions.
Maps each array field name to its offset within the ARRAY_DEFINITION structure, along with the corresponding data type and any associated enumeration pairs.
Definition at line 175 of file SDDS_data.c.
|
extern |
Field information for associate definitions.
Maps each associate field name to its offset within the ASSOCIATE_DEFINITION structure, along with the corresponding data type and any associated enumeration pairs.
Definition at line 225 of file SDDS_data.c.
|
extern |
Field information for column definitions.
Maps each column field name to its offset within the COLUMN_DEFINITION structure, along with the corresponding data type and any associated enumeration pairs.
Definition at line 193 of file SDDS_data.c.
|
extern |
Array of supported data modes.
Contains the string representations of the different data modes supported by SDDS, such as "binary" and "ascii".
Definition at line 33 of file SDDS_data.c.
|
extern |
Field information for data mode settings.
Maps each data mode field name to its offset within the DATA_MODE structure, along with the corresponding data type and any associated enumeration pairs.
Definition at line 159 of file SDDS_data.c.
|
extern |
Field information for SDDS layout descriptions.
Maps each description field name to its offset within the SDDS_LAYOUT structure, along with the corresponding data type and any associated enumeration pairs.
Definition at line 107 of file SDDS_data.c.
|
extern |
Field information for include directives.
Maps each include field name to its offset within the INCLUDE_DEFINITION structure, along with the corresponding data type.
Definition at line 240 of file SDDS_data.c.
|
extern |
Field information for parameter definitions.
Maps each parameter field name to its offset within the PARAMETER_DEFINITION structure, along with the corresponding data type and any associated enumeration pairs.
Definition at line 209 of file SDDS_data.c.
epicsShareExtern char* SDDS_type_name[SDDS_NUM_TYPES] |
epicsShareExtern int32_t SDDS_type_size[SDDS_NUM_TYPES] |