forked from UtrechtUniversity/davrods
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcommon.h
87 lines (57 loc) · 2.88 KB
/
common.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/**
* \file
* \brief Common includes, functions and variables.
* \author Chris Smeele
* \copyright Copyright (c) 2016, Utrecht University
*
* This file is part of Davrods.
*
* Davrods is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* Davrods is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
* for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Davrods. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _DAVRODS_COMMON_H_
#define _DAVRODS_COMMON_H_
#include "apr_buckets.h"
#include "mod_davrods.h"
#include "config.h"
#include "irods/rodsClient.h"
#include "irods/miscUtil.h"
#include "apr_tables.h"
// I'm not sure why, but the format string apr.h generates on my machine (%lu)
// causes compiler warnings. It seems that gcc wants us to use 'llu' instead,
// however the apr sprintf function does not support the long-long notation.
// -Wformat warnings related to %lu parameters can probably be ignored.
#define DAVRODS_SIZE_T_FMT APR_SIZE_T_FMT
//#define DAVRODS_SIZE_T_FMT "llu"
/**
* \brief Get the iRODS error message for the given iRODS status code.
*
* \param rods_error_code
*
* \return an error description provided by iRODS
*/
const char *get_rods_error_msg(int rods_error_code);
void davrods_dav_register(apr_pool_t *p);
void CloseBucketsStream (apr_bucket_brigade *bucket_brigade_p);
apr_status_t PrintBasicStringToBucketBrigade (const char *value_s, apr_bucket_brigade *brigade_p, request_rec *req_p, const char *file_s, const int line);
apr_status_t PrintFileToBucketBrigade (const char *filename_s, apr_bucket_brigade *brigade_p, request_rec *req_p, const char *file_s, const int line);
apr_status_t PrintWebResponseToBucketBrigade (const char *uri_s, char *current_id_s, apr_bucket_brigade *brigade_p, rcComm_t *connection_p, request_rec *req_p, const char *file_s, const int line);
rcComm_t *GetIRODSConnectionFromPool (apr_pool_t *pool_p);
rcComm_t *GetIRODSConnectionForPublicUser (request_rec *req_p, apr_pool_t *davrods_pool_p, davrods_dir_conf_t *conf_p);
rcComm_t *GetIRODSConnectionFromRequest (request_rec *req_p);
rodsEnv *GetRodsEnvFromPool (apr_pool_t *pool_p);
const char *GetUsernameFromPool (apr_pool_t *pool_p);
apr_table_t *MergeAPRTables (apr_table_t *table1_p, apr_table_t *table2_p, apr_pool_t *pool_p);
const char *GetParameterValue (apr_table_t *params_p, const char * const param_s, apr_pool_t *pool_p);
char *GetChecksum (collEnt_t *coll_entry_p, rcComm_t *connection_p, apr_pool_t *pool_p);
#endif /* _DAVRODS_COMMON_H_ */