netmsgs/libnetmsgs/nmLibUtils.c
void nmPrintBuf(FILE       *fp,
                const char *sPreface,
                byte_t      buf[],
                size_t      uCount,
                size_t      uNLFreq,
                uint_t      uCol)
{
  size_t  i;

  if( sPreface && *sPreface )
  {
    fprintf(fp, "%s:", sPreface);
  }

  for(i=0; i<uCount; ++i)
  {
    if( (uNLFreq > 0) && ((i % uNLFreq) == 0) )
    {
      if( i != 0 )
      {
        fprintf(fp, "\n%*s", uCol, "");
      }
    }
    fprintf(fp, " 0x%02x", buf[i]);
  }
}
/*!
 * \brief Pretty print buffer to opened file stream.
 *
 * \param fp        File pointer.
 * \param sPreface  Optional buffer preface string (set to NULL for no preface).
 * \param buf       Buffer to print.
 * \param uCount    Number of bytes to print.
 * \param uNLFreq   Newline frequency (set to 0 for no newlines).
 * \param uCol      Column alignment number.
 */
\brief Pretty print buffer to opened file stream.
\param fp        File pointer.
\param sPreface  Optional buffer preface string (set to NULL for no preface).
\param buf       Buffer to print.
\param uCount    Number of bytes to print.
\param uNLFreq   Newline frequency (set to 0 for no newlines).
\param uCol      Column alignment number.
\ brief Pretty print buffer to opened file stream . \ param fp File pointer . \ param sPreface Optional buffer preface string ( set to NULL for no preface ) . \ param buf Buffer to print . \ param uCount Number of bytes to print . \ param uNLFreq Newline frequency ( set to 0 for no newlines ) . \ param uCol Column alignment number .
void nmPrintBuf(FILE       *fp,
                const char *sPreface,
                byte_t      buf[],
                size_t      uCount,
                size_t      uNLFreq,
                uint_t      uCol)
{
  size_t  i;
  if( sPreface && *sPreface )
  {
    fprintf(fp, "%s:", sPreface);
  }
  for(i=0; i<uCount; ++i)
  {
    if( (uNLFreq > 0) && ((i % uNLFreq) == 0) )
    {
      if( i != 0 )
      {
        fprintf(fp, "\n%*s", uCol, "");
      }
    }
    fprintf(fp, " 0x%02x", buf[i]);
  }
}
void nmPrintBuf ( FILE * fp , const char * sPreface , byte_t buf [ ] , size_t uCount , size_t uNLFreq , uint_t uCol ) { size_t i ; if ( sPreface && * sPreface ) { fprintf ( fp , " " , sPreface ) ; } for ( i = 0 ; i < uCount ; ++ i ) { if ( ( uNLFreq > 0 ) && ( ( i % uNLFreq ) == 0 ) ) { if ( i != 0 ) { fprintf ( fp , " \n " , uCol , " " ) ; } } fprintf ( fp , " " , buf [ i ] ) ; } }
\brief Pretty print buffer to opened file stream.
\ brief Pretty print buffer to opened file stream .