s3/lib/ctdbd_conn: assert hdr following read/recv
[Samba.git] / lib / util / base64.h
blob47638041d926cddb1db7749ace6058e6752292eb
1 /*
2 * Unix SMB/CIFS implementation.
3 * Samba utility functions
5 * Copyright (C) Andrew Tridgell 1992-2001
6 * Copyright (C) Simo Sorce 2001-2002
7 * Copyright (C) Martin Pool 2003
8 * Copyright (C) James Peach 2006
9 * Copyright (C) Jeremy Allison 1992-2007
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <http://www.gnu.org/licenses/>.
25 #ifndef __LIB_UTIL_BASE64_H__
26 #define __LIB_UTIL_BASE64_H__
28 #include "replace.h"
29 #include "lib/util/data_blob.h"
31 /**
32 Base64 decode a string, place into a data blob. Caller to
33 data_blob_free() the result.
34 **/
35 DATA_BLOB base64_decode_data_blob_talloc(TALLOC_CTX *mem_ctx, const char *s);
37 /**
38 Base64 decode a string, place into a data blob on NULL context.
39 Caller to data_blob_free() the result.
40 **/
41 DATA_BLOB base64_decode_data_blob(const char *s);
43 /**
44 Base64 decode a string, inplace
45 **/
46 void base64_decode_inplace(char *s);
47 /**
48 Base64 encode a binary data blob into a string
49 **/
50 char *base64_encode_data_blob(TALLOC_CTX *mem_ctx, DATA_BLOB data);
52 #endif