10 #define _XOPEN_SOURCE 700
15 #include "sion_common.h"
16 #include "sion_debug.h"
17 #include "sion_enums.h"
18 #include "sion_internal.h"
19 #include "sion_serial.h"
25 *options = SION_OPTIONS_INIT;
37 options->chunksizes = chunksizes;
38 options->n_chunksizes = n;
43 options->fsblksize = fsblksize;
48 options->keyval_mode = keyval_mode;
53 options->lowlevel_api = lowlevel_api;
58 options->endianness = endianness;
63 sion_options options = (options_) ? *options_ : SION_OPTIONS_INIT;
67 DPRINTFP((1, __func__, 0,
"enter open of file %s\n", fname));
68 int sid = (mode ==
SION_OPEN_WRITE) ? _sion_open_write(fname, n, &options)
69 : _sion_open_read(fname, _SION_READ_ALL_OF_MULTI_FILES, &options);
73 DPRINTFP((1, __func__, 0,
"leave open of file %s sid=%d\n", fname, sid));
82 *options = SION_RANK_OPTIONS_INIT;
94 options->lowlevel_api = lowlevel_api;
99 return _sion_open_rank(fname, mode, rank, (options) ? options : &SION_RANK_OPTIONS_INIT);
105 DPRINTFP((1,
"sion_close", -1,
"enter close sid=%d\n", sid));
106 rc = _sion_close_sid(sid);
107 DPRINTFP((1,
"sion_close", -1,
"leave close sid=%d\n", sid));
sion_open_mode
specifies for what type of access to open a file
sion_lowlevel_api
specifies a low-level API to use for file system access
sion_endianness
declares the endianness of user data written to a file
sion_keyval_mode
specifies whether to use SIONlib's key-value mechanism for accessing file content and if so in what m...
@ SION_OPEN_WRITE
open the file for writing only
int sion_open_rank(const char *fname, sion_open_mode mode, int rank, const sion_rank_options *options)
Open a single logical file in a SIONlib container.
void sion_options_set_fsblksize(sion_options *options, int32_t fsblksize)
Set the file system block size to assume.
sion_options * sion_options_new(void)
Allocates and initializes an instance of sion_options
void sion_options_delete(sion_options *options)
Delete an instance of sion_options
struct sion_rank_options sion_rank_options
Holds non-essential arguments for sion_open_rank().
sion_rank_options * sion_rank_options_new(void)
Allocates and initializes an instance of sion_rank_options
void sion_options_set_chunksizes(sion_options *options, int n, const int64_t chunksizes[])
Set the chunk sizes of all logical files in the container.
void sion_options_set_endianness(sion_options *options, sion_endianness endianness)
Set the endianness for the contents of a container.
void sion_rank_options_set_lowlevel_api(sion_rank_options *options, sion_lowlevel_api lowlevel_api)
Set the low-level API to use for opening a container.
void sion_rank_options_delete(sion_rank_options *options)
Delete an instance of sion_rank_options
void sion_options_set_keyval_mode(sion_options *options, sion_keyval_mode keyval_mode)
Set the key-value mode to use for a container.
void sion_options_set_lowlevel_api(sion_options *options, sion_lowlevel_api lowlevel_api)
Set the low-level API to use for opening a container.
int sion_close(int sid)
Close a SIONlib file.
struct sion_options sion_options
Holds non-essential arguments for sion_open().
int sion_open(const char *fname, sion_open_mode mode, int n, const sion_options *options_)
Open a SIONlib container in serial mode.