.\" -*-nroff-*-
-.TH codec 3 "9 January 2009" "Straylight/Edgeware" "mLib utilities library"
-.SH NAME
-codec \- binary encoding and decoding
+.\"
+.\" Manual for new-fangled binary encoding and decoding
+.\"
+.\" (c) 2009, 2014, 2015, 2019, 2023, 2024 Straylight/Edgeware
+.\"
+.
+.\"----- Licensing notice ---------------------------------------------------
+.\"
+.\" This file is part of the mLib utilities library.
+.\"
+.\" mLib is free software: you can redistribute it and/or modify it under
+.\" the terms of the GNU Library General Public License as published by
+.\" the Free Software Foundation; either version 2 of the License, or (at
+.\" your option) any later version.
+.\"
+.\" mLib is distributed in the hope that it will be useful, but WITHOUT
+.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+.\" License for more details.
+.\"
+.\" You should have received a copy of the GNU Library General Public
+.\" License along with mLib. If not, write to the Free Software
+.\" Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+.\" USA.
+.
+.\"--------------------------------------------------------------------------
+.so ../defs.man \" @@@PRE@@@
+.
+.\"--------------------------------------------------------------------------
+.TH codec 3mLib "9 January 2009" "Straylight/Edgeware" "mLib utilities library"
.\" @codec_class
.\" @codec_strerror
.\" @null_codec_class
.\" @base32_class
.\" @base32hex_class
.\" @hex_class
+.
+.\"--------------------------------------------------------------------------
+.SH NAME
+codec \- binary encoding and decoding
+.
+.\"--------------------------------------------------------------------------
.SH SYNOPSIS
+.
.nf
.B "#include <mLib/codec.h>"
.B "#include <mLib/base64.h>"
.PP
.BI "const char *codec_strerror(int " err ");"
.fi
+.
+.\"--------------------------------------------------------------------------
.SH DESCRIPTION
+.
The
.B codec
system provides an object-based interface to functions which encode
binary data as plain text and decode the result to recover the original
binary data. The interface makes it easy to support multiple encodings
and select an appropriate one at runtime.
+.
.SS "The codec_class structure"
The
.B codec_class
corresponding encoder would produce (with
.I maxline
= 0 to inhibit line-breaking).
+.
.SS "The codec and codec_ops structures"
The
.B codec
.B codec_strerror
function converts these error codes to brief, (moderately)
human-readable strings.
+.
.SS "Provided codecs"
The library provides a number of standard codecs.
.TP
Implements hex encoding, defined by RFC4648 under the name Base16. For
compatibility with that specification, output is in upper case by
default.
+.
+.\"--------------------------------------------------------------------------
.SH "SEE ALSO"
+.
.BR bincode (1),
.BR dstr (3),
.BR mLib (3).
+.
+.\"--------------------------------------------------------------------------
.SH AUTHOR
+.
Mark Wooding, <mdw@distorted.org.uk>
+.
+.\"----- That's all, folks --------------------------------------------------