SDDSlib
Loading...
Searching...
No Matches
SDDS_internal.h
Go to the documentation of this file.
1/**
2 * @file SDDS_internal.h
3 * @brief Internal definitions and function declarations for SDDS with LZMA support
4 *
5 * This header file contains internal macros, structures, and function prototypes
6 * used by the SDDS (Self Describing Data Sets) library to handle LZMA-compressed
7 * files. It includes definitions for the `lzmafile` structure, buffer sizes,
8 * and various binary and ASCII I/O routines tailored for SDDS datasets.
9 *
10 * The file ensures that internal components are only included once using
11 * include guards and conditionally includes the LZMA library when necessary.
12 *
13 * ### Key Components:
14 * - **Structures:**
15 * - `lzmafile`: Represents an LZMA-compressed file with associated stream and buffer.
16 *
17 * - **Function Prototypes:**
18 * - `lzma_open`, `lzma_close`, `lzma_read`, `lzma_write`: Basic file operations for LZMA files.
19 * - `SDDS_WriteBinaryArrays`, `SDDS_ReadBinaryArrays`, etc.: SDDS-specific binary I/O functions.
20 * - `SDDS_WriteAsciiArrays`, `SDDS_ReadAsciiArrays`, etc.: SDDS-specific ASCII I/O functions.
21 * - Additional utility and processing functions for handling SDDS datasets.
22 *
23 * - **Macros:**
24 * - `LZMA_BUF_SIZE`: Defines the buffer size for LZMA operations.
25 * - `TABLE_LENGTH_INCREMENT`: Specifies the increment size for table allocations.
26 * - Command definitions for various SDDS operations.
27 *
28 * ### Dependencies:
29 * - Requires the LZMA library (`lzma.h`) for compression support.
30 * - Conditionally includes zLib support if defined.
31 *
32 * ### Usage:
33 * This file is intended for internal use within the SDDS library and should not be
34 * included directly by external applications. It provides the necessary infrastructure
35 * to manage compressed data streams and perform efficient I/O operations on SDDS datasets.
36 *
37 * @note Ensure that the LZMA and zLib libraries are properly linked when compiling
38 * components that include this header.
39 *
40 * @copyright
41 * - (c) 2002 The University of Chicago, as Operator of Argonne National Laboratory.
42 * - (c) 2002 The Regents of the University of California, as Operator of Los Alamos National Laboratory.
43 *
44 * @license This file is distributed under the terms of the Software License Agreement
45 * found in the file LICENSE included with this distribution.
46 *
47 * @authors
48 * M. Borland,
49 * C. Saunders,
50 * R. Soliday,
51 * H. Shang
52 *
53 */
54
55#include "SDDS.h"
56
57#if !defined(_SDDS_internal_)
58# define _SDDS_internal_ 1
59
60# if !defined(LZMA_BUF_SIZE)
61# include <lzma.h>
62# define LZMA_BUF_SIZE 4096
63struct lzmafile {
64 lzma_stream str; /* codec stream descriptor */
65 FILE *fp; /* backing file descriptor */
66 char mode; /* access mode ('r' or 'w') */
67 unsigned char rdbuf[LZMA_BUF_SIZE]; /* read buffer used by lzmaRead */
68};
69# endif
70void *lzma_open(const char *path, const char *mode);
71int lzma_close(struct lzmafile *file);
72long lzma_read(struct lzmafile *file, void *buf, size_t count);
73long lzma_write(struct lzmafile *file, const void *buf, size_t count);
74int lzma_printf(struct lzmafile *file, const char *format, ...);
75int lzma_puts(const char *s, struct lzmafile *file);
76int lzma_putc(int c, struct lzmafile *file);
77char *lzma_gets(char *s, int size, struct lzmafile *file);
78int lzma_eof(struct lzmafile *file);
79long lzma_tell(struct lzmafile *file);
80int lzma_seek(struct lzmafile *file, long offset, int whence);
81void *UnpackLZMAOpen(char *filename);
82char *fgetsLZMASkipComments(SDDS_DATASET *SDDS_dataset, char *s, int32_t slen, struct lzmafile *lzmafp, char skip_char);
83char *fgetsLZMASkipCommentsResize(SDDS_DATASET *SDDS_dataset, char **s, int32_t *slen, struct lzmafile *lzmafp, char skip_char);
84int32_t SDDS_LZMAWriteBinaryString(char *string, struct lzmafile *lzmafp, SDDS_FILEBUFFER *fBuffer);
85char *SDDS_ReadNonNativeLZMABinaryString(struct lzmafile *lzmafp, SDDS_FILEBUFFER *fBuffer, int32_t skip);
86int32_t SDDS_LZMAWriteNonNativeBinaryString(char *string, struct lzmafile *lzmafp, SDDS_FILEBUFFER *fBuffer);
87
88# define TABLE_LENGTH_INCREMENT 100
89
90/* binary input/output routines */
91extern int32_t SDDS_WriteBinaryArrays(SDDS_DATASET *SDDS_dataset);
92extern int32_t SDDS_WriteBinaryColumns(SDDS_DATASET *SDDS_dataset);
93extern int32_t SDDS_WriteNonNativeBinaryColumns(SDDS_DATASET *SDDS_dataset);
94extern int32_t SDDS_WriteBinaryParameters(SDDS_DATASET *SDDS_dataset);
95extern int32_t SDDS_WriteBinaryPage(SDDS_DATASET *SDDS_dataset);
96extern int32_t SDDS_WriteBinaryRow(SDDS_DATASET *SDDS_dataset, int64_t row);
97extern int32_t SDDS_UpdateBinaryPage(SDDS_DATASET *SDDS_dataset, uint32_t mode);
98extern int32_t SDDS_UpdateNonNativeBinaryPage(SDDS_DATASET *SDDS_dataset, uint32_t mode);
99extern int32_t SDDS_fseek(FILE *fp, int64_t offset, int32_t dir);
100# if defined(zLib)
101extern int32_t SDDS_gzseek(gzFile gzfp, int64_t offset, int32_t dir);
102# endif
103
104extern char *SDDS_ReadBinaryString(FILE *fp, SDDS_FILEBUFFER *fBuffer, int32_t skip);
105extern int32_t SDDS_ReadBinaryArrays(SDDS_DATASET *SDDS_dataset);
106extern int32_t SDDS_ReadBinaryColumns(SDDS_DATASET *SDDS_dataset, int64_t sparse_interval, int64_t sparse_offset);
107extern int32_t SDDS_ReadNonNativeBinaryColumns(SDDS_DATASET *SDDS_dataset);
108extern int32_t SDDS_ReadBinaryParameters(SDDS_DATASET *SDDS_dataset);
109extern int32_t SDDS_ReadBinaryPage(SDDS_DATASET *SDDS_dataset, int64_t sparse_interval, int64_t sparse_offset, int32_t sparse_statistics);
110extern int32_t SDDS_ReadBinaryPageLastRows(SDDS_DATASET *SDDS_dataset, int64_t last_rows);
111extern int32_t SDDS_ReadBinaryPageDetailed(SDDS_DATASET *SDDS_dataset, int64_t sparse_interval, int64_t sparse_offset, int64_t last_rows, int32_t sparse_statistics);
112extern int32_t SDDS_ReadBinaryRow(SDDS_DATASET *SDDS_dataset, int64_t row, int32_t skip);
113extern int32_t SDDS_ReadNonNativePageLastRows(SDDS_DATASET *SDDS_dataset, int64_t last_rows);
114extern int32_t SDDS_ReadNonNativeBinaryPageDetailed(SDDS_DATASET *SDDS_dataset, int64_t sparse_interval, int64_t sparse_offset, int64_t last_rows);
115extern int32_t SDDS_ReadNonNativePageDetailed(SDDS_DATASET *SDDS_dataset, uint32_t mode, int64_t sparse_interval, int64_t sparse_offset, int64_t last_rows);
116extern int32_t SDDS_ReadNonNativeBinaryPageLastRows(SDDS_DATASET *SDDS_dataset, int64_t last_rows);
117
118extern int32_t SDDS_AllocateColumnFlags(SDDS_DATASET *SDDS_target);
119
120/* ascii input/output routines */
121extern int32_t SDDS_WriteAsciiArrays(SDDS_DATASET *SDDS_dataset, FILE *fp);
122extern int32_t SDDS_WriteAsciiParameters(SDDS_DATASET *SDDS_dataset, FILE *fp);
123extern void SDDS_AppendParameterComment(PARAMETER_DEFINITION *definition, char *text, char *string);
124extern int32_t SDDS_WriteAsciiRow(SDDS_DATASET *SDDS_dataset, int64_t row, FILE *fp);
125extern int32_t SDDS_WriteAsciiPage(SDDS_DATASET *SDDS_dataset);
126extern int32_t SDDS_ReadAsciiArrays(SDDS_DATASET *SDDS_dataset);
127extern int32_t SDDS_ReadAsciiParameters(SDDS_DATASET *SDDS_dataset);
128extern int32_t SDDS_AsciiDataExpected(SDDS_DATASET *SDDS_dataset);
129extern int32_t SDDS_ReadAsciiPageLastRows(SDDS_DATASET *SDDS_dataset, int64_t last_rows);
130extern int32_t SDDS_ReadAsciiPageDetailed(SDDS_DATASET *SDDS_dataset, int64_t sparse_interval, int64_t sparse_offset, int64_t last_rows, int32_t sparse_statistics);
131
132extern int32_t SDDS_LZMAWriteAsciiParameters(SDDS_DATASET *SDDS_dataset, struct lzmafile *lzmafp);
133extern int32_t SDDS_LZMAWriteAsciiArrays(SDDS_DATASET *SDDS_dataset, struct lzmafile *lzmafp);
134extern int32_t SDDS_LZMAWriteAsciiRow(SDDS_DATASET *SDDS_dataset, int64_t row, struct lzmafile *lzmafp);
135# if defined(zLib)
136extern int32_t SDDS_GZipWriteAsciiParameters(SDDS_DATASET *SDDS_dataset, gzFile gzfp);
137extern int32_t SDDS_GZipWriteAsciiArrays(SDDS_DATASET *SDDS_dataset, gzFile gzfp);
138extern int32_t SDDS_GZipWriteAsciiRow(SDDS_DATASET *SDDS_dataset, int64_t row, gzFile gzfp);
139# endif
140
141/* routines from SDDS_extract.c : */
142extern int32_t SDDS_CopyColumn(SDDS_DATASET *SDDS_dataset, int32_t target, int32_t source);
143extern int32_t SDDS_CopyParameter(SDDS_DATASET *SDDS_dataset, int32_t target, int32_t source);
144extern int32_t SDDS_TransferRow(SDDS_DATASET *SDDS_dataset, int64_t target, int64_t source);
145extern int64_t SDDS_GetSelectedRowIndex(SDDS_DATASET *SDDS_dataset, int64_t srow_index);
146
147/* routines from SDDS_utils.c : */
148extern int32_t SDDS_CheckTable(SDDS_DATASET *SDDS_dataset, const char *caller);
149extern int32_t SDDS_AdvanceCounter(int32_t *counter, int32_t *max_count, int32_t n_indices);
150extern void SDDS_FreePointerArray(void **data, int32_t dimensions, int32_t *dimension);
151
152/* routines from SDDS_output.c : */
153extern int32_t SDDS_WriteVersion(int32_t version_number, FILE *fp);
154extern int32_t SDDS_WriteDescription(char *description, char *contents, FILE *fp);
155extern int32_t SDDS_WriteColumnDefinition(COLUMN_DEFINITION *column, FILE *fp);
156extern int32_t SDDS_WriteParameterDefinition(PARAMETER_DEFINITION *parameter, FILE *fp);
157extern int32_t SDDS_WriteAssociateDefinition(ASSOCIATE_DEFINITION *associate, FILE *fp);
158extern int32_t SDDS_WriteArrayDefinition(ARRAY_DEFINITION *array_definition, FILE *fp);
159extern int32_t SDDS_WriteDataMode(SDDS_LAYOUT *layout, FILE *fp);
160extern int32_t SDDS_LZMAWriteVersion(int32_t version_number, struct lzmafile *lzmafp);
161extern int32_t SDDS_LZMAWriteDescription(char *description, char *contents, struct lzmafile *lzmafp);
162extern int32_t SDDS_LZMAWriteColumnDefinition(COLUMN_DEFINITION *column, struct lzmafile *lzmafp);
163extern int32_t SDDS_LZMAWriteParameterDefinition(PARAMETER_DEFINITION *parameter, struct lzmafile *lzmafp);
164extern int32_t SDDS_LZMAWriteAssociateDefinition(ASSOCIATE_DEFINITION *associate, struct lzmafile *lzmafp);
165extern int32_t SDDS_LZMAWriteArrayDefinition(ARRAY_DEFINITION *array_definition, struct lzmafile *lzmafp);
166extern int32_t SDDS_LZMAWriteDataMode(SDDS_LAYOUT *layout, struct lzmafile *lzmafp);
167# if defined(zLib)
168extern int32_t SDDS_GZipWriteVersion(int32_t version_number, gzFile gzfp);
169extern int32_t SDDS_GZipWriteDescription(char *description, char *contents, gzFile gzfp);
170extern int32_t SDDS_GZipWriteColumnDefinition(COLUMN_DEFINITION *column, gzFile gzfp);
171extern int32_t SDDS_GZipWriteParameterDefinition(PARAMETER_DEFINITION *parameter, gzFile gzfp);
172extern int32_t SDDS_GZipWriteAssociateDefinition(ASSOCIATE_DEFINITION *associate, gzFile gzfp);
173extern int32_t SDDS_GZipWriteArrayDefinition(ARRAY_DEFINITION *array_definition, gzFile gzfp);
174extern int32_t SDDS_GZipWriteDataMode(SDDS_LAYOUT *layout, gzFile gzfp);
175# endif
176
177/* -- routines for routing data processing to routines for appropriate version */
178extern int32_t SDDS_ProcessDescription(SDDS_DATASET *SDDS_dataset, char *s);
179extern int32_t SDDS_ProcessColumnDefinition(SDDS_DATASET *SDDS_dataset, char *s);
180extern int32_t SDDS_ProcessParameterDefinition(SDDS_DATASET *SDDS_dataset, char *s);
181extern int32_t SDDS_ProcessArrayDefinition(SDDS_DATASET *SDDS_dataset, char *s);
182extern FILE *SDDS_ProcessIncludeCommand(SDDS_DATASET *SDDS_dataset, char *s);
183extern int32_t SDDS_ProcessAssociateDefinition(SDDS_DATASET *SDDS_dataset, char *s);
184extern int32_t SDDS_ProcessDataMode(SDDS_DATASET *SDDS_dataset, char *s);
185
186/* -- protocol version 1 routines */
187extern int32_t SDDS1_ProcessDescription(SDDS_DATASET *SDDS_dataset, char *s);
188extern int32_t SDDS1_ProcessColumnDefinition(SDDS_DATASET *SDDS_dataset, char *s);
189extern int32_t SDDS1_ProcessParameterDefinition(SDDS_DATASET *SDDS_dataset, char *s);
190extern int32_t SDDS1_ProcessArrayDefinition(SDDS_DATASET *SDDS_dataset, char *s);
191extern FILE *SDDS1_ProcessIncludeCommand(SDDS_DATASET *SDDS_dataset, char *s);
192extern int32_t SDDS1_ProcessAssociateDefinition(SDDS_DATASET *SDDS_dataset, char *s);
193extern int32_t SDDS1_ProcessDataMode(SDDS_DATASET *SDDS_dataset, char *s);
194
195/* internal input routines */
196extern int32_t SDDS_ReadLayout(SDDS_DATASET *SDDS_dataset, FILE *fp);
197extern int32_t SDDS_LZMAReadLayout(SDDS_DATASET *SDDS_dataset, struct lzmafile *lzmafp);
198extern int32_t SDDS_UpdateAsciiPage(SDDS_DATASET *SDDS_dataset, uint32_t mode);
199# if defined(zLib)
200extern int32_t SDDS_GZipReadLayout(SDDS_DATASET *SDDS_dataset, gzFile gzfp);
201# endif
202
203# define SDDS_DESCRIPTION_COMMAND 0
204# define SDDS_COLUMN_COMMAND 1
205# define SDDS_PARAMETER_COMMAND 2
206# define SDDS_ASSOCIATE_COMMAND 3
207# define SDDS_DATA_COMMAND 4
208# define SDDS_INCLUDE_COMMAND 5
209# define SDDS_ARRAY_COMMAND 6
210# define SDDS_NUM_COMMANDS 7
211
212extern char *SDDS_command[SDDS_NUM_COMMANDS];
213
214uint32_t SDDS_GetSpecialCommentsModes(SDDS_DATASET *SDDS_dataset);
216void SDDS_ParseSpecialComments(SDDS_DATASET *SDDS_dataset, char *s);
217
218void SDDS_FreeTableStrings(SDDS_DATASET *SDDS_dataset);
219
220#endif
SDDS (Self Describing Data Set) Data Types Definitions and Function Prototypes.
int32_t SDDS_UpdateAsciiPage(SDDS_DATASET *SDDS_dataset, uint32_t mode)
Updates the current ASCII page of an SDDS dataset with new data.
int64_t SDDS_GetSelectedRowIndex(SDDS_DATASET *SDDS_dataset, int64_t srow_index)
Retrieves the actual row index corresponding to a selected row position within the current data table...
int32_t SDDS_TransferRow(SDDS_DATASET *SDDS_dataset, int64_t target, int64_t source)
Transfers data from a source row to a target row within an SDDS dataset.
char * SDDS_ReadNonNativeLZMABinaryString(struct lzmafile *lzmafp, SDDS_FILEBUFFER *fBuffer, int32_t skip)
Reads a non-native endian binary string from an LZMA-compressed file.
int32_t SDDS1_ProcessArrayDefinition(SDDS_DATASET *SDDS_dataset, char *s)
Processes and defines an array within an SDDS dataset.
int32_t SDDS_ReadNonNativeBinaryPageDetailed(SDDS_DATASET *SDDS_dataset, int64_t sparse_interval, int64_t sparse_offset, int64_t last_rows)
Reads a detailed non-native endian binary page from an SDDS dataset.
int32_t SDDS_LZMAWriteAsciiArrays(SDDS_DATASET *SDDS_dataset, struct lzmafile *lzmafp)
Writes the arrays of an SDDS dataset in ASCII format to an LZMA compressed file.
Definition SDDS_ascii.c:680
int32_t SDDS_UpdateNonNativeBinaryPage(SDDS_DATASET *SDDS_dataset, uint32_t mode)
Updates a non-native endian binary page in an SDDS dataset.
int32_t SDDS_WriteBinaryColumns(SDDS_DATASET *SDDS_dataset)
Writes the binary columns of an SDDS dataset to the associated file.
int32_t SDDS_WriteBinaryRow(SDDS_DATASET *SDDS_dataset, int64_t row)
Writes a single binary row of an SDDS dataset to the associated file.
int32_t SDDS_WriteBinaryArrays(SDDS_DATASET *SDDS_dataset)
Writes the binary arrays of the SDDS dataset to a file.
int32_t SDDS_ReadBinaryColumns(SDDS_DATASET *SDDS_dataset, int64_t sparse_interval, int64_t sparse_offset)
Reads the binary columns from an SDDS dataset.
int32_t SDDS_ProcessArrayDefinition(SDDS_DATASET *SDDS_dataset, char *s)
Process the array definition section of the SDDS dataset.
int32_t SDDS_LZMAWriteVersion(int32_t version_number, struct lzmafile *lzmafp)
Writes the SDDS protocol version to an LZMA-compressed file.
Definition SDDS_write.c:77
int32_t SDDS_LZMAWriteArrayDefinition(ARRAY_DEFINITION *array_definition, struct lzmafile *lzmafp)
Writes an array definition to an LZMA-compressed file.
Definition SDDS_write.c:722
int32_t SDDS_AllocateColumnFlags(SDDS_DATASET *SDDS_target)
int32_t SDDS_ReadBinaryRow(SDDS_DATASET *SDDS_dataset, int64_t row, int32_t skip)
Reads a binary row from the specified SDDS dataset.
int32_t SDDS_ProcessParameterDefinition(SDDS_DATASET *SDDS_dataset, char *s)
Process the parameter definition section of the SDDS dataset.
int32_t SDDS_ReadLayout(SDDS_DATASET *SDDS_dataset, FILE *fp)
Definition SDDS_input.c:517
int32_t SDDS_ReadNonNativeBinaryPageLastRows(SDDS_DATASET *SDDS_dataset, int64_t last_rows)
Reads the last few rows from a non-native endian binary page in an SDDS dataset.
int32_t SDDS1_ProcessAssociateDefinition(SDDS_DATASET *SDDS_dataset, char *s)
Processes and defines an associate within an SDDS dataset.
int32_t SDDS_ReadAsciiPageDetailed(SDDS_DATASET *SDDS_dataset, int64_t sparse_interval, int64_t sparse_offset, int64_t last_rows, int32_t sparse_statistics)
Reads a detailed page of data from an ASCII file into an SDDS dataset with optional sparsity and stat...
int32_t SDDS_ProcessAssociateDefinition(SDDS_DATASET *SDDS_dataset, char *s)
Process the associate definition section of the SDDS dataset.
FILE * SDDS1_ProcessIncludeCommand(SDDS_DATASET *SDDS_dataset, char *s)
Processes an include command by opening the specified file.
int32_t SDDS_WriteAsciiPage(SDDS_DATASET *SDDS_dataset)
Writes a page of data in ASCII format to the SDDS dataset.
Definition SDDS_ascii.c:410
int32_t SDDS_LZMAWriteColumnDefinition(COLUMN_DEFINITION *column, struct lzmafile *lzmafp)
Writes a column definition to an LZMA-compressed file.
Definition SDDS_write.c:356
char * SDDS_ReadBinaryString(FILE *fp, SDDS_FILEBUFFER *fBuffer, int32_t skip)
Reads a binary string from a file with buffering.
int32_t SDDS_LZMAWriteAsciiParameters(SDDS_DATASET *SDDS_dataset, struct lzmafile *lzmafp)
Writes the parameter data of an SDDS dataset in ASCII format to an LZMA compressed file.
Definition SDDS_ascii.c:565
int32_t SDDS_WriteAsciiRow(SDDS_DATASET *SDDS_dataset, int64_t row, FILE *fp)
Writes a single row of data in ASCII format to a file.
Definition SDDS_ascii.c:775
int32_t SDDS_WriteAsciiParameters(SDDS_DATASET *SDDS_dataset, FILE *fp)
Writes the parameter data of an SDDS dataset in ASCII format to a file.
Definition SDDS_ascii.c:531
int32_t SDDS_LZMAWriteBinaryString(char *string, struct lzmafile *lzmafp, SDDS_FILEBUFFER *fBuffer)
Writes a binary string to a file with LZMA compression.
char * fgetsLZMASkipCommentsResize(SDDS_DATASET *SDDS_dataset, char **s, int32_t *slen, struct lzmafile *lzmafp, char skip_char)
Reads a line from a LZMA-compressed file with dynamic buffer resizing while skipping comment lines.
int32_t SDDS_WriteAssociateDefinition(ASSOCIATE_DEFINITION *associate, FILE *fp)
Writes an associate definition to a standard file.
Definition SDDS_write.c:493
int32_t SDDS_ReadBinaryPageDetailed(SDDS_DATASET *SDDS_dataset, int64_t sparse_interval, int64_t sparse_offset, int64_t last_rows, int32_t sparse_statistics)
Reads a binary page from an SDDS dataset with detailed options.
int32_t SDDS_LZMAWriteDescription(char *description, char *contents, struct lzmafile *lzmafp)
Writes the SDDS description section to an LZMA-compressed file.
Definition SDDS_write.c:280
int32_t SDDS_UpdateBinaryPage(SDDS_DATASET *SDDS_dataset, uint32_t mode)
Updates the binary page of an SDDS dataset.
char * fgetsLZMASkipComments(SDDS_DATASET *SDDS_dataset, char *s, int32_t slen, struct lzmafile *lzmafp, char skip_char)
Reads a line from a LZMA-compressed file while skipping comment lines.
int32_t SDDS_ReadNonNativeBinaryColumns(SDDS_DATASET *SDDS_dataset)
Reads the non-native endian binary columns from an SDDS dataset.
int32_t SDDS_ReadAsciiPageLastRows(SDDS_DATASET *SDDS_dataset, int64_t last_rows)
Reads the last specified number of rows from an ASCII page of an SDDS dataset.
int32_t SDDS_AsciiDataExpected(SDDS_DATASET *SDDS_dataset)
Checks whether the SDDS dataset expects ASCII data input.
int32_t SDDS_ReadAsciiArrays(SDDS_DATASET *SDDS_dataset)
Reads the arrays from an ASCII file into the SDDS dataset.
void SDDS_FreePointerArray(void **data, int32_t dimensions, int32_t *dimension)
Frees a multi-dimensional pointer array created by SDDS_MakePointerArray.
int32_t SDDS_WriteVersion(int32_t version_number, FILE *fp)
Writes the SDDS protocol version to a standard file.
Definition SDDS_write.c:59
int32_t SDDS_LZMAWriteAsciiRow(SDDS_DATASET *SDDS_dataset, int64_t row, struct lzmafile *lzmafp)
Writes a single row of data in ASCII format to an LZMA compressed file.
Definition SDDS_ascii.c:826
int32_t SDDS_WriteBinaryParameters(SDDS_DATASET *SDDS_dataset)
Writes the binary parameters of the SDDS dataset.
int32_t SDDS_ReadNonNativePageLastRows(SDDS_DATASET *SDDS_dataset, int64_t last_rows)
Reads the last few rows from a non-native endian page in an SDDS dataset.
int32_t SDDS_ReadBinaryPage(SDDS_DATASET *SDDS_dataset, int64_t sparse_interval, int64_t sparse_offset, int32_t sparse_statistics)
Reads a binary page from an SDDS dataset.
int32_t SDDS1_ProcessDataMode(SDDS_DATASET *SDDS_dataset, char *s)
Processes and sets the data mode for an SDDS dataset.
FILE * SDDS_ProcessIncludeCommand(SDDS_DATASET *SDDS_dataset, char *s)
Process the include command within the SDDS dataset.
int32_t SDDS_ProcessDataMode(SDDS_DATASET *SDDS_dataset, char *s)
Process the data mode section of the SDDS dataset.
int32_t SDDS_WriteColumnDefinition(COLUMN_DEFINITION *column, FILE *fp)
Writes a column definition to a standard file.
Definition SDDS_write.c:329
int32_t SDDS_LZMAWriteDataMode(SDDS_LAYOUT *layout, struct lzmafile *lzmafp)
Writes the data mode section to an LZMA-compressed file.
Definition SDDS_write.c:614
void SDDS_FreeTableStrings(SDDS_DATASET *SDDS_dataset)
int32_t SDDS_WriteBinaryPage(SDDS_DATASET *SDDS_dataset)
int32_t SDDS_fseek(FILE *fp, int64_t offset, int32_t dir)
Sets the file position indicator for a given file stream with retry logic.
uint32_t SDDS_GetSpecialCommentsModes(SDDS_DATASET *SDDS_dataset)
Retrieves the current special comments modes set in the SDDS dataset.
int32_t SDDS_WriteNonNativeBinaryColumns(SDDS_DATASET *SDDS_dataset)
Writes non-native endian binary columns of an SDDS dataset to the associated file.
int32_t SDDS_LZMAReadLayout(SDDS_DATASET *SDDS_dataset, struct lzmafile *lzmafp)
Definition SDDS_input.c:680
int32_t SDDS_CopyParameter(SDDS_DATASET *SDDS_dataset, int32_t target, int32_t source)
Copies a parameter from a source index to a target index within an SDDS dataset.
int32_t SDDS_ProcessDescription(SDDS_DATASET *SDDS_dataset, char *s)
Process the description section of the SDDS dataset.
int32_t SDDS_WriteArrayDefinition(ARRAY_DEFINITION *array_definition, FILE *fp)
Writes an array definition to a standard file.
Definition SDDS_write.c:692
int32_t SDDS1_ProcessDescription(SDDS_DATASET *SDDS_dataset, char *s)
Process the description section for SDDS protocol version 1.
int32_t SDDS1_ProcessParameterDefinition(SDDS_DATASET *SDDS_dataset, char *s)
Processes and defines a parameter within an SDDS dataset.
void SDDS_ResetSpecialCommentsModes(SDDS_DATASET *SDDS_dataset)
Resets the special comments modes in the SDDS dataset.
int32_t SDDS_LZMAWriteAssociateDefinition(ASSOCIATE_DEFINITION *associate, struct lzmafile *lzmafp)
Writes an associate definition to an LZMA-compressed file.
Definition SDDS_write.c:520
void SDDS_ParseSpecialComments(SDDS_DATASET *SDDS_dataset, char *s)
Parses and processes special comment commands within the SDDS dataset.
int32_t SDDS_ReadNonNativePageDetailed(SDDS_DATASET *SDDS_dataset, uint32_t mode, int64_t sparse_interval, int64_t sparse_offset, int64_t last_rows)
Reads a detailed non-native endian page from an SDDS dataset.
int32_t SDDS_ReadAsciiParameters(SDDS_DATASET *SDDS_dataset)
Reads the parameters from an ASCII file into the SDDS dataset.
Definition SDDS_ascii.c:927
int32_t SDDS_ReadBinaryArrays(SDDS_DATASET *SDDS_dataset)
Reads binary arrays from an SDDS dataset.
int32_t SDDS_WriteDataMode(SDDS_LAYOUT *layout, FILE *fp)
Writes the data mode section to a standard file.
Definition SDDS_write.c:576
int32_t SDDS_WriteParameterDefinition(PARAMETER_DEFINITION *parameter, FILE *fp)
Writes a parameter definition to a standard file.
Definition SDDS_write.c:411
char * SDDS_command[SDDS_NUM_COMMANDS]
Array of supported SDDS command names.
Definition SDDS_data.c:81
int32_t SDDS_CopyColumn(SDDS_DATASET *SDDS_dataset, int32_t target, int32_t source)
Copies data from a source column to a target column within an SDDS dataset.
int32_t SDDS_LZMAWriteNonNativeBinaryString(char *string, struct lzmafile *lzmafp, SDDS_FILEBUFFER *fBuffer)
Writes a non-native endian binary string to an LZMA-compressed file.
int32_t SDDS_ReadBinaryPageLastRows(SDDS_DATASET *SDDS_dataset, int64_t last_rows)
Reads the last specified number of rows from a binary page of an SDDS dataset.
int32_t SDDS_ReadBinaryParameters(SDDS_DATASET *SDDS_dataset)
Reads binary parameters from the specified SDDS dataset.
int32_t SDDS_WriteDescription(char *description, char *contents, FILE *fp)
Writes the SDDS description section to a standard file.
Definition SDDS_write.c:256
int32_t SDDS_ProcessColumnDefinition(SDDS_DATASET *SDDS_dataset, char *s)
Process the column definition section of the SDDS dataset.
int32_t SDDS1_ProcessColumnDefinition(SDDS_DATASET *SDDS_dataset, char *s)
Processes and defines a column within an SDDS dataset.
int32_t SDDS_WriteAsciiArrays(SDDS_DATASET *SDDS_dataset, FILE *fp)
Writes the arrays of an SDDS dataset in ASCII format to a file.
Definition SDDS_ascii.c:635
int32_t SDDS_LZMAWriteParameterDefinition(PARAMETER_DEFINITION *parameter, struct lzmafile *lzmafp)
Writes a parameter definition to an LZMA-compressed file.
Definition SDDS_write.c:438
int32_t SDDS_AdvanceCounter(int32_t *counter, int32_t *max_count, int32_t n_indices)
Advances a multi-dimensional counter based on maximum counts for each dimension.