=== modified file 'include/base64.h' --- include/base64.h 2006-12-23 19:20:40 +0000 +++ include/base64.h 2008-05-01 22:50:11 +0000 @@ -23,23 +23,24 @@ /* Calculate how much memory needed for dst of base64_encode() */ -int base64_needed_encoded_length(int length_of_data); +int my_base64_needed_encoded_length(int length_of_data); /* Calculate how much memory needed for dst of base64_decode() */ -int base64_needed_decoded_length(int length_of_encoded_data); +int my_base64_needed_decoded_length(int length_of_encoded_data); + /* Encode data as a base64 string */ -int base64_encode(const void *src, size_t src_len, char *dst); +int my_base64_encode(const void *src, size_t src_len, char *dst); /* Decode a base64 string into data */ -int base64_decode(const char *src, size_t src_len, - void *dst, const char **end_ptr); +int my_base64_decode(const char *src, size_t src_len, + void *dst, const char **end_ptr); #ifdef __cplusplus === modified file 'mysys/base64.c' --- mysys/base64.c 2007-02-23 11:28:34 +0000 +++ mysys/base64.c 2008-05-01 22:58:00 +0000 @@ -26,7 +26,7 @@ int -base64_needed_encoded_length(int length_of_data) +my_base64_needed_encoded_length(int length_of_data) { int nb_base64_chars; nb_base64_chars= (length_of_data + 2) / 3 * 4; @@ -39,7 +39,7 @@ int -base64_needed_decoded_length(int length_of_encoded_data) +my_base64_needed_decoded_length(int length_of_encoded_data) { return (int) ceil(length_of_encoded_data * 3 / 4); } @@ -53,7 +53,7 @@ */ int -base64_encode(const void *src, size_t src_len, char *dst) +my_base64_encode(const void *src, size_t src_len, char *dst) { const unsigned char *s= (const unsigned char*)src; size_t i= 0; @@ -146,14 +146,14 @@ We require that 'dst' is pre-allocated to correct size. SEE ALSO - base64_needed_decoded_length(). + my_base64_needed_decoded_length(). RETURN VALUE Number of bytes written at 'dst' or -1 in case of failure */ int -base64_decode(const char *src_base, size_t len, - void *dst, const char **end_ptr) +my_base64_decode(const char *src_base, size_t len, + void *dst, const char **end_ptr) { char b[3]; size_t i= 0; @@ -263,16 +263,16 @@ } /* Encode */ - needed_length= base64_needed_encoded_length(src_len); + needed_length= my_base64_needed_encoded_length(src_len); str= (char *) malloc(needed_length); for (k= 0; k < needed_length; k++) str[k]= 0xff; /* Fill memory to check correct NUL termination */ - require(base64_encode(src, src_len, str) == 0); + require(my_base64_encode(src, src_len, str) == 0); require(needed_length == strlen(str) + 1); /* Decode */ - dst= (char *) malloc(base64_needed_decoded_length(strlen(str))); - dst_len= base64_decode(str, strlen(str), dst); + dst= (char *) malloc(my_base64_needed_decoded_length(strlen(str))); + dst_len= my_base64_decode(str, strlen(str), dst); require(dst_len == src_len); if (memcmp(src, dst, src_len) != 0) === modified file 'sql/log_event.cc' --- sql/log_event.cc 2007-11-05 17:20:20 +0000 +++ sql/log_event.cc 2008-05-01 22:48:50 +0000 @@ -1171,7 +1171,7 @@ uint32 size= uint4korr(ptr + EVENT_LEN_OFFSET); DBUG_ENTER("Log_event::print_base64"); - size_t const tmp_str_sz= base64_needed_encoded_length((int) size); + size_t const tmp_str_sz= my_base64_needed_encoded_length((int) size); char *const tmp_str= (char *) my_malloc(tmp_str_sz, MYF(MY_WME)); if (!tmp_str) { fprintf(stderr, "\nError: Out of memory. " @@ -1179,7 +1179,7 @@ DBUG_VOID_RETURN; } - if (base64_encode(ptr, (size_t) size, tmp_str)) + if (my_base64_encode(ptr, (size_t) size, tmp_str)) { DBUG_ASSERT(0); } === modified file 'sql/sql_binlog.cc' --- sql/sql_binlog.cc 2007-11-08 07:54:19 +0000 +++ sql/sql_binlog.cc 2008-05-01 22:49:05 +0000 @@ -48,7 +48,7 @@ thd->net.no_send_ok= TRUE; size_t coded_len= thd->lex->comment.length + 1; - size_t decoded_len= base64_needed_decoded_length(coded_len); + size_t decoded_len= my_base64_needed_decoded_length(coded_len); DBUG_ASSERT(coded_len > 0); /* @@ -80,7 +80,7 @@ strptr < thd->lex->comment.str + thd->lex->comment.length ; ) { char const *endptr= 0; - int bytes_decoded= base64_decode(strptr, coded_len, buf, &endptr); + int bytes_decoded= my_base64_decode(strptr, coded_len, buf, &endptr); #ifndef HAVE_purify /* === modified file 'storage/ndb/src/mgmapi/mgmapi.cpp' --- storage/ndb/src/mgmapi/mgmapi.cpp 2007-08-29 04:30:21 +0000 +++ storage/ndb/src/mgmapi/mgmapi.cpp 2008-05-01 23:16:40 +0000 @@ -2176,8 +2176,8 @@ if(buf64 == 0) break; - void *tmp_data = malloc(base64_needed_decoded_length((size_t) (len - 1))); - const int res = base64_decode(buf64, len-1, tmp_data, NULL); + void *tmp_data = malloc(my_base64_needed_decoded_length((size_t)(len - 1))); + const int res = my_base64_decode(buf64, len-1, tmp_data, NULL); delete[] buf64; UtilBuffer tmp; tmp.append((void *) tmp_data, res); === modified file 'unittest/mysys/base64-t.c' --- unittest/mysys/base64-t.c 2007-08-01 19:59:05 +0000 +++ unittest/mysys/base64-t.c 2008-05-01 23:06:14 +0000 @@ -48,18 +48,18 @@ } /* Encode */ - needed_length= base64_needed_encoded_length(src_len); + needed_length= my_base64_needed_encoded_length(src_len); str= (char *) malloc(needed_length); for (k= 0; k < needed_length; k++) str[k]= 0xff; /* Fill memory to check correct NUL termination */ - ok(base64_encode(src, src_len, str) == 0, - "base64_encode: size %d", i); + ok(my_base64_encode(src, src_len, str) == 0, + "my_base64_encode: size %d", i); ok(needed_length == strlen(str) + 1, - "base64_needed_encoded_length: size %d", i); + "my_base64_needed_encoded_length: size %d", i); /* Decode */ - dst= (char *) malloc(base64_needed_decoded_length(strlen(str))); - dst_len= base64_decode(str, strlen(str), dst, NULL); + dst= (char *) malloc(my_base64_needed_decoded_length(strlen(str))); + dst_len= my_base64_decode(str, strlen(str), dst, NULL); ok(dst_len == src_len, "Comparing lengths"); cmp= memcmp(src, dst, src_len);