Loading...
Searching...
No Matches
apr_base64.h
Go to the documentation of this file.
/* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* 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.
* The apr_vsnprintf/apr_snprintf functions are based on, and used with the
* permission of, the SIO stdio-replacement strx_* functions by Panos
* Tsirigotis <panos@alumni.cs.colorado.edu> for xinetd.
*/
#ifndef APR_BASE64_H
#define APR_BASE64_H
#include "apu.h"
#include "apr_general.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Simple BASE64 encode/decode functions.
*
* As we might encode binary strings, hence we require the length of
* the incoming plain source. And return the length of what we decoded.
*
* The decoding function takes any non valid char (i.e. whitespace, \0
* or anything non A-Z,0-9 etc as terminal.
*
* plain strings/binary sequences are not assumed '\0' terminated. Encoded
* strings are neither. But probably should.
*
*/
APU_DECLARE(int) apr_base64_encode_len(int len);
APU_DECLARE(int) apr_base64_encode(char * coded_dst, const char *plain_src,
int len_plain_src);
APU_DECLARE(int) apr_base64_encode_binary(char * coded_dst,
const unsigned char *plain_src,
int len_plain_src);
APU_DECLARE(int) apr_base64_decode_len(const char * coded_src);
APU_DECLARE(int) apr_base64_decode(char * plain_dst, const char *coded_src);
APU_DECLARE(int) apr_base64_decode_binary(unsigned char * plain_dst,
const char *coded_src);
#ifdef __cplusplus
}
#endif
#endif /* !APR_BASE64_H */
apr_base64_decode
int apr_base64_decode(char *plain_dst, const char *coded_src)
apr_base64_decode_binary
int apr_base64_decode_binary(unsigned char *plain_dst, const char *coded_src)
apr_base64_encode_len
int apr_base64_encode_len(int len)
apr_base64_encode
int apr_base64_encode(char *coded_dst, const char *plain_src, int len_plain_src)
apr_base64_decode_len
int apr_base64_decode_len(const char *coded_src)
apr_base64_encode_binary
int apr_base64_encode_binary(char *coded_dst, const unsigned char *plain_src, int len_plain_src)