Skip to content

File wsh_shell_misc.c

FileList > src > wsh_shell_misc.c

Go to the source code of this file

  • #include "wsh_shell_misc.h"
  • #include "wsh_shell_str.h"

Public Functions

Type Name
void WshShellMisc_AsciiPrint (const WshShell_U8_t * pBuff, WshShell_Size_t len)
Print a ASCII dump of a buffer.
WshShell_U32_t WshShellMisc_CalcJenkinsHash (const WshShell_U8_t * pcBuff, WshShell_Size_t len)
Calculate Jenkins one-at-a-time hash.
void WshShellMisc_HexDump (const WshShell_U8_t * pBuff, WshShell_Size_t len, WshShell_Size_t offset)
Print a hex + ASCII dump of a buffer (hexdump -C style).

Public Functions Documentation

function WshShellMisc_AsciiPrint

Print a ASCII dump of a buffer.

1
2
3
4
void WshShellMisc_AsciiPrint (
    const WshShell_U8_t * pBuff,
    WshShell_Size_t len
) 

Parameters:

  • pBuff Pointer to the data buffer.
  • len Number of bytes to dump.

function WshShellMisc_CalcJenkinsHash

Calculate Jenkins one-at-a-time hash.

1
2
3
4
WshShell_U32_t WshShellMisc_CalcJenkinsHash (
    const WshShell_U8_t * pcBuff,
    WshShell_Size_t len
) 

Jenkins hash function https://en.wikipedia.org/wiki/Jenkins_hash_function


function WshShellMisc_HexDump

Print a hex + ASCII dump of a buffer (hexdump -C style).

1
2
3
4
5
void WshShellMisc_HexDump (
    const WshShell_U8_t * pBuff,
    WshShell_Size_t len,
    WshShell_Size_t offset
) 

Each row contains the byte offset, up to 16 bytes in hex (split into two groups of 8), and their printable ASCII representation. Non-printable bytes are shown as '.'.

Example output:

00000000  57 73 68 53 68 65 6c 6c  00 01 7e 7f 80 ff       |WshShell..~...|

Parameters:

  • pBuff Pointer to the data buffer. May be NULL only when len == 0.
  • len Number of bytes to dump.
  • offset Base value printed in the offset column (use 0 for relative offsets).


The documentation for this class was generated from the following file src/wsh_shell_misc.c