xref: /dflybsd-src/share/man/man9/hexncpy.9 (revision 88cb131568c551d47f7b04eea6931bff5663ba43)
1c184c4f4SAntonio Huete Jimenez.\"
2c184c4f4SAntonio Huete Jimenez.\" Copyright (c) 2013 The DragonFly Project.  All rights reserved.
3c184c4f4SAntonio Huete Jimenez.\"
4c184c4f4SAntonio Huete Jimenez.\" Redistribution and use in source and binary forms, with or without
5c184c4f4SAntonio Huete Jimenez.\" modification, are permitted provided that the following conditions
6c184c4f4SAntonio Huete Jimenez.\" are met:
7c184c4f4SAntonio Huete Jimenez.\"
8c184c4f4SAntonio Huete Jimenez.\" 1. Redistributions of source code must retain the above copyright
9c184c4f4SAntonio Huete Jimenez.\"    notice, this list of conditions and the following disclaimer.
10c184c4f4SAntonio Huete Jimenez.\" 2. Redistributions in binary form must reproduce the above copyright
11c184c4f4SAntonio Huete Jimenez.\"    notice, this list of conditions and the following disclaimer in
12c184c4f4SAntonio Huete Jimenez.\"    the documentation and/or other materials provided with the
13c184c4f4SAntonio Huete Jimenez.\"    distribution.
14c184c4f4SAntonio Huete Jimenez.\" 3. Neither the name of The DragonFly Project nor the names of its
15c184c4f4SAntonio Huete Jimenez.\"    contributors may be used to endorse or promote products derived
16c184c4f4SAntonio Huete Jimenez.\"    from this software without specific, prior written permission.
17c184c4f4SAntonio Huete Jimenez.\"
18c184c4f4SAntonio Huete Jimenez.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19c184c4f4SAntonio Huete Jimenez.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20c184c4f4SAntonio Huete Jimenez.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21c184c4f4SAntonio Huete Jimenez.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
22c184c4f4SAntonio Huete Jimenez.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23c184c4f4SAntonio Huete Jimenez.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
24c184c4f4SAntonio Huete Jimenez.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25c184c4f4SAntonio Huete Jimenez.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
26c184c4f4SAntonio Huete Jimenez.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27c184c4f4SAntonio Huete Jimenez.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
28c184c4f4SAntonio Huete Jimenez.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29c184c4f4SAntonio Huete Jimenez.\" SUCH DAMAGE.
30c184c4f4SAntonio Huete Jimenez.\"
31c184c4f4SAntonio Huete Jimenez.Dd February 7, 2012
32c184c4f4SAntonio Huete Jimenez.Dt HEXNCPY 9
33c184c4f4SAntonio Huete Jimenez.Os
34c184c4f4SAntonio Huete Jimenez.Sh NAME
35c184c4f4SAntonio Huete Jimenez.Nm hexncpy
36c184c4f4SAntonio Huete Jimenez.Nd converts a block of bytes into an ASCII string
37c184c4f4SAntonio Huete Jimenez.Sh SYNOPSIS
38c184c4f4SAntonio Huete Jimenez.In sys/libkern.h
39c184c4f4SAntonio Huete Jimenez.Ft char *
40c184c4f4SAntonio Huete Jimenez.Fn hexncpy "const u_char *inb" "int inlen" "char *outb" "int outlen" "const char *sep"
41c184c4f4SAntonio Huete Jimenez.Sh DESCRIPTION
42c184c4f4SAntonio Huete JimenezThe
43c184c4f4SAntonio Huete Jimenez.Fn hexncpy
44*9c01c5fcSSascha Wildnerfunction converts a block of bytes to an ASCII string which represents
45*9c01c5fcSSascha Wildnerits values as hex digits.
46c184c4f4SAntonio Huete Jimenez.Bl -tag -width indent
47c184c4f4SAntonio Huete Jimenez.It Fa inb
48c184c4f4SAntonio Huete JimenezPointer to the array of bytes to be converted.
49c184c4f4SAntonio Huete Jimenez.It Fa inlen
50c184c4f4SAntonio Huete JimenezNumber of bytes to parse from the input buffer.
51c184c4f4SAntonio Huete Jimenez.It Fa outb
52c184c4f4SAntonio Huete JimenezBuffer to store the resulting string.
53c184c4f4SAntonio Huete JimenezIt should be large enough to hold all the hexadecimal characters that want to
54c184c4f4SAntonio Huete Jimenezbe represented, the separators and the null terminator character.
55c184c4f4SAntonio Huete Jimenez.It Fa outlen
56c184c4f4SAntonio Huete JimenezNumber of bytes to store in the buffer.
57c184c4f4SAntonio Huete Jimenez.It Fa sep
58c184c4f4SAntonio Huete JimenezCharacter to be used as separator
59c184c4f4SAntonio Huete Jimenez.El
60c184c4f4SAntonio Huete Jimenez.Sh RETURN VALUES
61c184c4f4SAntonio Huete JimenezThe
62c184c4f4SAntonio Huete Jimenez.Fn hexncpy
63*9c01c5fcSSascha Wildnerfunction returns a pointer to the string containing an ASCII representation
64*9c01c5fcSSascha Wildneras hex digits of the values passed in
65c184c4f4SAntonio Huete Jimenez.Fa inb .
66c184c4f4SAntonio Huete Jimenez.Sh SEE ALSO
67c184c4f4SAntonio Huete Jimenez.Xr ascii 7 ,
68c184c4f4SAntonio Huete Jimenez.Xr hexdump 9 ,
69c184c4f4SAntonio Huete Jimenez.Xr kether_ntoa 9
70c184c4f4SAntonio Huete Jimenez.Sh HISTORY
71c184c4f4SAntonio Huete JimenezThe
72c184c4f4SAntonio Huete Jimenez.Fn hexncpy
73c184c4f4SAntonio Huete Jimenezfunction first appeared in
74*9c01c5fcSSascha Wildner.Dx 3.3 .
75