From 317df86ba3b392410cb3e7d6ac99e182cdd2ea3c Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 25 Jan 2024 17:51:06 +0100 Subject: base64: Move base64 encoding support --- cpukit/libtrace/record/record-dump-base64.c | 7 ++++--- cpukit/libtrace/record/record-dump-zbase64.c | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'cpukit/libtrace') diff --git a/cpukit/libtrace/record/record-dump-base64.c b/cpukit/libtrace/record/record-dump-base64.c index 8d403e9c27..9438041664 100644 --- a/cpukit/libtrace/record/record-dump-base64.c +++ b/cpukit/libtrace/record/record-dump-base64.c @@ -30,11 +30,12 @@ #endif #include -#include #include #include +#include + typedef struct { IO_Put_char put_char; void *arg; @@ -76,7 +77,7 @@ static void chunk( void *arg, const void *data, size_t length ) if ( index == RTEMS_ARRAY_SIZE( ctx->buf ) - 1 ) { index = 0; - _IO_Base64( + _Base64_Encode( put_char, ctx, ctx->buf, @@ -94,7 +95,7 @@ static void chunk( void *arg, const void *data, size_t length ) static void flush( dump_context *ctx ) { - _IO_Base64( put_char, ctx, ctx->buf, ctx->index, NULL, INT_MAX ); + _Base64_Encode( put_char, ctx, ctx->buf, ctx->index, NULL, INT_MAX ); } void rtems_record_dump_base64( IO_Put_char put_char, void *arg ) diff --git a/cpukit/libtrace/record/record-dump-zbase64.c b/cpukit/libtrace/record/record-dump-zbase64.c index 0979e36a47..43bd0ecff8 100644 --- a/cpukit/libtrace/record/record-dump-zbase64.c +++ b/cpukit/libtrace/record/record-dump-zbase64.c @@ -30,11 +30,12 @@ #endif #include -#include #include #include +#include + static void *dump_zalloc( void *opaque, unsigned items, unsigned size ) { rtems_record_dump_base64_zlib_context *ctx; @@ -96,7 +97,7 @@ static void chunk( void *arg, const void *data, size_t length ) ctx->stream.next_out = &ctx->buf[ 0 ]; ctx->stream.avail_out = sizeof( ctx->buf ); - _IO_Base64( put_char, ctx, ctx->buf, sizeof( ctx->buf ), NULL, INT_MAX ); + _Base64_Encode( put_char, ctx, ctx->buf, sizeof( ctx->buf ), NULL, INT_MAX ); } } } @@ -115,11 +116,11 @@ static void flush( rtems_record_dump_base64_zlib_context *ctx ) ctx->stream.next_out = &ctx->buf[ 0 ]; ctx->stream.avail_out = sizeof( ctx->buf ); - _IO_Base64( put_char, ctx, ctx->buf, sizeof( ctx->buf ), NULL, INT_MAX ); + _Base64_Encode( put_char, ctx, ctx->buf, sizeof( ctx->buf ), NULL, INT_MAX ); } } - _IO_Base64( + _Base64_Encode( put_char, ctx, ctx->buf, -- cgit v1.2.3