From 81756b45ddbfc445e6c0c327a99c727747aa1e3e Mon Sep 17 00:00:00 2001 From: Alexander Vdolainen Date: Thu, 9 Oct 2025 23:05:00 +0300 Subject: [PATCH] ndbuf_read_* man pages has been added; --- man/Makefile.am | 4 ++- man/ndbuf_read_raw.3 | 65 ++++++++++++++++++++++++++++++++++++++++++++ man/ndbuf_read_u16.3 | 1 + man/ndbuf_read_u32.3 | 1 + man/ndbuf_read_u64.3 | 1 + man/ndbuf_read_u8.3 | 1 + 6 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 man/ndbuf_read_raw.3 create mode 120000 man/ndbuf_read_u16.3 create mode 120000 man/ndbuf_read_u32.3 create mode 120000 man/ndbuf_read_u64.3 create mode 120000 man/ndbuf_read_u8.3 diff --git a/man/Makefile.am b/man/Makefile.am index 8df0c4b..f609602 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -1,2 +1,4 @@ man_MANS = ndbuf_new.3 ndbuf_new_palloc.3 ndbuf_new_wmops.3 ndbuf_new_frombuf.3 \ - ndbuf_free.3 ndbuf_free_item.3 + ndbuf_free.3 ndbuf_free_item.3 ndbuf_read_raw.3 ndbuf_read_u8.3 ndbuf_read_u16.3 \ + ndbuf_read_u32.3 ndbuf_read_u64.3 + diff --git a/man/ndbuf_read_raw.3 b/man/ndbuf_read_raw.3 new file mode 100644 index 0000000..6d9bbac --- /dev/null +++ b/man/ndbuf_read_raw.3 @@ -0,0 +1,65 @@ +.TH NDBUF_READ_RAW 3 "15 September 2018" "NDBUF" "Binary buffers lib manual" +.SH NAME +ndbuf_read_u8 \- Read unsigned 8 bit value from buffer +.br +ndbuf_read_u16 \- Read unsigned 16 bit value from buffer +.br +ndbuf_read_u32 \- Read unsigned 32 bit value from buffer +.br +ndbuf_read_u64 \- Read unsigned 64 bit value from buffer +.br +ndbuf_read_raw \- Read raw data with pointed length +.br +.SH SYNOPSIS +.B #include +.sp +uint32_t ndbuf_read_u8(ndbuf_t *, uint8_t *); + +uint32_t ndbuf_read_u16(ndbuf_t *, uint16_t *); + +uint32_t ndbuf_read_u32(ndbuf_t *, uint32_t *); + +uint32_t ndbuf_read_u64(ndbuf_t *, uint64_t *); + +uint32_t ndbuf_read_raw(ndbuf_t *, void *, uint32_t); +.br +.sp +.SH DESCRIPTION +Those functions reads a data from the +.B ndbuf_t +structure. Returns amount of bytes ridden or 0 in case of error. +.br +.B ndbuf_read_u8 +, +.B ndbuf_read_u16 +, +.B ndbuf_read_u32 +, +.B ndbuf_read_u64 +functions copies an integer values from +.B ndbuf_t +structure to the second function argument. +.br +.B ndbuf_read_raw +function copies raw data from +.B ndbuf_t +structure to the second argument with provided length in the third argument. Memory of appropriate length should be preallocated at the given pointer. +.br +.SH BUGS +Not known yet. +.SH EXAMPLE +None. +.SH APPLICATION USAGE +None. +.SH RATIONALE +This family of functions might be used when the copy of the data is required, otherwise use +.B ndbuf_escan +family of functions. +.SH SEE ALSO +.BI ndbuf_write_raw(3), ndbuf_escan(3) +.SH COPYRIGHT +This software licensed under GNU LGPL v2.1 or later. See COPYING for further details. +.br +(c) Authors of libndbuf 2017-2018 +.SH AUTHOR +Alexander Vdolainen (alex@vapaa.xyz) diff --git a/man/ndbuf_read_u16.3 b/man/ndbuf_read_u16.3 new file mode 120000 index 0000000..f6489ee --- /dev/null +++ b/man/ndbuf_read_u16.3 @@ -0,0 +1 @@ +ndbuf_read_raw.3 \ No newline at end of file diff --git a/man/ndbuf_read_u32.3 b/man/ndbuf_read_u32.3 new file mode 120000 index 0000000..f6489ee --- /dev/null +++ b/man/ndbuf_read_u32.3 @@ -0,0 +1 @@ +ndbuf_read_raw.3 \ No newline at end of file diff --git a/man/ndbuf_read_u64.3 b/man/ndbuf_read_u64.3 new file mode 120000 index 0000000..f6489ee --- /dev/null +++ b/man/ndbuf_read_u64.3 @@ -0,0 +1 @@ +ndbuf_read_raw.3 \ No newline at end of file diff --git a/man/ndbuf_read_u8.3 b/man/ndbuf_read_u8.3 new file mode 120000 index 0000000..f6489ee --- /dev/null +++ b/man/ndbuf_read_u8.3 @@ -0,0 +1 @@ +ndbuf_read_raw.3 \ No newline at end of file