1
0
mirror of https://github.com/falk-werner/webfuse synced 2024-10-27 20:34:10 +00:00
falk-werner_webfuse/include/webfuse/provider/operation/open.h

64 lines
1.6 KiB
C
Raw Normal View History

2020-02-17 20:53:42 +00:00
////////////////////////////////////////////////////////////////////////////////
/// \file provider/operation/open.h
/// \brief Open a file.
////////////////////////////////////////////////////////////////////////////////
2019-03-26 22:04:53 +00:00
#ifndef WFP_OPERATION_OPEN_H
#define WFP_OPERATION_OPEN_H
2019-02-24 17:03:22 +00:00
#ifndef __cplusplus
#include <inttypes.h>
#else
#include <cinttypes>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
2019-03-26 22:04:53 +00:00
#include "webfuse/provider/api.h"
2019-02-24 17:03:22 +00:00
#ifdef __cplusplus
extern "C"
{
#endif
2019-03-26 22:04:53 +00:00
struct wfp_request;
2019-02-24 17:03:22 +00:00
2020-02-17 20:53:42 +00:00
//------------------------------------------------------------------------------
/// \brief Open a file.
///
/// \note After this function is called, exactly one response must be sent,
/// either via \ref wfp_respond_open or via \ref wfp_respond_error.
///
/// \param request pointer to request
/// \param inode inode of the file to open
/// \param flags file open flags
/// \param user_data user defined context
///
/// \see wfp_respond_open
/// \see wfp_respond_error
//------------------------------------------------------------------------------
2019-03-26 22:04:53 +00:00
typedef void wfp_open_fn(
struct wfp_request * request,
2019-02-24 17:03:22 +00:00
ino_t inode,
int flags,
void * user_data);
2020-02-17 20:53:42 +00:00
//------------------------------------------------------------------------------
/// \brief Respond to open file.
///
/// \param request pointer to request
/// \param handle handle of the opened file
//------------------------------------------------------------------------------
2019-03-26 22:04:53 +00:00
extern WFP_API void wfp_respond_open(
struct wfp_request * request,
2019-02-24 17:03:22 +00:00
uint32_t handle);
#ifdef __cplusplus
}
#endif
#endif