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.
handler_utils.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2016 The Earlham Institute
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 
21 #ifndef HANDLE_UTILS_H
22 #define HANDLE_UTILS_H
23 
24 
26 #include "handler.h"
27 #include "user_details.h"
28 #include "grassroots_server.h"
29 
30 
31 
32 #ifdef __cplusplus
33 extern "C"
34 {
35 #endif
36 
37 
46 GRASSROOTS_HANDLER_API Handler *GetResourceHandler (const DataResource *resource_p, struct GrassrootsServer *server_p, const User *user_p);
47 
48 
56 
57 
65 
66 
78 GRASSROOTS_HANDLER_API const char *GetMappedFilename (const char *protocol_s, const char *user_id_s, const char *filename_s, time_t *time_p);
79 
80 
92 GRASSROOTS_HANDLER_API bool SetMappedFilename (const char *protocol_s, const char *user_id_s, const char *filename_s, const char *mapped_filename_s, const time_t last_mod_time);
93 
94 
95 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #endif /* #ifndef HANDLE_UTILS_H */
DataResource
A datatype representing a URI.
Definition: data_resource.h:40
handler.h
GetMappedFilename
const char * GetMappedFilename(const char *protocol_s, const char *user_id_s, const char *filename_s, time_t *time_p)
Create a local file for caching changes to a remote file allowing changes to be committed once editin...
grassroots_server.h
grassroots_handler_library.h
InitHandlerUtil
bool InitHandlerUtil(void)
This allocates the internal structures used by the Handler library.
GetResourceHandler
Handler * GetResourceHandler(const DataResource *resource_p, struct GrassrootsServer *server_p, const User *user_p)
Get the appropriate Handler for a given Resource.
DestroyHandlerUtil
bool DestroyHandlerUtil(void)
This frees the internal structures used by the Handler library.
GrassrootsServer
Definition: grassroots_server.h:45
User
A datatype to store user credentials.
Definition: user_details.h:40
user_details.h
SetMappedFilename
bool SetMappedFilename(const char *protocol_s, const char *user_id_s, const char *filename_s, const char *mapped_filename_s, const time_t last_mod_time)
Store the details of an external file and its locally-mapped copy.
Handler
A Handler is a datatype for accessing data.
Definition: handler.h:72
GRASSROOTS_HANDLER_API
#define GRASSROOTS_HANDLER_API
Definition: grassroots_handler_library.h:46