2 #include "http_config.h"
4 #include "http_protocol.h"
5 //#include "apr_compat.h"
6 #include "apr_strings.h"
7 #include "apr_reslist.h"
11 #include "opensrf/string_array.h"
12 #include "opensrf/utils.h"
13 #include "opensrf/log.h"
15 #ifndef APACHE_TOOLS_H
16 #define APACHE_TOOLS_H
18 #define APACHE_TOOLS_MAX_POST_SIZE 10485760 /* 10 MB */
21 /* parses apache URL params (GET and POST).
22 Returns a string_array of the form [ key, val, key, val, ...]
23 Returns NULL if there are no params */
24 string_array* apacheParseParms(request_rec* r);
26 /* provide the params string array, and this will generate a
27 string of array of param keys
28 the returned string_array most be freed by the caller
30 string_array* apacheGetParamKeys(string_array* params);
32 /* provide the params string array and a key name, and
33 this will provide the value found for that key
34 the returned string_array most be freed by the caller
36 string_array* apacheGetParamValues(string_array* params, char* key);
38 /* returns the first value found for the given param.
39 char* must be freed by the caller */
40 char* apacheGetFirstParamValue(string_array* params, char* key);
42 /* Writes msg to stderr, flushes stderr, and returns 0 */
43 int apacheDebug( char* msg, ... );
45 /* Writes to stderr, flushe stderr, and returns HTTP_INTERNAL_SERVER_ERROR;
47 int apacheError( char* msg, ... );
50 * Creates an apache table* of cookie name / value pairs
53 apr_table_t* apacheParseCookies(request_rec *r);