StateFS
 All Classes Files Functions Variables Typedefs Enumerations Groups Pages
Public Attributes | List of all members
statefs_io Struct Reference

#include <provider.h>

Public Attributes

int(* getattr )(struct statefs_property const *)
 
statefs_ssize_t(* size )(struct statefs_property const *)
 
statefs_handle_t(* open )(struct statefs_property *self, int flags)
 
int(* read )(statefs_handle_t h, char *dst, statefs_size_t len, statefs_off_t off)
 
int(* write )(statefs_handle_t, char const *, statefs_size_t, statefs_off_t)
 
void(* close )(statefs_handle_t)
 
bool(* connect )(struct statefs_property *, struct statefs_slot *)
 
void(* disconnect )(struct statefs_property *)
 

Detailed Description

API to access properties. The API itself can be accessed concurently but access to separate properties and opened property handles is serialized.

Member Data Documentation

void(* statefs_io::close)(statefs_handle_t)

close I/O handle

bool(* statefs_io::connect)(struct statefs_property *, struct statefs_slot *)

connect discrete property to server slot, provider should invoke statefs_slot.on_changed() when property value is changed

Note
only single connection is opened for single property, so if called several times provider can just replace previous slot value
void(* statefs_io::disconnect)(struct statefs_property *)

disconnect previously connected slot

int(* statefs_io::getattr)(struct statefs_property const *)

get property attributes

Return values
maskSTATEFS_ATTR_DISCRETE | STATEFS_ATTR_WRITE | STATEFS_ATTR_READ
statefs_handle_t(* statefs_io::open)(struct statefs_property *self, int flags)

open property for I/O

Parameters
flags[O_RDONLY, O_RDWR, O_WRONLY]
Return values
opaquehandle to be used for I/O operations
int(* statefs_io::read)(statefs_handle_t h, char *dst, statefs_size_t len, statefs_off_t off)

read property value (len bytes starting from off)

statefs_ssize_t(* statefs_io::size)(struct statefs_property const *)

get property size. If property length is variable it is better to return maximum property size

int(* statefs_io::write)(statefs_handle_t, char const *, statefs_size_t, statefs_off_t)

write property value (len bytes starting from off)


The documentation for this struct was generated from the following file: