Print Functions

These functions simply print the output in a "name=value" format. More...

Functions

EXTERNRT int rtxByteToHexChar (OSOCTET byte, char *buf, OSSIZE bufsize)
 This function converts a byte value into its hex string equivalent.
EXTERNRT int rtxByteToHexCharWithPrefix (OSOCTET byte, char *buf, OSSIZE bufsize, const char *prefix)
 This function converts a byte value into its hex string equivalent.
EXTERNRT void rtxPrintBoolean (const char *name, OSBOOL value)
 Prints a boolean value to stdout.
EXTERNRT void rtxPrintDate (const char *name, const OSNumDateTime *pvalue)
 Prints a date value to stdout.
EXTERNRT void rtxPrintTime (const char *name, const OSNumDateTime *pvalue)
 Prints a time value to stdout.
EXTERNRT void rtxPrintDateTime (const char *name, const OSNumDateTime *pvalue)
 Prints a dateTime value to stdout.
EXTERNRT void rtxPrintInteger (const char *name, OSINT32 value)
 Prints an integer value to stdout.
EXTERNRT void rtxPrintInt64 (const char *name, OSINT64 value)
 Prints a 64-bit integer value to stdout.
EXTERNRT void rtxPrintUnsigned (const char *name, OSUINT32 value)
 Prints an unsigned integer value to stdout.
EXTERNRT void rtxPrintUInt64 (const char *name, OSUINT64 value)
 Prints an unsigned 64-bit integer value to stdout.
EXTERNRT void rtxPrintHexStr (const char *name, OSSIZE numocts, const OSOCTET *data)
 This function prints the value of a binary string in hex format to standard output.
EXTERNRT void rtxPrintHexStrPlain (const char *name, OSSIZE numocts, const OSOCTET *data)
 This function prints the value of a binary string in hex format to standard output.
EXTERNRT void rtxPrintHexStrNoAscii (const char *name, OSSIZE numocts, const OSOCTET *data)
 This function prints the value of a binary string in hex format to standard output.
EXTERNRT void rtxPrintHexBinary (const char *name, OSSIZE numocts, const OSOCTET *data)
 Prints an octet string value in hex binary format to stdout.
EXTERNRT void rtxPrintCharStr (const char *name, const char *cstring)
 Prints an ASCII character string value to stdout.
EXTERNRT void rtxPrintUTF8CharStr (const char *name, const OSUTF8CHAR *cstring)
 Prints a UTF-8 encoded character string value to stdout.
EXTERNRT void rtxPrintUnicodeCharStr (const char *name, const OSUNICHAR *str, int nchars)
 This function prints a Unicode string to standard output.
EXTERNRT void rtxPrintReal (const char *name, OSREAL value)
 Prints a REAL (float, double, decimal) value to stdout.
EXTERNRT void rtxPrintNull (const char *name)
 Prints a NULL value to stdout.
EXTERNRT void rtxPrintNVP (const char *name, const OSUTF8NVP *value)
 Prints a name-value pair to stdout.
EXTERNRT int rtxPrintFile (const char *filename)
 This function prints the contents of a text file to stdout.
EXTERNRT void rtxPrintIndent (OSVOIDARG)
 This function prints indentation spaces to stdout.
EXTERNRT void rtxPrintIncrIndent (OSVOIDARG)
 This function increments the current indentation level.
EXTERNRT void rtxPrintDecrIndent (OSVOIDARG)
 This function decrements the current indentation level.
EXTERNRT void rtxPrintCloseBrace (OSVOIDARG)
 This function closes a braced region by decreasing the indent level, printing indent spaces, and printing the closing brace.
EXTERNRT void rtxPrintOpenBrace (const char *)
 This function opens a braced region by printing indent spaces, printing the name and opening brace, and increasing the indent level.
EXTERNRT int rtxHexDumpToNamedFile (const char *filename, const OSOCTET *data, OSSIZE numocts)
 This function outputs a hexadecimal dump of the current buffer contents to the file with the given name.
EXTERNRT void rtxHexDumpToFile (FILE *fp, const OSOCTET *data, OSSIZE numocts)
 This function outputs a hexadecimal dump of the current buffer contents to a file.
EXTERNRT void rtxHexDumpToFileEx (FILE *fp, const OSOCTET *data, OSSIZE numocts, OSSIZE bytesPerUnit)
 This function outputs a hexadecimal dump of the current buffer to a file, but it may output the dump as an array of bytes, words, or double words.
EXTERNRT void rtxHexDumpToFileExNoAscii (FILE *fp, const OSOCTET *data, OSSIZE numocts, OSSIZE bytesPerUnit)
 This function outputs a hexadecimal dump of the current buffer to a file, but it may output the dump as an array of bytes, words, or double words.
EXTERNRT void rtxHexDump (const OSOCTET *data, OSSIZE numocts)
 This function outputs a hexadecimal dump of the current buffer contents to stdout.
EXTERNRT void rtxHexDumpEx (const OSOCTET *data, OSSIZE numocts, OSSIZE bytesPerUnit)
 This function outputs a hexadecimal dump of the current buffer contents to stdout, but it may display the dump as an array or bytes, words, or double words.
EXTERNRT int rtxHexDumpToString (const OSOCTET *data, OSSIZE numocts, char *buffer, OSSIZE bufferIndex, OSSIZE bufferSize)
 This function formats a hexadecimal dump of the current buffer contents to a string.
EXTERNRT int rtxHexDumpToStringEx (const OSOCTET *data, OSSIZE numocts, char *buffer, OSSIZE bufferIndex, OSSIZE bufferSize, OSSIZE bytesPerUnit)
 This function formats a hexadecimal dump of the current buffer contents to a string, but it may output the dump as an array of bytes, words, or double words.
EXTERNRT int rtxHexDumpFileContents (const char *inFilePath)
 This function outputs a hexadecimal dump of the contents of the named file to stdout.
EXTERNRT int rtxHexDumpFileContentsToFile (const char *inFilePath, const char *outFilePath)
 This function outputs a hexadecimal dump of the contents of the named file to a text file.
EXTERNRT char * rtxHexDiffToDynString (OSCTXT *pctxt, const OSOCTET *pdata1, const OSOCTET *pdata2, OSSIZE numocts)
 This function generates a differences report between two binary data buffers.

Detailed Description

These functions simply print the output in a "name=value" format.

The value format is obtained by calling one of the ToString functions with the given value.


Function Documentation

EXTERNRT int rtxByteToHexChar ( OSOCTET  byte,
char *  buf,
OSSIZE  bufsize 
)

This function converts a byte value into its hex string equivalent.

Parameters:
byte Byte to format.
buf Output buffer.
bufsize Output buffer size.
EXTERNRT int rtxByteToHexCharWithPrefix ( OSOCTET  byte,
char *  buf,
OSSIZE  bufsize,
const char *  prefix 
)

This function converts a byte value into its hex string equivalent.

The hex string for this function is prefixed with the given parameter.

Parameters:
byte Byte to format.
buf Output buffer.
bufsize Output buffer size.
prefix The string prefix.
EXTERNRT char* rtxHexDiffToDynString ( OSCTXT pctxt,
const OSOCTET *  pdata1,
const OSOCTET *  pdata2,
OSSIZE  numocts 
)

This function generates a differences report between two binary data buffers.

The buffers are assumed to each contain the same number of bytes. The result of the comparison operation is returned in a dynamic allocated using the rtxMemAlloc function. The buffer may be freed using the rtxMemFreePtr function.

Parameters:
pctxt Pointer to context structure.
pdata1 Pointer to first binary buffer to compare.
pdata2 Pointer to second binary buffer to compare.
numocts Number of bytes to compare.
Returns:
Result of comparison in dynamically allocated string buffer. Null means buffers have no differences. The format of the output is '[x]yy != zz, ...' where x is index and yy and zz are byte values.
EXTERNRT void rtxHexDump ( const OSOCTET *  data,
OSSIZE  numocts 
)

This function outputs a hexadecimal dump of the current buffer contents to stdout.

Parameters:
data The pointer to a buffer to be displayed.
numocts The number of octets to be displayed.
EXTERNRT void rtxHexDumpEx ( const OSOCTET *  data,
OSSIZE  numocts,
OSSIZE  bytesPerUnit 
)

This function outputs a hexadecimal dump of the current buffer contents to stdout, but it may display the dump as an array or bytes, words, or double words.

Parameters:
data The pointer to a buffer to be displayed.
numocts The number of octets to be displayed.
bytesPerUnit The number of bytes in one unit. May be 1 (byte), 2 (word), or 4 (double word).
EXTERNRT int rtxHexDumpFileContents ( const char *  inFilePath  ) 

This function outputs a hexadecimal dump of the contents of the named file to stdout.

Parameters:
inFilePath Name of file to be dumped.
EXTERNRT int rtxHexDumpFileContentsToFile ( const char *  inFilePath,
const char *  outFilePath 
)

This function outputs a hexadecimal dump of the contents of the named file to a text file.

Parameters:
inFilePath Name of file to be dumped.
outFilePath Name of file to which dump contents will be written.
EXTERNRT void rtxHexDumpToFile ( FILE *  fp,
const OSOCTET *  data,
OSSIZE  numocts 
)

This function outputs a hexadecimal dump of the current buffer contents to a file.

Parameters:
fp A pointer to FILE structure. The file should be opened for writing.
data The pointer to a buffer to be displayed.
numocts The number of octets to be displayed
EXTERNRT void rtxHexDumpToFileEx ( FILE *  fp,
const OSOCTET *  data,
OSSIZE  numocts,
OSSIZE  bytesPerUnit 
)

This function outputs a hexadecimal dump of the current buffer to a file, but it may output the dump as an array of bytes, words, or double words.

Parameters:
fp A pointer to FILE structure. The file should be opened for writing.
data The pointer to a buffer to be displayed.
numocts The number of octets to be displayed.
bytesPerUnit The number of bytes in one unit. May be 1 (byte), 2 (word), or 4 (double word).
EXTERNRT void rtxHexDumpToFileExNoAscii ( FILE *  fp,
const OSOCTET *  data,
OSSIZE  numocts,
OSSIZE  bytesPerUnit 
)

This function outputs a hexadecimal dump of the current buffer to a file, but it may output the dump as an array of bytes, words, or double words.

This function never contains an ASCII dump.

Parameters:
fp A pointer to FILE structure. The file should be opened for writing.
data The pointer to a buffer to be displayed.
numocts The number of octets to be displayed.
bytesPerUnit The number of bytes in one unit. May be 1 (byte), 2 (word), or 4 (double word).
EXTERNRT int rtxHexDumpToNamedFile ( const char *  filename,
const OSOCTET *  data,
OSSIZE  numocts 
)

This function outputs a hexadecimal dump of the current buffer contents to the file with the given name.

The file is opened or created and then closed after the writer operation is complete.

Parameters:
filename Full path to file to which data should be output.
data The pointer to a buffer to be displayed.
numocts The number of octets to be displayed
EXTERNRT int rtxHexDumpToString ( const OSOCTET *  data,
OSSIZE  numocts,
char *  buffer,
OSSIZE  bufferIndex,
OSSIZE  bufferSize 
)

This function formats a hexadecimal dump of the current buffer contents to a string.

Parameters:
data The pointer to a buffer to be displayed.
numocts The number of octets to be displayed.
buffer The destination string buffer.
bufferIndex The starting position in the destination buffer. The formatting of the dump will begin at this position.
bufferSize The total size of the destination buffer.
Returns:
The length of the final string.
EXTERNRT int rtxHexDumpToStringEx ( const OSOCTET *  data,
OSSIZE  numocts,
char *  buffer,
OSSIZE  bufferIndex,
OSSIZE  bufferSize,
OSSIZE  bytesPerUnit 
)

This function formats a hexadecimal dump of the current buffer contents to a string, but it may output the dump as an array of bytes, words, or double words.

Parameters:
data The pointer to a buffer to be displayed.
numocts The number of octets to be displayed.
buffer The destination string buffer.
bufferIndex The starting position in the destination buffer. The formatting of the dump will begin at this position.
bufferSize The total size of the destination buffer.
bytesPerUnit The number of bytes in one unit. May be 1 (byte), 2 (word), or 4 (double word).
Returns:
The length of the final string.
EXTERNRT void rtxPrintBoolean ( const char *  name,
OSBOOL  value 
)

Prints a boolean value to stdout.

Parameters:
name The name of the variable to print.
value Boolean value to print.
EXTERNRT void rtxPrintCharStr ( const char *  name,
const char *  cstring 
)

Prints an ASCII character string value to stdout.

Parameters:
name The name of the variable to print.
cstring A pointer to the character string to be printed.
EXTERNRT void rtxPrintDate ( const char *  name,
const OSNumDateTime pvalue 
)

Prints a date value to stdout.

Parameters:
name Name of the variable to print.
pvalue Pointer to a structure that holds numeric DateTime value to print.
EXTERNRT void rtxPrintDateTime ( const char *  name,
const OSNumDateTime pvalue 
)

