aboutsummaryrefslogtreecommitdiff
path: root/man/man3/encode.html
diff options
context:
space:
mode:
Diffstat (limited to 'man/man3/encode.html')
-rw-r--r--man/man3/encode.html109
1 files changed, 109 insertions, 0 deletions
diff --git a/man/man3/encode.html b/man/man3/encode.html
new file mode 100644
index 00000000..c7a8132c
--- /dev/null
+++ b/man/man3/encode.html
@@ -0,0 +1,109 @@
+<head>
+<title>encode(3) - Plan 9 from User Space</title>
+<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
+</head>
+<body bgcolor=#ffffff>
+<table border=0 cellpadding=0 cellspacing=0 width=100%>
+<tr height=10><td>
+<tr><td width=20><td>
+<tr><td width=20><td><b>ENCODE(3)</b><td align=right><b>ENCODE(3)</b>
+<tr><td width=20><td colspan=2>
+ <br>
+<p><font size=+1><b>NAME </b></font><br>
+
+<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
+
+ dec64, enc64, dec32, enc32, dec16, enc16, encodefmt &ndash; encoding
+ byte arrays as strings<br>
+
+</table>
+<p><font size=+1><b>SYNOPSIS </b></font><br>
+
+<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
+
+ <tt><font size=+1>#include &lt;u.h&gt;<br>
+ #include &lt;libc.h&gt;
+ <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
+ </font></tt>
+ <tt><font size=+1>int &nbsp;&nbsp;&nbsp;dec64(uchar *out, int lim, char *in, int n)
+ <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
+ </font></tt>
+ <tt><font size=+1>int &nbsp;&nbsp;&nbsp;enc64(char *out, int lim, uchar *in, int n)
+ <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
+ </font></tt>
+ <tt><font size=+1>int &nbsp;&nbsp;&nbsp;dec32(uchar *out, int lim, char *in, int n)
+ <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
+ </font></tt>
+ <tt><font size=+1>int &nbsp;&nbsp;&nbsp;enc32(char *out, int lim, uchar *in, int n)
+ <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
+ </font></tt>
+ <tt><font size=+1>int &nbsp;&nbsp;&nbsp;dec16(uchar *out, int lim, char *in, int n)
+ <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
+ </font></tt>
+ <tt><font size=+1>int &nbsp;&nbsp;&nbsp;enc16(char *out, int lim, uchar *in, int n)
+ <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
+ </font></tt>
+ <tt><font size=+1>int &nbsp;&nbsp;&nbsp;encodefmt(Fmt*)<br>
+ </font></tt>
+</table>
+<p><font size=+1><b>DESCRIPTION </b></font><br>
+
+<table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
+
+
+<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
+
+ <i>Enc16</i>, <i>enc32</i> and <i>enc64</i> create null terminated strings. They return
+ the size of the encoded string (without the null) or -1 if the
+ encoding fails. The encoding fails if <i>lim</i>, the length of the output
+ buffer, is too small.
+ <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
+
+ <i>Dec16</i>, <i>dec32</i> and <i>dec64</i> return the number of bytes decoded or -1
+ if the decoding fails. The decoding fails if the output buffer
+ is not large enough or, for base 32, if the input buffer length
+ is not a multiple of 8.
+ <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
+
+ <i>Encodefmt</i> can be used with <a href="../man3/fmtinstall.html"><i>fmtinstall</i>(3)</a> and <a href="../man3/print.html"><i>print</i>(3)</a> to print
+ encoded representations of byte arrays. The verbs are<br>
+ <tt><font size=+1>H</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;base 16 (i.e. hexadecimal). The default encoding is in upper
+ case. The <tt><font size=+1>l</font></tt> flag forces lower case.<br>
+ <tt><font size=+1>&lt;</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;base 32<br>
+ <tt><font size=+1>[</font></tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;base 64 (same as MIME)
+ <table border=0 cellpadding=0 cellspacing=0><tr height=5><td></table>
+
+ The length of the array is specified as <i>f2</i>. For example, to display
+ a 15 byte array as hex:<br>
+
+ <table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
+
+ <tt><font size=+1>char x[15];<br>
+ fmtinstall('H', encodefmt);<br>
+ print(&quot;%.*H\n&quot;, sizeof x, x);<br>
+ </font></tt>
+ </table>
+
+</table>
+<p><font size=+1><b>SOURCE </b></font><br>
+
+<table border=0 cellpadding=0 cellspacing=0><tr height=2><td><tr><td width=20><td>
+
+ <tt><font size=+1>/usr/local/plan9/src/lib9/u32.c<br>
+ /usr/local/plan9/src/lib9/u64.c<br>
+ </font></tt>
+</table>
+
+<td width=20>
+<tr height=20><td>
+</table>
+<!-- TRAILER -->
+<table border=0 cellpadding=0 cellspacing=0 width=100%>
+<tr height=15><td width=10><td><td width=10>
+<tr><td><td>
+<center>
+<a href="../../"><img src="../../dist/spaceglenda100.png" alt="Space Glenda" border=1></a>
+</center>
+</table>
+<!-- TRAILER -->
+</body></html>