85 lines
No EOL
4.3 KiB
HTML
85 lines
No EOL
4.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<title>CLiki: userial</title>
|
|
<link rel="alternate" type="application/atom+xml" title="ATOM feed of edits to current article"
|
|
href="https://www.cliki.net/site/feed/article.atom?title=userial">
|
|
<link rel="stylesheet" href="static/css/style.css">
|
|
<link rel="stylesheet" href="static/css/colorize.css">
|
|
</head>
|
|
|
|
<body>
|
|
<span class="hidden">CLiki - userial</span>
|
|
<div id="content"><div id="content-area"><div id="article-title">userial</div><div id="article">A Common Lisp library for serializing to binary buffers. This library is the serialization layer for the forthcoming <a href="https://www.cliki.net/unet" class="new">unet</a> library.<p>Homepage: <a href="http://nklein.com/software/unet/userial/">http://nklein.com/software/unet/userial/</a><p>This library is by <a href="Patrick Stein.html" class="internal">Patrick Stein</a>.<p>Here is a simple example of serializing into a buffer:
|
|
<pre>
|
|
(make-enum-serializer :opcode (:login :run :jump :logout))
|
|
(make-bitfield-serializer :login-flags (:hidden :stay-logged-in))
|
|
|
|
(serialize* :opcode :login
|
|
:uint32 sequence-number
|
|
:login-flags (:hidden)
|
|
:string login-name
|
|
:string password)
|
|
</pre><p>Here are several easy ways to unserialize the contents:
|
|
<pre>
|
|
(let (opcode sequence-number flags login-name password)
|
|
(unserialize* :opcode opcode
|
|
:uint32 sequence-number
|
|
:login-flags flags
|
|
:string login-name
|
|
:string password)
|
|
...)
|
|
|
|
(unserialize-let* (:opcode opcode
|
|
:uint32 sequence-number
|
|
:login-flags flags
|
|
:string login-name
|
|
:string password)
|
|
...)
|
|
|
|
(let ((parts (unserialize-list* '(:opcode
|
|
:uint32
|
|
:login-flags
|
|
:string
|
|
:string))))
|
|
...)
|
|
</pre><p>For more examples, see <a href="http://nklein.com/software/unet/userial/">the web page</a> or the included test cases.<p><hr>
|
|
<a href="wire format.html" class="category">wire format</a> <a href="serialization.html" class="category">serialization</a></div></div>
|
|
<div id="footer" class="buttonbar"><ul><li><a href="userial.html">Current version</a></li>
|
|
<li><a href="https://www.cliki.net/site/history?article=userial">History</a></li>
|
|
<li><a href="https://www.cliki.net/site/backlinks?article=userial">Backlinks</a></li><li><a href="https://www.cliki.net/site/edit-article?title=userial&from-revision=3686419314">Edit</a></li><li><a href="https://www.cliki.net/site/edit-article?create=t">Create</a></li></ul></div>
|
|
</div>
|
|
<div id="header-buttons" class="buttonbar">
|
|
<ul>
|
|
<li><a href="https://www.cliki.net/">Home</a></li>
|
|
<li><a href="https://www.cliki.net/site/recent-changes">Recent Changes</a></li>
|
|
<li><a href="CLiki.html">About</a></li>
|
|
<li><a href="Text Formatting.html">Text Formatting</a></li>
|
|
<li><a href="https://www.cliki.net/site/tools">Tools</a></li>
|
|
</ul>
|
|
<div id="search">
|
|
<form action="https://www.cliki.net/site/search">
|
|
<label for="search_query" class="hidden">Search CLiki</label>
|
|
<input type="text" name="query" id="search_query" value="" />
|
|
<input type="submit" value="search" />
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<div id="pageheader">
|
|
<div id="header">
|
|
<span id="logo">CLiki</span>
|
|
<span id="slogan">the common lisp wiki</span>
|
|
<div id="login"><form method="post" action="https://www.cliki.net/site/login">
|
|
<label for="login_name" class="hidden">Account name</label>
|
|
<input type="text" name="name" id="login_name" class="login_input" />
|
|
<label for= "login_password" class="hidden">Password</label>
|
|
<input type="password" name="password" id="login_password" class="login_input" />
|
|
<input type="submit" name="login" value="login" id="login_submit" /><br />
|
|
<div id="register"><a href="https://www.cliki.net/site/register">register</a></div>
|
|
<input type="submit" name="reset-pw" value="reset password" id="reset_pw" />
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body></html> |