00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 #ifndef APREQ_PARAM_H
00060 #define APREQ_PARAM_H
00061
00062 #include "apreq.h"
00063 #include "apreq_parsers.h"
00064
00065 #ifdef __cplusplus
00066 extern "C" {
00067 #endif
00068
00069
00082 typedef struct apreq_param_t {
00083 apr_table_t *info;
00084 apr_bucket_brigade *bb;
00085 apreq_value_t v;
00086 } apreq_param_t;
00087
00089 #define apreq_value_to_param(ptr) apreq_attr_to_type(apreq_param_t, v, ptr)
00090 #define apreq_param_name(p) ((p)->v.name)
00091 #define apreq_param_value(p) ((p)->v.data)
00092 #define apreq_param_info(p) ((p)->info)
00093 #define apreq_param_status(p) ((p)->v.status)
00094 #define apreq_param_brigade(p) ((p)->bb ? apreq_copy_brigade((p)->bb) : NULL)
00095
00097 APREQ_DECLARE(apreq_param_t *) apreq_make_param(apr_pool_t *p,
00098 const char *name,
00099 const apr_size_t nlen,
00100 const char *val,
00101 const apr_size_t vlen);
00102
00104 typedef struct apreq_request_t {
00105 apr_table_t *args;
00106 apr_table_t *body;
00107 apreq_parser_t *parser;
00108 apreq_cfg_t *cfg;
00109 void *env;
00110 } apreq_request_t;
00111
00112
00129 APREQ_DECLARE(apreq_request_t *)apreq_request(void *env, const char *qs);
00130
00131
00141 APREQ_DECLARE(apreq_param_t *) apreq_param(const apreq_request_t *req,
00142 const char *name);
00143
00153 APREQ_DECLARE(apr_table_t *) apreq_params(apr_pool_t *p,
00154 const apreq_request_t *req);
00155
00156
00165 #define apreq_params_as_string(req,key,pool, mode) \
00166 apreq_join(pool, ", ", apreq_params(req,pool,key), mode)
00167
00168
00180 APREQ_DECLARE(apreq_param_t *) apreq_decode_param(apr_pool_t *pool,
00181 const char *word,
00182 const apr_size_t nlen,
00183 const apr_size_t vlen);
00188 APREQ_DECLARE(char *) apreq_encode_param(apr_pool_t *pool,
00189 const apreq_param_t *param);
00190
00202 APREQ_DECLARE(apr_status_t) apreq_parse_query_string(apr_pool_t *pool,
00203 apr_table_t *t,
00204 const char *qs);
00205
00221 APREQ_DECLARE(apr_status_t)apreq_parse_request(apreq_request_t *req,
00222 apr_bucket_brigade *bb);
00229 APREQ_DECLARE(apr_table_t *) apreq_uploads(apr_pool_t *pool,
00230 const apreq_request_t *req);
00231
00237 APREQ_DECLARE(apreq_param_t *) apreq_upload(const apreq_request_t *req,
00238 const char *key);
00239
00240 APREQ_DECLARE(apr_status_t)
00241 apreq_request_config(apreq_request_t *req,
00242 const char *attr, apr_size_t alen,
00243 const char *val, apr_size_t vlen);
00244
00246 #ifdef __cplusplus
00247 }
00248 #endif
00249
00250
00251 #endif
00252
00253
00254