Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
|
Go to the documentation of this file.
21 #ifndef GRASSROOTS_HANDLE_H
22 #define GRASSROOTS_HANDLE_H
111 const char *(*ha_get_protocol_fn) (
struct Handler *handler_p);
120 const char *(*ha_get_name_fn) (
struct Handler *handler_p);
129 const char *(*ha_get_description_fn) (
struct Handler *handler_p);
294 bool (*init_fn) (
struct Handler *handler_p,
const User *user_p),
296 const char *(*get_protocol_fn) (
struct Handler *handler_p),
297 const char *(*get_name_fn) (
struct Handler *handler_p),
298 const char *(*get_description_fn) (
struct Handler *handler_p),
300 size_t (*read_fn) (
struct Handler *handler_p,
void *buffer_p,
const size_t length),
301 size_t (*write_fn) (
struct Handler *handler_p,
const void *buffer_p,
const size_t length),
302 bool (*seek_fn) (
struct Handler *handler_p,
long offset,
int whence),
303 bool (*close_fn) (
struct Handler *handler_p),
306 void (*free_handler_fn) (
struct Handler *handler_p));
DataResource * ha_resource_p
The current Resource for this Handler.
Definition: handler.h:230
bool(* ha_close_fn)(struct Handler *handler_p)
Close a Handler.
Definition: handler.h:195
const char * GetHandlerProtocol(struct Handler *handler_p)
Get the protocol of a Handler.
const char * GetHandlerName(struct Handler *handler_p)
Get the name of a Handler.
MEM_FLAG
An enum specifying the particular status of a piece of dynamically allocated memory for a particular ...
Definition: memory_allocations.h:38
bool(* ha_init_fn)(struct Handler *handler_p, const User *user_p)
Initialise a Handler ready for use.
Definition: handler.h:91
The Handler has reached the end of the stream.
Definition: handler.h:48
A datatype representing a URI.
Definition: data_resource.h:40
HandlerStatus GetHandlerStatus(struct Handler *handler_p)
Get the HandlerStatus of a Handler.
void(* ha_free_handler_fn)(struct Handler *handler_p)
Free a Handler.
Definition: handler.h:225
HandlerNode * AllocateHandlerNode(struct Handler *handler_p)
Allocate a HandlerNode for the given Handler.
HandlerStatus
An enumeration of the possible status values of a stream being used by a Handler.
Definition: handler.h:42
bool InitHandler(struct Handler *handler_p, const User *user_p)
Initialise a Handler ready for use.
size_t(* ha_write_fn)(struct Handler *handler_p, const void *buffer_p, const size_t length)
Write data from a buffer into a Handler.
Definition: handler.h:170
The Handler does not have an open stream.
Definition: handler.h:54
A datatype for storing a Handler on a LinkedList.
Definition: handler.h:246
bool(* ha_seek_fn)(struct Handler *handler_p, long offset, int whence)
Move a Handler to a new position in its stream.
Definition: handler.h:186
MEM_FLAG ha_resource_mem
The MEM_FLAG for the Handler's Resource.
Definition: handler.h:235
bool SeekHandler(struct Handler *handler_p, size_t offset, int whence)
Move a Handler to a new position in its stream.
void FreeHandlerNode(ListItem *node_p)
Free a HandlerNode.
bool(* ha_file_info_fn)(struct Handler *handler_p, FileInformation *info_p)
Calculate the FileInformation for the current Resource in use by a Handler.
Definition: handler.h:215
void InitialiseHandler(Handler *const handler_p, bool(*init_fn)(struct Handler *handler_p, const User *user_p), bool(*match_fn)(struct Handler *handler_p, const DataResource *resource_p), const char *(*get_protocol_fn)(struct Handler *handler_p), const char *(*get_name_fn)(struct Handler *handler_p), const char *(*get_description_fn)(struct Handler *handler_p), bool(*open_fn)(struct Handler *handler_p, DataResource *resource_p, MEM_FLAG resource_mem, const char *const mode_s), size_t(*read_fn)(struct Handler *handler_p, void *buffer_p, const size_t length), size_t(*write_fn)(struct Handler *handler_p, const void *buffer_p, const size_t length), bool(*seek_fn)(struct Handler *handler_p, long offset, int whence), bool(*close_fn)(struct Handler *handler_p), HandlerStatus(*status_fn)(struct Handler *handler_p), bool(*file_info_fn)(struct Handler *handler_p, FileInformation *info_p), void(*free_handler_fn)(struct Handler *handler_p))
Initialise a Handler from a loaded Plugin.
bool(* ha_match_fn)(struct Handler *handler_p, const DataResource *resource_p)
Determine if the Handler is designed for a given Resource.
Definition: handler.h:100
bool IsHandlerForResource(struct Handler *handler_p, const DataResource *resource_p)
Determine if the Handler is designed for a given Resource.
bool CloseHandler(struct Handler *handler_p)
Close a Handler.
bool DeallocatePluginHandler(Plugin *const plugin_p)
Free the Plugin associated with a Handler.
ListItem hn_node
The base list node.
Definition: handler.h:249
A Plugin is a dynamically-loaded component to provide a piece of functionality.
Definition: plugin.h:150
Handler * hn_handler_p
The Handler.
Definition: handler.h:252
void FreeHandler(struct Handler *handler_p)
Free a Handler.
struct Plugin * ha_plugin_p
The platform-specific plugin that the code for the Client is stored in.
Definition: handler.h:78
bool CalculateFileInformationFromHandler(struct Handler *handler_p, FileInformation *info_p)
Calculate the FileInformation for the current Resource in use by a Handler.
const char * GetHandlerDescription(struct Handler *handler_p)
Get the description of a Handler.
Definition: grassroots_server.h:45
The Handler has encountered an error using the stream.
Definition: handler.h:51
size_t WriteToHandler(struct Handler *handler_p, const void *buffer_p, const size_t length)
Write data from a buffer into a Handler.
size_t(* ha_read_fn)(struct Handler *handler_p, void *buffer_p, const size_t length)
Read data from a Handler into a buffer.
Definition: handler.h:156
bool OpenHandler(struct Handler *handler_p, DataResource *resource_p, MEM_FLAG resource_mem, const char *const mode_s)
Open a Resource with the Handler.
A datatype to store user credentials.
Definition: user_details.h:40
HandlerStatus(* ha_status_fn)(struct Handler *handler_p)
Get the HandlerStatus of a Handler.
Definition: handler.h:205
struct GrassrootsServer * GetGrassrootsServerFromHandler(const Handler *const handler_p)
A Handler is a datatype for accessing data.
Definition: handler.h:72
The stream is in a valid state.
Definition: handler.h:45
Handler * GetHandlerFromPlugin(Plugin *const plugin_p, const User *user_p, struct GrassrootsServer *grassroots_p)
Load a Handler from a Plugin.
#define GRASSROOTS_HANDLER_API
Definition: grassroots_handler_library.h:46
bool(* ha_open_fn)(struct Handler *handler_p, DataResource *resource_p, MEM_FLAG resource_mem, const char *const mode_s)
Open a Resource with the Handler.
Definition: handler.h:142
size_t ReadFromHandler(struct Handler *handler_p, void *buffer_p, const size_t length)
Read data from a Handler into a buffer.
A doubly-linked node that points to its predecessor and successor.
Definition: linked_list.h:43