Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
apr_encode.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
21 #ifndef APR_ENCODE_H
22 #define APR_ENCODE_H
23 
24 #include "apr.h"
25 #include "apr_general.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
105 #define APR_ENCODE_STRING (-1)
106 
110 #define APR_ENCODE_NONE 0
111 
115 #define APR_ENCODE_RELAXED 1
116 
120 #define APR_ENCODE_NOPADDING 2
121 
125 #define APR_ENCODE_URL 4
126 
130 #define APR_ENCODE_BASE64URL (APR_ENCODE_NOPADDING | APR_ENCODE_URL)
131 
135 #define APR_ENCODE_BASE32HEX 8
136 
140 #define APR_ENCODE_COLON 16
141 
145 #define APR_ENCODE_LOWER 32
146 
162 APR_DECLARE(apr_status_t) apr_encode_base64(char *dest, const char *src,
163  apr_ssize_t slen, int flags, apr_size_t * len);
164 
179 APR_DECLARE(apr_status_t) apr_encode_base64_binary(char *dest, const unsigned char *src,
180  apr_ssize_t slen, int flags, apr_size_t * len);
181 
197 APR_DECLARE(const char *)apr_pencode_base64(apr_pool_t * p, const char *src,
198  apr_ssize_t slen, int flags, apr_size_t * len)__attribute__((nonnull(1)));
199 
214 APR_DECLARE(const char *)apr_pencode_base64_binary(apr_pool_t * p, const unsigned char *src,
215  apr_ssize_t slen, int flags, apr_size_t * len)__attribute__((nonnull(1)));
216 
232 APR_DECLARE(apr_status_t) apr_decode_base64(char *dest, const char *src,
233  apr_ssize_t slen, int flags, apr_size_t * len);
234 
251  const char *src, apr_ssize_t slen, int flags, apr_size_t * len);
252 
268 APR_DECLARE(const char *)apr_pdecode_base64(apr_pool_t * p, const char *src,
269  apr_ssize_t slen, int flags, apr_size_t * len)
270  __attribute__((nonnull(1)));
271 
287 APR_DECLARE(const unsigned char *)apr_pdecode_base64_binary(apr_pool_t * p,
288  const char *src, apr_ssize_t slen, int flags, apr_size_t * len)
289  __attribute__((nonnull(1)));
290 
305 APR_DECLARE(apr_status_t) apr_encode_base32(char *dest, const char *src,
306  apr_ssize_t slen, int flags, apr_size_t * len);
307 
321 APR_DECLARE(apr_status_t) apr_encode_base32_binary(char *dest, const unsigned char *src,
322  apr_ssize_t slen, int flags, apr_size_t * len);
323 
338 APR_DECLARE(const char *)apr_pencode_base32(apr_pool_t * p, const char *src,
339  apr_ssize_t slen, int flags, apr_size_t * len)
340  __attribute__((nonnull(1)));
341 
355 APR_DECLARE(const char *)apr_pencode_base32_binary(apr_pool_t * p, const unsigned char *src,
356  apr_ssize_t slen, int flags, apr_size_t * len)
357  __attribute__((nonnull(1)));
358 
373 APR_DECLARE(apr_status_t) apr_decode_base32(char *dest, const char *src,
374  apr_ssize_t slen, int flags, apr_size_t * len);
375 
391  const char *src, apr_ssize_t slen, int flags, apr_size_t * len);
392 
407 APR_DECLARE(const char *)apr_pdecode_base32(apr_pool_t * p, const char *src,
408  apr_ssize_t slen, int flags, apr_size_t * len)
409  __attribute__((nonnull(1)));
410 
425 APR_DECLARE(const unsigned char *)apr_pdecode_base32_binary(apr_pool_t * p,
426  const char *src, apr_ssize_t slen, int flags, apr_size_t * len)
427  __attribute__((nonnull(1)));
428 
442 APR_DECLARE(apr_status_t) apr_encode_base16(char *dest, const char *src,
443  apr_ssize_t slen, int flags, apr_size_t * len);
444 
458  const unsigned char *src, apr_ssize_t slen, int flags,
459  apr_size_t * len);
460 
475 APR_DECLARE(const char *)apr_pencode_base16(apr_pool_t * p, const char *src,
476  apr_ssize_t slen, int flags, apr_size_t * len)
477  __attribute__((nonnull(1)));
478 
493  const unsigned char *src, apr_ssize_t slen,
494  int flags, apr_size_t * len)__attribute__((nonnull(1)));
495 
510 APR_DECLARE(apr_status_t) apr_decode_base16(char *dest, const char *src,
511  apr_ssize_t slen, int flags, apr_size_t * len);
512 
528  const char *src, apr_ssize_t slen, int flags, apr_size_t * len);
529 
543 APR_DECLARE(const char *)apr_pdecode_base16(apr_pool_t * p, const char *src,
544  apr_ssize_t slen, int flags, apr_size_t * len)
545  __attribute__((nonnull(1)));
546 
560 APR_DECLARE(const unsigned char *)apr_pdecode_base16_binary(apr_pool_t * p,
561  const char *src, apr_ssize_t slen, int flags, apr_size_t * len)
562  __attribute__((nonnull(1)));
563 
565 #ifdef __cplusplus
566 }
567 #endif
568 
569 #endif /* !APR_ENCODE_H */
const char * apr_pencode_base64_binary(apr_pool_t *p, const unsigned char *src, apr_ssize_t slen, int flags, apr_size_t *len) __attribute__((nonnull(1)))
size_t apr_size_t
Definition: apr.h:393
apr_status_t apr_decode_base32_binary(unsigned char *dest, const char *src, apr_ssize_t slen, int flags, apr_size_t *len)
apr_status_t apr_encode_base64(char *dest, const char *src, apr_ssize_t slen, int flags, apr_size_t *len)
const char * apr_pencode_base32_binary(apr_pool_t *p, const unsigned char *src, apr_ssize_t slen, int flags, apr_size_t *len) __attribute__((nonnull(1)))
const char * apr_pencode_base32(apr_pool_t *p, const char *src, apr_ssize_t slen, int flags, apr_size_t *len) __attribute__((nonnull(1)))
apr_status_t apr_encode_base32(char *dest, const char *src, apr_ssize_t slen, int flags, apr_size_t *len)
apr_status_t apr_decode_base32(char *dest, const char *src, apr_ssize_t slen, int flags, apr_size_t *len)
const char * apr_pencode_base64(apr_pool_t *p, const char *src, apr_ssize_t slen, int flags, apr_size_t *len) __attribute__((nonnull(1)))
const char * apr_pdecode_base32(apr_pool_t *p, const char *src, apr_ssize_t slen, int flags, apr_size_t *len) __attribute__((nonnull(1)))
apr_status_t apr_decode_base64(char *dest, const char *src, apr_ssize_t slen, int flags, apr_size_t *len)
APR Miscellaneous library routines.
apr_status_t apr_encode_base64_binary(char *dest, const unsigned char *src, apr_ssize_t slen, int flags, apr_size_t *len)
const unsigned char * apr_pdecode_base16_binary(apr_pool_t *p, const char *src, apr_ssize_t slen, int flags, apr_size_t *len) __attribute__((nonnull(1)))
dav_error * src
Definition: mod_dav.h:186
APR Platform Definitions.
const char * apr_pencode_base16_binary(apr_pool_t *p, const unsigned char *src, apr_ssize_t slen, int flags, apr_size_t *len) __attribute__((nonnull(1)))
apr_status_t apr_decode_base16(char *dest, const char *src, apr_ssize_t slen, int flags, apr_size_t *len)
apr_status_t apr_encode_base16_binary(char *dest, const unsigned char *src, apr_ssize_t slen, int flags, apr_size_t *len)
const unsigned char * apr_pdecode_base32_binary(apr_pool_t *p, const char *src, apr_ssize_t slen, int flags, apr_size_t *len) __attribute__((nonnull(1)))
const char * apr_pdecode_base16(apr_pool_t *p, const char *src, apr_ssize_t slen, int flags, apr_size_t *len) __attribute__((nonnull(1)))
apr_pool_t * p
const char * apr_pdecode_base64(apr_pool_t *p, const char *src, apr_ssize_t slen, int flags, apr_size_t *len) __attribute__((nonnull(1)))
#define APR_DECLARE(x)
Definition: macros.h:6
apr_status_t apr_decode_base64_binary(unsigned char *dest, const char *src, apr_ssize_t slen, int flags, apr_size_t *len)
apr_status_t apr_encode_base32_binary(char *dest, const unsigned char *src, apr_ssize_t slen, int flags, apr_size_t *len)
ssize_t apr_ssize_t
Definition: apr.h:394
#define __attribute__(__x)
Definition: apr.h:63
apr_status_t apr_decode_base16_binary(unsigned char *dest, const char *src, apr_ssize_t slen, int flags, apr_size_t *len)
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
int apr_status_t
Definition: apr_errno.h:44
const unsigned char * apr_pdecode_base64_binary(apr_pool_t *p, const char *src, apr_ssize_t slen, int flags, apr_size_t *len) __attribute__((nonnull(1)))
dav_resource int dav_locktoken dav_response int flags
Definition: mod_dav.h:1452
const char * apr_pencode_base16(apr_pool_t *p, const char *src, apr_ssize_t slen, int flags, apr_size_t *len) __attribute__((nonnull(1)))
apr_status_t apr_encode_base16(char *dest, const char *src, apr_ssize_t slen, int flags, apr_size_t *len)