apreq_param.c revision 6ac28b74a504006c016d4df3fb84d2cd2e373942
/*
** Licensed to the Apache Software Foundation (ASF) under one or more
** contributor license agreements. See the NOTICE file distributed with
** this work for additional information regarding copyright ownership.
** The ASF licenses this file to You under the Apache License, Version 2.0
** (the "License"); you may not use this file except in compliance with
** the License. You may obtain a copy of the License at
**
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
#include "apreq_param.h"
#include "apreq_error.h"
#include "apreq_util.h"
#include "apr_strings.h"
#include "apr_lib.h"
const char *name,
const apr_size_t nlen,
const char *val,
const apr_size_t vlen)
{
apreq_value_t *v;
return NULL;
*(const apreq_value_t **)&v = ¶m->v;
return param;
}
const char *word,
{
apreq_value_t *v;
apreq_param_t *p;
if (nlen == 0) {
return APR_EBADARG;
}
p->flags = 0;
*(const apreq_value_t **)&v = &p->v;
if (vlen > 0) {
if (status != APR_SUCCESS) {
return status;
}
}
else {
v->data[0] = 0;
v->dlen = 0;
}
if (status != APR_SUCCESS) {
return status;
}
case APREQ_CHARSET_UTF8:
if (charset == APREQ_CHARSET_ASCII)
case APREQ_CHARSET_ASCII:
break;
case APREQ_CHARSET_LATIN1:
if (charset != APREQ_CHARSET_CP1252)
break;
case APREQ_CHARSET_CP1252:
}
*param = p;
return APR_SUCCESS;
}
const apreq_param_t *param)
{
char *data;
return data;
}
apr_table_t *t,
const char *qs)
{
apr_size_t nlen = 0;
for (;;++qs) {
switch (*qs) {
case '=':
if (nlen == 0) {
}
break;
case '&':
case ';':
case 0:
apr_size_t vlen = 0;
apr_status_t s;
if (nlen == 0)
else
if (s != APR_SUCCESS)
return s;
apreq_value_table_add(¶m->v, t);
}
if (*qs == 0)
return APR_SUCCESS;
nlen = 0;
}
}
/* not reached */
return APR_INCOMPLETE;
}
{
return 1; /* keep going */
}
const apr_table_t *t,
const char *key)
{
sizeof(apreq_param_t *));
return arr;
}
const apr_table_t *t,
const char *key,
{
return apr_pstrdup(p, "");
++elt;
}
}
{
apr_table_t *t = data;
apreq_value_table_add(&p->v, t);
return 1; /* keep going */
}
{
return t;
}
{
const apreq_param_t **q = data;
*q = p;
return 0; /* upload found, stop */
}
else
return 1; /* keep searching */
}
const char *name)
{
return param;
}