MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ndb_base64.h
1 /*
2  Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; version 2 of the License.
7 
8  This program is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  GNU General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License
14  along with this program; if not, write to the Free Software
15  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 #ifndef NDB_BASE64_H
18 #define NDB_BASE64_H
19 
20 /*
21  Interface created to be able to use base64 functions
22  using function signatures which does not change between
23  MySQL version
24 */
25 
26 #include <base64.h>
27 #include <mysql_version.h>
28 
29 /*
30  Decode a base64 string into data
31 */
32 static inline
33 int ndb_base64_decode(const char *src, size_t src_len,
34  void *dst, const char **end_ptr)
35 {
36 #ifndef MYSQL_VERSION_ID
37 #error "Need MYSQL_VERSION_ID defined"
38 #endif
39 
40  return base64_decode(src, src_len, dst, end_ptr
41 #if MYSQL_VERSION_ID >= 50603
42  // Signature of base64_decode changed to be extended
43  // with a "flags" argument in 5.6.3, no flags needed for
44  // vanilla base64_decode so ignore it in this impl.
45  , 0);
46 #else
47  );
48 #endif
49 }
50 
51 #endif