Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
apr_base64.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  * The apr_vsnprintf/apr_snprintf functions are based on, and used with the
16  * permission of, the SIO stdio-replacement strx_* functions by Panos
17  * Tsirigotis <panos@alumni.cs.colorado.edu> for xinetd.
18  */
19 
24 #ifndef APR_BASE64_H
25 #define APR_BASE64_H
26 
27 #include "apu.h"
28 #include "apr_general.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
40 /* Simple BASE64 encode/decode functions.
41  *
42  * As we might encode binary strings, hence we require the length of
43  * the incoming plain source. And return the length of what we decoded.
44  *
45  * The decoding function takes any non valid char (i.e. whitespace, \0
46  * or anything non A-Z,0-9 etc) as terminal.
47  *
48  * The handling of terminating \0 characters differs from function to
49  * function.
50  *
51  */
52 
60 APR_DECLARE(int) apr_base64_encode_len(int len) __attribute__((pure));
61 
71 APR_DECLARE(int) apr_base64_encode(char * coded_dst, const char *plain_src,
72  int len_plain_src)
73  __attribute__((nonnull(1,2)));
74 
85 APR_DECLARE(int) apr_base64_encode_binary(char * coded_dst,
86  const unsigned char *plain_src,
87  int len_plain_src)
88  __attribute__((nonnull(1,2)));
89 
96 APR_DECLARE(char *) apr_pbase64_encode(apr_pool_t *p, const char *string)
97  __attribute__((nonnull(1,2)));
98 
105 APR_DECLARE(int) apr_base64_decode_len(const char * coded_src)
106  __attribute__((nonnull(1))) __attribute__((pure));
107 
116 APR_DECLARE(int) apr_base64_decode(char * plain_dst, const char *coded_src)
117  __attribute__((nonnull(1,2)));
118 
128 APR_DECLARE(int) apr_base64_decode_binary(unsigned char * plain_dst,
129  const char *coded_src)
130  __attribute__((nonnull(1,2)));
131 
138 APR_DECLARE(char *) apr_pbase64_decode(apr_pool_t *p, const char *bufcoded)
139  __attribute__((nonnull(1,2)));
140 
142 #ifdef __cplusplus
143 }
144 #endif
145 
146 #endif /* !APR_BASE64_H */
int apr_base64_encode(char *coded_dst, const char *plain_src, int len_plain_src) __attribute__((nonnull(1
APR Miscellaneous library routines.
int apr_base64_decode(char *plain_dst, const char *coded_src) __attribute__((nonnull(1
int int apr_base64_decode_binary(unsigned char *plain_dst, const char *coded_src) __attribute__((nonnull(1
apr_pool_t * p
int apr_base64_encode_len(int len) __attribute__((pure))
#define APR_DECLARE(x)
Definition: macros.h:6
int int apr_base64_encode_binary(char *coded_dst, const unsigned char *plain_src, int len_plain_src) __attribute__((nonnull(1
#define __attribute__(__x)
Definition: apr.h:63
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
int int char * apr_pbase64_decode(apr_pool_t *p, const char *bufcoded) __attribute__((nonnull(1
int int char int apr_base64_decode_len(const char *coded_src) __attribute__((nonnull(1))) __attribute__((pure))
int int char * apr_pbase64_encode(apr_pool_t *p, const char *string) __attribute__((nonnull(1