/usr/include/ncbi/connect/ncbi_base64.h is in libncbi6-dev 6.1.20120620-8.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | #ifndef CONNECT___NCBI_BASE64__H
#define CONNECT___NCBI_BASE64__H
/* $Id: ncbi_base64.h,v 1.7 2010/06/08 16:19:54 lavr Exp $
* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
* National Center for Biotechnology Information
*
* This software/database is a "United States Government Work" under the
* terms of the United States Copyright Act. It was written as part of
* the author's official duties as a United States Government employee and
* thus cannot be copyrighted. This software/database is freely available
* to the public for use. The National Library of Medicine and the U.S.
* Government have not placed any restriction on its use or reproduction.
*
* Although all reasonable efforts have been taken to ensure the accuracy
* and reliability of the software and data, the NLM and the U.S.
* Government do not and cannot warrant the performance or results that
* may be obtained by using this software or data. The NLM and the U.S.
* Government disclaim all warranties, express or implied, including
* warranties of performance, merchantability or fitness for any particular
* purpose.
*
* Please cite the author in any work or product based on this material.
*
* ===========================================================================
*
* Author: Anton Lavrentiev
*
* File Description:
* BASE-64 Encoding/Decoding (C Toolkit CONNECT version)
*
*/
#include <connect/connect_export.h>
#include <assert.h>
#include <stddef.h>
#define BASE64_Encode CONNECT_BASE64_Encode
#define BASE64_Decode CONNECT_BASE64_Decode
#define _ASSERT assert
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus*/
/** BASE64-encode up to "src_size" symbols(bytes) from buffer "src_buf".
* Write the encoded data to buffer "dst_buf", but no more than "dst_size"
* bytes.
* Assign "*src_read" with the # of bytes successfully encoded from "src_buf".
* Assign "*dst_written" with the # of bytes written to buffer "dst_buf".
* Resulting lines will not exceed "*line_len" (or the standard default
* if "line_len" is NULL) bytes; *line_len == 0 disables the line breaks.
* To estimate required destination buffer size, you can take into account
* that BASE64 encoding converts every 3 bytes of source into 4 bytes of
* encoded output, not including the additional line breaks ('\n').
*/
extern NCBI_XCONNECT_EXPORT void BASE64_Encode
(const void* src_buf, /* [in] non-NULL */
size_t src_size, /* [in] */
size_t* src_read, /* [out] non-NULL */
void* dst_buf, /* [in/out] non-NULL */
size_t dst_size, /* [in] */
size_t* dst_written, /* [out] non-NULL */
size_t* line_len /* [in] may be NULL */
);
/** BASE64-decode up to "src_size" symbols(bytes) from buffer "src_buf".
* Write the decoded data to buffer "dst_buf", but no more than "dst_size"
* bytes.
* Assign "*src_read" with the # of bytes successfully decoded from "src_buf".
* Assign "*dst_written" with the # of bytes written to buffer "dst_buf".
* Return FALSE (0) only if this call cannot decode anything at all.
* The destination buffer size, as a worst case, equal to the source size
* will accomodate the entire output. As a rule, each 4 bytes of source
* (line breaks ignored) get converted into 3 bytes of decoded output.
*/
extern NCBI_XCONNECT_EXPORT int/*bool*/ BASE64_Decode
(const void* src_buf, /* [in] non-NULL */
size_t src_size, /* [in] */
size_t* src_read, /* [out] non-NULL */
void* dst_buf, /* [in/out] non-NULL */
size_t dst_size, /* [in] */
size_t* dst_written /* [out] non-NULL */
);
#ifdef __cplusplus
}
#endif /*__cplusplus*/
#endif /* CONNECT___NCBI_BASE64__H */
|