/****************************************************************************
**  SIONLIB     http://www.fz-juelich.de/jsc/sionlib                       **
*****************************************************************************
**  Copyright (c) 2008-2019                                                **
**  Forschungszentrum Juelich, Juelich Supercomputing Centre               **
**                                                                         **
**  See the file COPYRIGHT in the package base directory for details       **
****************************************************************************/

#ifndef SION_SION_ENUMS_H
#define SION_SION_ENUMS_H

/// \defgroup constants Constants
/// @{
/// \ingroup common
/// \brief Constants for use throughout the SIONlib API

/// \brief specifies a low-level API to use for file system access
typedef enum {
  /// \brief the C standard library I/O API (`fopen()`, `fread()`, `fwrite()`, `fclose()`, etc.)
  SION_LOWLEVEL_API_C,
  /// \brief the POSIX I/O API (`open()`, `read()`, `write()`, `close()`, etc.)
  SION_LOWLEVEL_API_POSIX
} sion_lowlevel_api;

/// \brief specifies for what type of access to open a file
typedef enum {
  /// \brief open the file for reading only
  SION_OPEN_READ,
  /// \brief open the file for writing only
  SION_OPEN_WRITE
} sion_open_mode;

/// \brief specifies whether to use SIONlib's key-value mechanism for accessing file content and if so in what mode
typedef enum {
  /// \brief key-value mechanism with inline storage of meta-data
  SION_KEYVAL_MODE_INLINE,
  /// \brief not implemented
  SION_KEYVAL_MODE_META,
  /// \brief not implemented
  SION_KEYVAL_MODE_HASH,
  /// \brief when reading a file, learn appropriate mechanism from file header
  SION_KEYVAL_MODE_UNKNOWN,
  /// \brief do not use key-value mechanism
  SION_KEYVAL_MODE_NONE
} sion_keyval_mode;

/// \brief determines how offsets are interpreted for seek operations
typedef enum {
  /// \brief interpret the offset relative to the beginning of the file
  SION_SEEK_BEGINNING = 0,
  /// \brief interpret the offset relative to the current position in the file
  SION_SEEK_CURRENT,
  /// \brief interpret the offset relative to the end of the file
  SION_SEEK_END,
  /// \brief interpret the offset relative to the beginning of the current chunk
  SION_SEEK_CHUNK_BEGINNING,
  /// \brief interpret the offset relative to the end of the current chunk
  SION_SEEK_CHUNK_END,
} sion_seek_mode;

/// \brief declares the endianness of user data written to a file
typedef enum {
  /// \brief the user data is little endian
  SION_ENDIANNESS_LITTLE,
  /// \brief the user data is big endian
  SION_ENDIANNESS_BIG,
  /// \brief the user data has the endianness of the host system
  SION_ENDIANNESS_HOST,
} sion_endianness;

/// @}

#endif
