mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
Revert "libs/libc/dumpbuffer: add support to dump the buffer to file descriptor."
This reverts commit 080b380955.
This commit is contained in:
@@ -1021,23 +1021,11 @@ extern "C"
|
||||
void lib_dumpbuffer(FAR const char *msg, FAR const uint8_t *buffer,
|
||||
unsigned int buflen);
|
||||
|
||||
/* Dump a buffer of data to a specified file descriptor. */
|
||||
|
||||
void lib_writebuffer(int fd, FAR const char *msg,
|
||||
FAR const uint8_t *buffer, unsigned int buflen);
|
||||
|
||||
/* Do a pretty buffer dump from multiple buffers. */
|
||||
|
||||
void lib_dumpvbuffer(FAR const char *msg, FAR const struct iovec *iov,
|
||||
int iovcnt);
|
||||
|
||||
/* Do a pretty buffer dump from multiple buffers
|
||||
* to a specified file descriptor.
|
||||
*/
|
||||
|
||||
void lib_writevbuffer(int fd, FAR const char *msg,
|
||||
FAR const struct iovec *iov, int iovcnt);
|
||||
|
||||
/* The system logging interfaces are normally accessed via the macros
|
||||
* provided above. If the cross-compiler's C pre-processor supports a
|
||||
* variable number of macro arguments, then those macros below will map all
|
||||
|
||||
@@ -54,26 +54,3 @@ void lib_dumpbuffer(FAR const char *msg, FAR const uint8_t *buffer,
|
||||
|
||||
lib_dumpvbuffer(msg, &buf, 1);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: lib_writebuffer
|
||||
*
|
||||
* Description:
|
||||
* Do a pretty buffer dump to a specified file descriptor.
|
||||
*
|
||||
* A fairly large on-stack buffer is used for the case where timestamps are
|
||||
* applied to each line.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void lib_writebuffer(int fd, FAR const char *msg,
|
||||
FAR const uint8_t *buffer, unsigned int buflen)
|
||||
{
|
||||
struct iovec buf =
|
||||
{
|
||||
.iov_base = (FAR char *)buffer,
|
||||
.iov_len = buflen,
|
||||
};
|
||||
|
||||
lib_writevbuffer(fd, msg, &buf, 1);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <nuttx/compiler.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <debug.h>
|
||||
|
||||
/****************************************************************************
|
||||
@@ -71,19 +70,18 @@ static char lib_nibble(unsigned char nibble)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: lib_writevbuffer
|
||||
* Name: lib_dumpvbuffer
|
||||
*
|
||||
* Description:
|
||||
* Do a pretty buffer dump from multiple buffers to a specified file
|
||||
* descriptor.
|
||||
* Do a pretty buffer dump from multiple buffers.
|
||||
*
|
||||
* A fairly large on-stack buffer is used for the case where timestamps are
|
||||
* applied to each line.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void lib_writevbuffer(int fd, FAR const char *msg,
|
||||
FAR const struct iovec *iov, int iovcnt)
|
||||
void lib_dumpvbuffer(FAR const char *msg, FAR const struct iovec *iov,
|
||||
int iovcnt)
|
||||
{
|
||||
FAR const struct iovec *piov = iov;
|
||||
FAR const uint8_t *iov_buf;
|
||||
@@ -98,14 +96,7 @@ void lib_writevbuffer(int fd, FAR const char *msg,
|
||||
|
||||
if (msg)
|
||||
{
|
||||
if (fd > 0)
|
||||
{
|
||||
dprintf(fd, "%s (%p):\n", msg, iov->iov_base);
|
||||
}
|
||||
else
|
||||
{
|
||||
syslog(LOG_INFO, "%s (%p):\n", msg, iov->iov_base);
|
||||
}
|
||||
syslog(LOG_INFO, "%s (%p):\n", msg, iov->iov_base);
|
||||
}
|
||||
|
||||
for (i = 0; i < iovcnt; i++)
|
||||
@@ -179,30 +170,6 @@ void lib_writevbuffer(int fd, FAR const char *msg,
|
||||
*ptr++ = ' '; /* Plus 1 byte */
|
||||
}
|
||||
|
||||
if (fd > 0)
|
||||
{
|
||||
dprintf(fd, "%04x %s\n", i, line);
|
||||
}
|
||||
else
|
||||
{
|
||||
syslog(LOG_INFO, "%04x %s\n", i, line);
|
||||
}
|
||||
syslog(LOG_INFO, "%04x %s\n", i, line);
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: lib_dumpvbuffer
|
||||
*
|
||||
* Description:
|
||||
* Do a pretty buffer dump from multiple buffers.
|
||||
*
|
||||
* A fairly large on-stack buffer is used for the case where timestamps are
|
||||
* applied to each line.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void lib_dumpvbuffer(FAR const char *msg, FAR const struct iovec *iov,
|
||||
int iovcnt)
|
||||
{
|
||||
lib_writevbuffer(-1, msg, iov, iovcnt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user