nfqws: move code

This commit is contained in:
bol-van
2024-11-13 19:08:59 +03:00
parent e5bcc5f682
commit ef9f9ae428
7 changed files with 53 additions and 56 deletions

View File

@@ -154,6 +154,21 @@ int HOSTLIST_DEBUGLOG_APPEND(const char *format, ...)
return 0;
}
void hexdump_limited_dlog(const uint8_t *data, size_t size, size_t limit)
{
size_t k;
bool bcut = false;
if (size > limit)
{
size = limit;
bcut = true;
}
if (!size) return;
for (k = 0; k < size; k++) DLOG("%02X ", data[k]);
DLOG(bcut ? "... : " : ": ");
for (k = 0; k < size; k++) DLOG("%c", data[k] >= 0x20 && data[k] <= 0x7F ? (char)data[k] : '.');
if (bcut) DLOG(" ...");
}
struct desync_profile_list *dp_list_add(struct desync_profile_list_head *head)
{