Prints a dateTime value to stdout.

Parameters:
name Name of the variable to print.
pvalue Pointer to a structure that holds numeric DateTime value to print.
EXTERNRT int rtxPrintFile ( const char *  filename  ) 

This function prints the contents of a text file to stdout.

Parameters:
filename The name of the text file to print.
Returns:
Status of operation, 0 if success.
EXTERNRT void rtxPrintHexBinary ( const char *  name,
OSSIZE  numocts,
const OSOCTET *  data 
)

Prints an octet string value in hex binary format to stdout.

Parameters:
name The name of the variable to print.
numocts The number of octets to be printed.
data A pointer to the data to be printed.
EXTERNRT void rtxPrintHexStr ( const char *  name,
OSSIZE  numocts,
const OSOCTET *  data 
)

This function prints the value of a binary string in hex format to standard output.

If the string is 32 bytes or less, it is printed on a single line with a '0x' prefix. If longer, a formatted hex dump showing both hex and ascii codes is done.

Parameters:
name The name of the variable to print.
numocts The number of octets to be printed.
data A pointer to the data to be printed.
EXTERNRT void rtxPrintHexStrNoAscii ( const char *  name,
OSSIZE  numocts,
const OSOCTET *  data 
)

This function prints the value of a binary string in hex format to standard output.

In contrast to rtxPrintHexStr, it never contains an ASCII dump.

Parameters:
name The name of the variable to print.
numocts The number of octets to be printed.
data A pointer to the data to be printed.
EXTERNRT void rtxPrintHexStrPlain ( const char *  name,
OSSIZE  numocts,
const OSOCTET *  data 
)

This function prints the value of a binary string in hex format to standard output.

In contrast to rtxPrintHexStr, it is always printed on a single line with a '0x' prefix.

Parameters:
name The name of the variable to print.
numocts The number of octets to be printed.
data A pointer to the data to be printed.
EXTERNRT void rtxPrintInt64 ( const char *  name,
OSINT64  value 
)

Prints a 64-bit integer value to stdout.

Parameters:
name The name of the variable to print.
value 64-bit integer value to print.
EXTERNRT void rtxPrintInteger ( const char *  name,
OSINT32  value 
)

Prints an integer value to stdout.

Parameters:
name The name of the variable to print.
value Integer value to print.
EXTERNRT void rtxPrintNull ( const char *  name  ) 

Prints a NULL value to stdout.

Parameters:
name The name of the variable to print.
EXTERNRT void rtxPrintNVP ( const char *  name,
const OSUTF8NVP *  value 
)

Prints a name-value pair to stdout.

Parameters:
name The name of the variable to print.
value A pointer to name-value pair structure to print.
EXTERNRT void rtxPrintReal ( const char *  name,
OSREAL  value 
)

Prints a REAL (float, double, decimal) value to stdout.

Parameters:
name The name of the variable to print.
value REAL value to print.
EXTERNRT void rtxPrintTime ( const char *  name,
const OSNumDateTime pvalue 
)

Prints a time value to stdout.

Parameters:
name Name of the variable to print.
pvalue Pointer to a structure that holds numeric DateTime value to print.
EXTERNRT void rtxPrintUInt64 ( const char *  name,
OSUINT64  value 
)

Prints an unsigned 64-bit integer value to stdout.

Parameters:
name The name of the variable to print.
value Unsigned 64-bit integer value to print.
EXTERNRT void rtxPrintUnicodeCharStr ( const char *  name,
const OSUNICHAR *  str,
int  nchars 
)

This function prints a Unicode string to standard output.

Characters in the string that are within the normal Ascii range are printed as single characters. Characters outside the Ascii range are printed as 4-byte hex codes (0xnnnn).

Parameters:
name The name of the variable to print.
str Pointer to unicode sring to be printed. String is an array of C unsigned short data variables.
nchars Number of characters in the string. If value is negative, string is assumed to be null-terminated (i.e. ends with a 0x0000 character).
EXTERNRT void rtxPrintUnsigned ( const char *  name,
OSUINT32  value 
)

Prints an unsigned integer value to stdout.

Parameters:
name The name of the variable to print.
value Unsigned integer value to print.
EXTERNRT void rtxPrintUTF8CharStr ( const char *  name,
const OSUTF8CHAR *  cstring 
)

Prints a UTF-8 encoded character string value to stdout.

Parameters:
name The name of the variable to print.
cstring A pointer to the character string to be printed.