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 "string_array.h"
13 #include "opensrf/utils.h"
15 #ifndef APACHE_TOOLS_H
16 #define APACHE_TOOLS_H
19 /* parses apache URL params (GET and POST).
20 Returns a string_array of the form [ key, val, key, val, ...]
21 Returns NULL if there are no params */
22 string_array* apacheParseParms(request_rec* r);
24 /* provide the params string array, and this will generate a
25 string of array of param keys
26 the returned string_array most be freed by the caller
28 string_array* apacheGetParamKeys(string_array* params);
30 /* provide the params string array and a key name, and
31 this will provide the value found for that key
32 the returned string_array most be freed by the caller
34 string_array* apacheGetParamValues(string_array* params, char* key);
36 /* returns the first value found for the given param.
37 char* must be freed by the caller */
38 char* apacheGetFirstParamValue(string_array* params, char* key);
40 /* Writes msg to stderr, flushes stderr, and returns 0 */
41 int apacheDebug( char* msg, ... );
43 /* Writes to stderr, flushe stderr, and returns HTTP_INTERNAL_SERVER_ERROR;
45 int apacheError( char* msg, ... );