Mistake on this page? Email us
apr_base64.h
Go to the documentation of this file.
1 /*
2  * This file contains modification of original Apache APR Base64 encoder.
3  */
4 
5 /* Licensed to the Apache Software Foundation (ASF) under one or more
6  * contributor license agreements. See the NOTICE file distributed with
7  * this work for additional information regarding copyright ownership.
8  * The ASF licenses this file to You under the Apache License, Version 2.0
9  * (the "License"); you may not use this file except in compliance with
10  * the License. You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * The apr_vsnprintf/apr_snprintf functions are based on, and used with the
20  * permission of, the SIO stdio-replacement strx_* functions by Panos
21  * Tsirigotis <[email protected]> for xinetd.
22  */
23 
28 #ifndef APR_BASE64_H
29 #define APR_BASE64_H
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
41 /* Simple BASE64 encode/decode functions.
42  *
43  * As we might encode binary strings, hence we require the length of
44  * the incoming plain source. And return the length of what we decoded.
45  *
46  * The decoding function takes any non-valid char (such as whitespace, \0
47  * or anything non A-Z,0-9 as terminal).
48  *
49  * Plain strings/binary sequences are not assumed '\0' terminated. Encoded
50  * strings are neither. But probably should.
51  *
52  */
53 
61 int apr_base64_encode_len(int len);
62 
70 int apr_base64_encode_binary(char * coded_dst, const unsigned char *plain_src, int len_plain_src);
71 
78 int apr_base64_decode_len(const char * coded_src);
79 
86 int apr_base64_decode_binary(unsigned char * plain_dst, const char *coded_src);
87 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #endif /* !APR_BASE64_H */
int apr_base64_decode_len(const char *coded_src)
int apr_base64_decode_binary(unsigned char *plain_dst, const char *coded_src)
int apr_base64_encode_binary(char *coded_dst, const unsigned char *plain_src, int len_plain_src)
int apr_base64_encode_len(int len)