00001 00007 /* 00008 * Copyright (c) 2000 Virtual Unlimited B.V. 00009 * 00010 * Author: Bob Deblier <bob@virtualunlimited.com> 00011 * 00012 * This library is free software; you can redistribute it and/or 00013 * modify it under the terms of the GNU Lesser General Public 00014 * License as published by the Free Software Foundation; either 00015 * version 2.1 of the License, or (at your option) any later version. 00016 * 00017 * This library is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00020 * Lesser General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU Lesser General Public 00023 * License along with this library; if not, write to the Free Software 00024 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00025 * 00026 */ 00027 00028 #ifndef _BASE64_H 00029 #define _BASE64_H 00030 00031 #include "beecrypt.h" 00032 00036 /*@-exportlocal@*/ 00037 /*@unchecked@*/ /*@observer@*/ /*@null@*/ 00038 extern const char * b64decode_whitespace; 00039 /*@=exportlocal@*/ 00040 #define B64DECODE_WHITESPACE " \f\n\r\t\v" 00041 00045 /*@-exportlocal@*/ 00046 /*@unchecked@*/ 00047 extern int b64encode_chars_per_line; 00048 /*@=exportlocal@*/ 00049 #define B64ENCODE_CHARS_PER_LINE 72 00050 00054 /*@-exportlocal@*/ 00055 /*@unchecked@*/ /*@observer@*/ /*@null@*/ 00056 extern const char * b64encode_eolstr; 00057 /*@=exportlocal@*/ 00058 #define B64ENCODE_EOLSTR "\n" 00059 00060 #ifdef __cplusplus 00061 extern "C" { 00062 #endif 00063 00070 BEECRYPTAPI /*@only@*/ /*@null@*/ /*@unused@*/ 00071 char * b64encode (const void * data, int ns) 00072 /*@*/; 00073 00080 BEECRYPTAPI /*@only@*/ /*@null@*/ /*@unused@*/ 00081 char * b64crc (const unsigned char * data, int ns) 00082 /*@*/; 00083 00091 BEECRYPTAPI /*@unused@*/ 00092 int b64decode (const char * s, /*@out@*/ void ** datap, /*@out@*/ int *lenp) 00093 /*@modifies *datap, *lenp @*/; 00094 00097 BEECRYPTAPI /*@only@*/ /*@null@*/ /*@unused@*/ 00098 char* b64enc(const memchunk*); 00099 00102 BEECRYPTAPI /*@only@*/ /*@null@*/ /*@unused@*/ 00103 memchunk* b64dec(const char*); 00104 00105 #ifdef __cplusplus 00106 } 00107 #endif 00108 00109 #endif