xref: /netbsd-src/external/ibm-public/postfix/dist/src/util/base64_code.h (revision 33881f779a77dce6440bdc44610d94de75bebefe)
1 /*	$NetBSD: base64_code.h,v 1.3 2020/03/18 19:05:21 christos Exp $	*/
2 
3 #ifndef _BASE64_CODE_H_INCLUDED_
4 #define _BASE64_CODE_H_INCLUDED_
5 
6 /*++
7 /* NAME
8 /*	base64_code 3h
9 /* SUMMARY
10 /*	encode/decode data, base 64 style
11 /* SYNOPSIS
12 /*	#include <base64_code.h>
13 /* DESCRIPTION
14 /* .nf
15 
16  /*
17   * Utility library.
18  */
19 #include <vstring.h>
20 
21  /*
22   * External interface.
23   */
24 extern VSTRING *base64_encode_opt(VSTRING *, const char *, ssize_t, int);
25 extern VSTRING *WARN_UNUSED_RESULT base64_decode_opt(VSTRING *, const char *, ssize_t, int);
26 
27 #define BASE64_FLAG_NONE	0
28 #define BASE64_FLAG_APPEND	(1<<0)
29 
30 #define base64_encode(bp, cp, ln) \
31 	base64_encode_opt((bp), (cp), (ln), BASE64_FLAG_NONE)
32 #define base64_decode(bp, cp, ln) \
33 	base64_decode_opt((bp), (cp), (ln), BASE64_FLAG_NONE)
34 
35 /* LICENSE
36 /* .ad
37 /* .fi
38 /*	The Secure Mailer license must be distributed with this software.
39 /* AUTHOR(S)
40 /*	Wietse Venema
41 /*	IBM T.J. Watson Research
42 /*	P.O. Box 704
43 /*	Yorktown Heights, NY 10598, USA
44 /*
45 /*	Wietse Venema
46 /*	Google, Inc.
47 /*	111 8th Avenue
48 /*	New York, NY 10011, USA
49 /*--*/
50 
51 #endif
52