# HG changeset patch # User Mychaela Falconia # Date 1691201174 0 # Node ID 13518c86b73cad2c1816d22d2a5b239aa6e56265 # Parent 2d0082216916ab64d125bad44c88bf0dccee2499 libcoding: add hexout.c, implementing emit_hex_out() diff -r 2d0082216916 -r 13518c86b73c libcoding/Makefile --- a/libcoding/Makefile Sat Aug 05 00:46:23 2023 +0000 +++ b/libcoding/Makefile Sat Aug 05 02:06:14 2023 +0000 @@ -1,6 +1,6 @@ CC= gcc CFLAGS= -O2 -OBJS= gsm7_encode.o gsm7_encode_table.o gsm7_pack.o ucs2_bigend.o \ +OBJS= gsm7_encode.o gsm7_encode_table.o gsm7_pack.o hexout.o ucs2_bigend.o \ utf8_decode.o utf8_decode2.o LIB= libcoding.a diff -r 2d0082216916 -r 13518c86b73c libcoding/hexout.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/libcoding/hexout.c Sat Aug 05 02:06:14 2023 +0000 @@ -0,0 +1,17 @@ +/* + * The function implemented in this module emits hex bytes to a stdio output. + */ + +#include +#include + +emit_hex_out(buf, buflen, outf) + u_char *buf; + unsigned buflen; + FILE *outf; +{ + unsigned n; + + for (n = 0; n < buflen; n++) + fprintf(outf, "%02X", buf[n]); +}