bufdumplib
bufdumplib.h
Go to the documentation of this file.
1// Copyright 2025 Michael Reilly <mreilly@mreilly.dev>
2//
3// Redistribution and use in source and binary forms, with or without
4// modification, are permitted provided that the following conditions
5// are met:
6// 1. Redistributions of source code must retain the above copyright
7// notice, this list of conditions and the following disclaimer.
8// 2. Redistributions in binary form must reproduce the above copyright
9// notice, this list of conditions and the following disclaimer in the
10// documentation and/or other materials provided with the distribution.
11// 3. Neither the names of the copyright holders nor the names of the
12// contributors may be used to endorse or promote products derived from
13// this software without specific prior written permission.
14//
15// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16// ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
18// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS
19// OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
20// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
21// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
22// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
23// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
24// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
25// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27#ifndef _BUFDUMPLIB_H_
28#define _BUFDUMPLIB_H_
29
106int bufdumplib_dump(FILE *fp, const void *buf, size_t len, int flags);
107
182int bufdumplib_diff(FILE *fp, const void *b0, const void *b1, size_t len,
183 int flags);
184
216int bufdumplib_text(FILE *fp, const void *buf, size_t len);
217
218#endif
int bufdumplib_text(FILE *fp, const void *buf, size_t len)
Write a comma-delimited hex byte array (e.g. for use in C source) into a file pointer.
int bufdumplib_dump(FILE *fp, const void *buf, size_t len, int flags)
Write a hex dump of a binary memory buffer over the specified length into a file pointer.
int bufdumplib_diff(FILE *fp, const void *b0, const void *b1, size_t len, int flags)
Write a hex diff of two binary memory buffers over the specified length into a file pointer.