apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: apr_uri_string_encode/decode
Date Wed, 02 Aug 2006 11:58:22 GMT
On Wednesday 02 August 2006 11:58, david reid wrote:
> First pass at importing some apreq functions. Not yet had time to wirte
> a test! Rushing out of door, so just a quick mail :-)

fairy nuff1


> +/**
> + * @fn apr_size_t apr_uri_query_string_encode(char *dest, const char *src,
> +                                              const apr_size_t slen)
> + * @brief URI encode a query string
> + * @param dest the destination pointer
> + * @param src the source pointer
> + * @param slen length of source string
> + */
> +APU_DECLARE(apr_size_t) apr_uri_query_string_encode(char *, const char *,
> +                                                    const apr_size_t);

No pool, so this presumably requires the destination to be already
allocated.  Which in turn presumes a size computation (documentation?),
and the user has done most of the work!  Or am I missing something?

Also returning a size is not really APR-style, and is conspicuously at
variance with ...

> + * @fn apr_status_t apr_uri_query_string_decode(char *d, apr_size_t *dlen,
> +                                                const char *s,
> +                                                apr_size_t slen)
> + * @brief URI Decode a query string
> + * @param d destination pointer
> + * @param dlen length of created string
> + * @param s source pointer
> + * @param slen length of source string
> + */
> +APU_DECLARE(apr_status_t) apr_uri_query_string_decode(char *, apr_size_t
> *, +                                                      const char *, +  
>                                                    apr_size_t); +

Again no pool, though at least there's an easy size estimate this time:-)

No comments on the implementation - that requires more time&effort,
and since it's existing code it's presumably tried&tested.

-- 
Nick Kew

Mime
View raw message