candump/lib: convert to single output buffer

Build the CAN frame ASCII output inside a single (big) buffer as
preparation for CAN XL support.

This unifies different output modes (fprintf/sprintf/printf) at
the time of the CAN frame text generation.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This commit is contained in:
Oliver Hartkopp
2024-02-27 09:29:49 +01:00
parent 2522ec127b
commit c6cc7151b7
3 changed files with 75 additions and 60 deletions
+4 -4
View File
@@ -161,7 +161,7 @@ int parse_canframe(char *cs, struct canfd_frame *cf);
*/
void fprint_canframe(FILE *stream , struct canfd_frame *cf, char *eol, int sep);
void sprint_canframe(char *buf , struct canfd_frame *cf, int sep);
int sprint_canframe(char *buf , struct canfd_frame *cf, int sep);
/*
* Creates a CAN frame hexadecimal output in compact format.
* The CAN data[] is separated by '.' when sep != 0.
@@ -197,7 +197,7 @@ void sprint_canframe(char *buf , struct canfd_frame *cf, int sep);
#define SWAP_DELIMITER '`'
void fprint_long_canframe(FILE *stream , struct canfd_frame *cf, char *eol, int view);
void sprint_long_canframe(char *buf , struct canfd_frame *cf, int view);
int sprint_long_canframe(char *buf , struct canfd_frame *cf, int view);
/*
* Creates a CAN frame hexadecimal output in user readable format.
*
@@ -226,8 +226,8 @@ void sprint_long_canframe(char *buf , struct canfd_frame *cf, int view);
*
*/
void snprintf_can_error_frame(char *buf, size_t len, const struct canfd_frame *cf,
const char *sep);
int snprintf_can_error_frame(char *buf, size_t len, const struct canfd_frame *cf,
const char *sep);
/*
* Creates a CAN error frame output in user readable format.
*/