aboutsummaryrefslogtreecommitdiff
path: root/project/dclib/dclib-debug.c
diff options
context:
space:
mode:
authorWiimm <wiimm@wiimm.de>2023-07-11 16:18:26 +0200
committerWiimm <wiimm@wiimm.de>2023-07-11 16:18:26 +0200
commitb5b1fe7fc0cf460d6204c18ba7bb4c40f7597efa (patch)
treea7b4bb1e79fde818dd7af17fee1207ae40178ab7 /project/dclib/dclib-debug.c
parent74ac39c1af5c8e85bf10711aed2ffc9dfee2e277 (diff)
SZS v2.35a
Diffstat (limited to '')
-rw-r--r--project/dclib/dclib-debug.c44
1 files changed, 36 insertions, 8 deletions
diff --git a/project/dclib/dclib-debug.c b/project/dclib/dclib-debug.c
index a5d978f..a3af57f 100644
--- a/project/dclib/dclib-debug.c
+++ b/project/dclib/dclib-debug.c
@@ -597,6 +597,21 @@ bool mark_used ( ccp name, ... )
/////////////// hexdump ///////////////
///////////////////////////////////////////////////////////////////////////////
+uint HexDump ( FILE * f, int indent, u64 addr, int addr_fw, int row_len,
+ const void * p_data, size_t count )
+{
+ // return the number of printed lines
+ if ( !f || !p_data || !count )
+ return 0;
+
+ XDump_t xd;
+ InitializeXDumpEx(&xd,f,indent,addr,addr_fw,row_len);
+ const int stat = XDump(&xd,p_data,count,true);
+ return stat < 0 ? 0 : stat;
+}
+
+//-----------------------------------------------------------------------------
+
uint HexDump16 ( FILE * f, int indent, u64 addr,
const void * data, size_t count )
{
@@ -613,19 +628,32 @@ uint HexDump20 ( FILE * f, int indent, u64 addr,
return HexDump(f,indent,addr,4,20,data,count);
}
-//-----------------------------------------------------------------------------
+///////////////////////////////////////////////////////////////////////////////
-uint HexDump ( FILE * f, int indent, u64 addr, int addr_fw, int row_len,
+uint HexDumpCRLF ( FILE * f, int indent, u64 addr, int addr_fw, int row_len,
const void * p_data, size_t count )
{
+ const typeof(hexdump_eol)saved_eol = hexdump_eol;
+ hexdump_eol = "\r\n";
+ const uint stat = HexDump(f,indent,addr,addr_fw,row_len,p_data,count);
+ hexdump_eol = saved_eol;
+ return stat;
+}
+
+//-----------------------------------------------------------------------------
+
+uint HexDump16CRLF ( FILE * f, int indent, u64 addr, const void * data, size_t count )
+{
// return the number of printed lines
- if ( !f || !p_data || !count )
- return 0;
+ return HexDumpCRLF(f,indent,addr,4,16,data,count);
+}
- XDump_t xd;
- InitializeXDumpEx(&xd,f,indent,addr,addr_fw,row_len);
- const int stat = XDump(&xd,p_data,count,true);
- return stat < 0 ? 0 : stat;
+//-----------------------------------------------------------------------------
+
+uint HexDump20CRLF ( FILE * f, int indent, u64 addr, const void * data, size_t count )
+{
+ // return the number of printed lines
+ return HexDumpCRLF(f,indent,addr,4,20,data,count);
}
///////////////////////////////////////////////////////////////////////////////