]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/gateway/apachetools.h
initial steps toward OS X portage
[OpenSRF.git] / src / gateway / apachetools.h
1 #include "httpd.h"
2 #include "http_config.h"
3 #include "http_core.h"
4 #include "http_protocol.h"
5 //#include "apr_compat.h"
6 #include "apr_strings.h"
7 #include "apr_reslist.h"
8 #include "http_log.h"
9
10
11 #include "opensrf/string_array.h"
12 #include "opensrf/utils.h"
13 #include "opensrf/log.h"
14
15 #ifndef APACHE_TOOLS_H
16 #define APACHE_TOOLS_H
17
18 #define APACHE_TOOLS_MAX_POST_SIZE 10485760 /* 10 MB */
19
20
21 /* parses apache URL params (GET and POST).  
22         Returns a osrfStringArray of the form [ key, val, key, val, ...]
23         Returns NULL if there are no params */
24 osrfStringArray* apacheParseParms(request_rec* r);
25
26 /* provide the params string array, and this will generate a 
27         string of array of param keys 
28         the returned osrfStringArray most be freed by the caller
29         */
30 osrfStringArray* apacheGetParamKeys(osrfStringArray* params);
31
32 /* provide the params string array and a key name, and 
33         this will provide the value found for that key 
34         the returned osrfStringArray most be freed by the caller
35         */
36 osrfStringArray* apacheGetParamValues(osrfStringArray* params, char* key);
37
38 /* returns the first value found for the given param.  
39         char* must be freed by the caller */
40 char* apacheGetFirstParamValue(osrfStringArray* params, char* key);
41
42 /* Writes msg to stderr, flushes stderr, and returns 0 */
43 int apacheDebug( char* msg, ... );
44
45 /* Writes to stderr, flushe stderr, and returns HTTP_INTERNAL_SERVER_ERROR; 
46  */
47 int apacheError( char* msg, ... );
48
49 /*
50  * Creates an apache table* of cookie name / value pairs 
51  */
52 /*
53 apr_table_t* apacheParseCookies(request_rec *r);
54 */
55
56
57 #endif