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