SequoiaDB
 All Classes Namespaces Files Functions Macros Pages
base64c.h
Go to the documentation of this file.
1 /*******************************************************************************
2  Copyright (C) 2011-2018 SequoiaDB Ltd.
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 *******************************************************************************/
16 
20 #ifndef ALAN_BASE64_H
21 #define ALAN_BASE64_H
22 
23 #include <stdio.h>
24 #include <stdlib.h>
25 #include <string.h>
26 
27 #if defined(__GNUC__) || defined(__xlC__)
28  #ifndef SDB_INLINE
29  #define SDB_INLINE static __inline__
30  #endif
31  #define SDB_EXPORT
32 #else
33  #ifndef SDB_INLINE
34  #define SDB_INLINE static
35  #endif
36  #ifdef SDB_STATIC_BUILD
37  #define SDB_EXPORT
38  #elif defined(SDB_DLL_BUILD)
39  #define SDB_EXPORT __declspec(dllexport)
40  #else
41  #define SDB_EXPORT __declspec(dllimport)
42  #endif
43 #endif
44 
45 #ifdef __cplusplus
46 #define SDB_EXTERN_C_START extern "C" {
47 #define SDB_EXTERN_C_END }
48 #else
49 #define SDB_EXTERN_C_START
50 #define SDB_EXTERN_C_END
51 #endif
52 
53 SDB_EXTERN_C_START
54 
55 
75 SDB_EXPORT int base64Encode ( const char *s, int in_size, char *out, int out_size ) ;
76 
94 SDB_EXPORT int base64Decode ( const char *s, char *out, int out_size ) ;
95 
101 SDB_EXPORT int getEnBase64Size ( int size ) ;
102 
108 SDB_EXPORT int getDeBase64Size ( const char *s ) ;
109 
110 SDB_EXTERN_C_END
111 
112 #endif