1 /* 2 3 Encode or decode file as MIME base64 (RFC 1341) 4 5 by John Walker 6 http://www.fourmilab.ch/ 7 8 This program is in the public domain. 9 10 */ 11 12 13 struct buffer_st { 14 char *data; 15 int length; 16 char *ptr; 17 int offset; 18 }; 19 20 void buffer_new(struct buffer_st *b); 21 void buffer_add(struct buffer_st *b, char c); 22 void buffer_delete(struct buffer_st *b); 23 24 void base64_encode_xmlrpc(struct buffer_st *b, const char *source, int length); 25 void base64_decode_xmlrpc(struct buffer_st *b, const char *source, int length); 26 27 /* 28 #define DEBUG_MALLOC 29 */ 30 31 #ifdef DEBUG_MALLOC 32 void *_malloc_real(size_t s, char *file, int line); 33 void _free_real(void *p, char *file, int line); 34 35 #define malloc(s) _malloc_real(s,__FILE__,__LINE__) 36 #define free(p) _free_real(p, __FILE__,__LINE__) 37 #endif 38 39