changeset 942:fab04df64690

rvinterf/lowlevel: replace libg23 with libprint
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 24 May 2023 06:55:54 +0000
parents 8fc3b72eb2c6
children 31a36b400cdf
files rvinterf/lowlevel/Makefile rvinterf/lowlevel/format.c rvinterf/lowlevel/logsent.c
diffstat 3 files changed, 8 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/lowlevel/Makefile	Wed May 24 06:46:26 2023 +0000
+++ b/rvinterf/lowlevel/Makefile	Wed May 24 06:55:54 2023 +0000
@@ -1,7 +1,7 @@
 CC=	gcc
 CFLAGS=	-O2
 PROGS=	rvtdump rvinterf tfc139
-LIBS=	../../libserial/libserial.a ../libg23/libg23.a ../libprint/libprint.a
+LIBS=	../../libserial/libserial.a ../libprint/libprint.a
 LIBPWON=../../libpwon/libpwon.a
 
 INSTALL_PREFIX=	/opt/freecalypso
--- a/rvinterf/lowlevel/format.c	Wed May 24 06:46:26 2023 +0000
+++ b/rvinterf/lowlevel/format.c	Wed May 24 06:55:54 2023 +0000
@@ -14,7 +14,9 @@
 extern u_char rxpkt[];
 extern size_t rxpkt_len;
 
+extern void output_line();
 extern void output_cont();
+extern void output_cont_logpref();
 
 void
 print_rv_trace()
@@ -93,11 +95,8 @@
 void
 print_g23_trace()
 {
-	char fmtbuf[MAX_PKT_FROM_TARGET*8];	/* size it generously */
-
-	/* messy logic factored out into libg23 */
-	format_g23_packet(rxpkt, (int)rxpkt_len, fmtbuf);
-	output_line(fmtbuf);
+	format_gpf_packet(rxpkt, (unsigned) rxpkt_len, "", output_line,
+			  output_cont_logpref);
 }
 
 void
--- a/rvinterf/lowlevel/logsent.c	Wed May 24 06:46:26 2023 +0000
+++ b/rvinterf/lowlevel/logsent.c	Wed May 24 06:55:54 2023 +0000
@@ -12,6 +12,7 @@
 extern int no_output, verbose;
 extern FILE *logF;
 
+extern void output_line();
 extern void output_cont();
 extern void output_cont_logpref();
 
@@ -26,17 +27,6 @@
 	output_line(buf);
 }
 
-static void
-log_sent_gpf(pkt, pktlen)
-	u_char *pkt;
-{
-	char buf[MAX_PKT_TO_TARGET*4+30];
-
-	strcpy(buf, "Sent ");
-	format_g23_packet(pkt, pktlen, buf + 5);
-	output_line(buf);
-}
-
 void
 log_sent_packet(pkt, pktlen)
 	u_char *pkt;
@@ -45,7 +35,8 @@
 		return;
 	switch (pkt[0]) {
 	case RVT_L23_HEADER:
-		log_sent_gpf(pkt, pktlen);
+		format_gpf_packet(pkt, pktlen, "Sent ", output_line,
+				  output_cont_logpref);
 		return;
 	case RVT_TM_HEADER:
 		log_sent_tm(pkt, pktlen);