/// \brief Send SIONlib specific RPCs to the SIONfwd server
#ifdef __cplusplus
extern"C"{
#endif
/// \brief Constants used in the creation of bit-masks passed to `sionfwd_open`'s `flags` argument
/// \note Needs to stay in sync with `server.cxx`
enum{
SIONFWD_CREATE=1,
SIONFWD_WRITE=2,
SIONFWD_READ=4,
SIONFWD_CREATE=1,///< create the file if it does not exist, see POSIX `O_CREAT`
SIONFWD_WRITE=2,///< open the file for writing, see POSIX `O_RDWR`
SIONFWD_READ=4,///< open the file for reading, see POSIX `O_RDONLY`
};
/// \brief Open a file
/// \param[in] path Path to the file
/// \param[in] flags Determines the mode of opening the file, a bit mask that can contain combinations of \ref SIONFWD_CREATE, \ref SIONFWD_WRITE, \ref SIONFWD_READ
/// \returns `-1` on error, otherwise a file descriptor
/// \see Man page for POSIX `open(2)`
intsionfwd_open(constchar*,int);
/// \brief Close a file
/// \param[in] fd File descriptor of the file to close
/// \returns `0` on success, `-1` on error
/// \see Man page for POSIX `close(2)`
intsionfwd_close(int);
/// \brief Write data to a file at a position
/// \param[in] fd File descriptor of the file to write to
/// \param[in] buf Pointer to buffer containing the data to write
/// \param[in] nbyte Number of bytes to write
/// \param[in] offset Offset from the beginning of the file to start writing at (in bytes)
/// \returns `-1` on error, otherwise the number of bytes written