14fb638c3SScott Long.\" -*- nroff -*- 24fb638c3SScott Long.\" 34fb638c3SScott Long.\" Copyright (c) 2003 Scott Long 44fb638c3SScott Long.\" 54fb638c3SScott Long.\" All rights reserved. 64fb638c3SScott Long.\" 74fb638c3SScott Long.\" This program is free software. 84fb638c3SScott Long.\" 94fb638c3SScott Long.\" Redistribution and use in source and binary forms, with or without 104fb638c3SScott Long.\" modification, are permitted provided that the following conditions 114fb638c3SScott Long.\" are met: 124fb638c3SScott Long.\" 1. Redistributions of source code must retain the above copyright 134fb638c3SScott Long.\" notice, this list of conditions and the following disclaimer. 144fb638c3SScott Long.\" 2. Redistributions in binary form must reproduce the above copyright 154fb638c3SScott Long.\" notice, this list of conditions and the following disclaimer in the 164fb638c3SScott Long.\" documentation and/or other materials provided with the distribution. 174fb638c3SScott Long.\" 184fb638c3SScott Long.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR 194fb638c3SScott Long.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 204fb638c3SScott Long.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 214fb638c3SScott Long.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, 224fb638c3SScott Long.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 234fb638c3SScott Long.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 244fb638c3SScott Long.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 254fb638c3SScott Long.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 264fb638c3SScott Long.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 274fb638c3SScott Long.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 284fb638c3SScott Long.\" 294fb638c3SScott Long.Dd December 7, 2003 304fb638c3SScott Long.Dt HEXDUMP 9 31*aa12cea2SUlrich Spörlein.Os 324fb638c3SScott Long.Sh NAME 334fb638c3SScott Long.Nm hexdump 34db79bbffSRuslan Ermilov.Nd "dump a block of bytes to the console in hexadecimal form" 354fb638c3SScott Long.Sh SYNOPSIS 364fb638c3SScott Long.In sys/systm.h 374fb638c3SScott Long.Ft void 384fb638c3SScott Long.Fn hexdump "void *ptr" "int length" "const char *hdr" "int flags" 394fb638c3SScott Long.Sh DESCRIPTION 40db79bbffSRuslan ErmilovThe 41db79bbffSRuslan Ermilov.Fn hexdump 42db79bbffSRuslan Ermilovfunction prints an array of bytes to the console in hexadecimal form, along with 43db79bbffSRuslan Ermilovthe 44db79bbffSRuslan Ermilov.Tn ASCII 45db79bbffSRuslan Ermilovrepresentation of the bytes, if possible. 46d5a8819cSHiten PandyaBy default, each line of 47a61f1504SPeter Pentchevoutput will start with an offset count, followed by 16 hexadecimal values, 48db79bbffSRuslan Ermilovfollowed by 16 49db79bbffSRuslan Ermilov.Tn ASCII 50db79bbffSRuslan Ermilovcharacters. 51db79bbffSRuslan Ermilov.Bl -tag -width indent 524fb638c3SScott Long.It Fa ptr 53d5a8819cSHiten PandyaPointer to the array of bytes to print. 54db79bbffSRuslan ErmilovIt does not need to be 55db79bbffSRuslan Ermilov.Dv NUL Ns 56db79bbffSRuslan Ermilov-terminated. 574fb638c3SScott Long.It Fa length 58db79bbffSRuslan ErmilovNumber of bytes to print. 594fb638c3SScott Long.It Fa hdr 60db79bbffSRuslan ErmilovPointer to a 61db79bbffSRuslan Ermilov.Dv NUL Ns 62db79bbffSRuslan Ermilov-terminated character string that will be prepended to each 63d5a8819cSHiten Pandyaline of output. 64db79bbffSRuslan ErmilovA value of 65db79bbffSRuslan Ermilov.Dv NULL 66db79bbffSRuslan Ermilovimplies that no header will be printed. 674fb638c3SScott Long.It Fa flags 68db79bbffSRuslan ErmilovFlags for controlling the formatting of the output. 69db79bbffSRuslan Ermilov.Bl -tag -width ".Dv HD_OMIT_COUNT" 70db79bbffSRuslan Ermilov.It Bits 0-7 71d5a8819cSHiten PandyaInteger value of the number of bytes to display on each line. 72d5a8819cSHiten PandyaA value of 0 implies that the default value of 16 will be used. 73db79bbffSRuslan Ermilov.It Bits 8-15 74db79bbffSRuslan ErmilovCharacter 75db79bbffSRuslan Ermilov.Tn ASCII 76db79bbffSRuslan Ermilovvalue to use as the separator for the hexadecimal output. 77db79bbffSRuslan ErmilovA value of 0 implies that the default value of 32 78db79bbffSRuslan Ermilov.Tn ( ASCII 79db79bbffSRuslan Ermilovspace) will be used. 80db79bbffSRuslan Ermilov.It Dv HD_OMIT_COUNT 81db79bbffSRuslan ErmilovDo not print the offset column at the beginning of each line. 82db79bbffSRuslan Ermilov.It Dv HD_OMIT_HEX 83db79bbffSRuslan ErmilovDo not print the hexadecimal values on each line. 84db79bbffSRuslan Ermilov.It Dv HD_OMIT_CHARS 85db79bbffSRuslan ErmilovDo not print the character values on each line. 864fb638c3SScott Long.El 874fb638c3SScott Long.El 884fb638c3SScott Long.Sh SEE ALSO 894fb638c3SScott Long.Xr ascii 7 904fb638c3SScott Long.Sh AUTHORS 91571dba6eSHiten PandyaThis manual page was written by 924fb638c3SScott Long.An Scott Long . 93