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