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 "parameter.h"
27 #include "handler.h"
28 
29 
30 
31 
32 #ifdef __cplusplus
33 extern "C"
34 {
35 #endif
36 
37 
46 GRASSROOTS_HANDLER_API Handler *GetResourceHandler (const Resource *resource_p, GrassrootsServer *server_p, const UserDetails *user_p);
47 
48 
55 GRASSROOTS_HANDLER_API bool InitHandlerUtil (void);
56 
57 
64 GRASSROOTS_HANDLER_API bool DestroyHandlerUtil (void);
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 */
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...
Handler * GetResourceHandler(const Resource *resource_p, GrassrootsServer *server_p, const UserDetails *user_p)
Get the appropriate Handler for a given Resource.
bool InitHandlerUtil(void)
This allocates the internal structures used by the Handler library.
bool DestroyHandlerUtil(void)
This frees the internal structures used by the Handler library.
A datatype to store user credentials.
Definition: user_details.h:76
Definition: grassroots_server.h:44
A Handler is a datatype for accessing data.
Definition: handler.h:72
A datatype representing a URI.
Definition: data_resource.h:40
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.