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

#ifndef SION_SION_KEYVALUE_H
#define SION_SION_KEYVALUE_H

/// \cond sion_internal
/// \file

#include <stddef.h>
#include <stdint.h>

#include "sion_common.h"
#include "sion_filedesc.h"

int _lsion_keyval_check_env(_sion_filedesc *sion_filedesc, int64_t file_mode_flags);
int _lsion_keyval_dup_dataptr(_sion_filedesc *sion_filedesc, _sion_filedesc *new_filedesc);

int _lsion_store_and_write_key_and_len(_sion_filedesc *sion_filedesc, uint64_t key, size_t len);
int _lsion_write_value(_sion_filedesc *sion_filedesc, const void *data, uint64_t key, size_t len);

int _lsion_find_and_read_key_and_len(_sion_filedesc *sion_filedesc, uint64_t key, size_t len, size_t *datalen);
int _lsion_read_value(_sion_filedesc *sion_filedesc, void *data, uint64_t key, size_t len);

/// \endcond

#endif
