Index: trunk/src_plugins/io_bxl/bxl_decode.c =================================================================== --- trunk/src_plugins/io_bxl/bxl_decode.c (revision 30727) +++ trunk/src_plugins/io_bxl/bxl_decode.c (revision 30728) @@ -295,6 +295,20 @@ return ctx->out_len; } +int pcb_bxl_encode_eof(hdecode_t *ctx) +{ + ctx->out_len = 0; + if (ctx->bitpos == 0) + return 0; + + /* pad the last byte */ + while(ctx->out_len == 0) + append(ctx, 0); + + return 1; +} + + void pcb_bxl_encode_init(hdecode_t *ctx) { pcb_bxl_decode_init(ctx); Index: trunk/src_plugins/io_bxl/bxl_decode.h =================================================================== --- trunk/src_plugins/io_bxl/bxl_decode.h (revision 30727) +++ trunk/src_plugins/io_bxl/bxl_decode.h (revision 30728) @@ -72,3 +72,7 @@ the next call. */ int pcb_bxl_encode_char(hdecode_t *ctx, int inchr); +/* Call this at the end of the output stream to flush the last incomplete + output byte */ +int pcb_bxl_encode_eof(hdecode_t *ctx); +