1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
2
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
5
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
6
<meta name="generator" content="AsciiDoc 8.6.3" />
7
<title>zmq_msg_init(3)</title>
8
<style type="text/css">
10
h1, h2, h3, h4, h5, h6,
11
div.title, caption.title,
12
thead, p.table.header,
14
span#author, span#revnumber, span#revdate, span#revremark,
16
font-family: Arial,Helvetica,sans-serif;
21
font-family: Georgia,"Times New Roman",Times,serif;
30
margin: 1em 5% 1em 5%;
35
text-decoration: underline;
56
h1, h2, h3, h4, h5, h6 {
64
border-bottom: 2px solid silver;
81
border: 1px solid silver;
92
ul > li { color: #aaa; }
93
ul > li > * { color: black; }
107
span#revnumber, span#revdate, span#revremark {
112
border-top: 2px solid silver;
118
padding-bottom: 0.5em;
122
padding-bottom: 0.5em;
127
margin-bottom: 1.5em;
129
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
130
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
131
div.admonitionblock {
133
margin-bottom: 1.5em;
135
div.admonitionblock {
137
margin-bottom: 2.0em;
142
div.content { /* Block element content. */
146
/* Block element titles. */
147
div.title, caption.title {
152
margin-bottom: 0.5em;
158
td div.title:first-child {
161
div.content div.title:first-child {
164
div.content + div.title {
168
div.sidebarblock > div.content {
170
border: 1px solid #dddddd;
171
border-left: 4px solid #f0f0f0;
175
div.listingblock > div.content {
176
border: 1px solid #dddddd;
177
border-left: 5px solid #f0f0f0;
182
div.quoteblock, div.verseblock {
186
border-left: 5px solid #f0f0f0;
190
div.quoteblock > div.attribution {
195
div.verseblock > pre.content {
196
font-family: inherit;
199
div.verseblock > div.attribution {
203
/* DEPRECATED: Pre version 8.2.7 verse style literal block. */
204
div.verseblock + div.attribution {
208
div.admonitionblock .icon {
212
text-decoration: underline;
214
padding-right: 0.5em;
216
div.admonitionblock td.content {
218
border-left: 3px solid #dddddd;
221
div.exampleblock > div.content {
222
border-left: 3px solid #dddddd;
226
div.imageblock div.content { padding-left: 0; }
227
span.image img { border-style: none; }
228
a.image:visited { color: white; }
232
margin-bottom: 0.8em;
245
list-style-position: outside;
248
list-style-type: decimal;
251
list-style-type: lower-alpha;
254
list-style-type: upper-alpha;
257
list-style-type: lower-roman;
260
list-style-type: upper-roman;
263
div.compact ul, div.compact ol,
264
div.compact p, div.compact p,
265
div.compact div, div.compact div {
267
margin-bottom: 0.1em;
270
div.tableblock > table {
271
border: 3px solid #527bbd;
273
thead, p.table.header {
286
/* Because the table frame attribute is overriden by CSS in most browsers. */
287
div.tableblock > table[frame="void"] {
290
div.tableblock > table[frame="hsides"] {
291
border-left-style: none;
292
border-right-style: none;
294
div.tableblock > table[frame="vsides"] {
295
border-top-style: none;
296
border-bottom-style: none;
302
margin-bottom: 0.8em;
305
padding-bottom: 15px;
307
dt.hdlist1.strong, td.hdlist1.strong {
313
padding-right: 0.8em;
319
div.hdlist.compact tr {
328
.footnote, .footnoteref {
332
span.footnote, span.footnoteref {
333
vertical-align: super;
337
margin: 20px 0 20px 0;
341
#footnotes div.footnote {
347
border-top: 1px solid silver;
356
padding-right: 0.5em;
357
padding-bottom: 0.3em;
365
div#footer-badges { display: none; }
369
margin-bottom: 2.5em;
377
margin-bottom: 0.1em;
380
div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 {
397
/* Overrides for manpage documents */
400
padding-bottom: 0.5em;
401
border-top: 2px solid silver;
402
border-bottom: 2px solid silver;
412
div#toc { display: none; }
416
<script type="text/javascript">
418
window.onload = function(){asciidoc.footnotes();}
419
var asciidoc = { // Namespace.
421
/////////////////////////////////////////////////////////////////////
422
// Table Of Contents generator
423
/////////////////////////////////////////////////////////////////////
425
/* Author: Mihai Bazon, September 2002
426
* http://students.infoiasi.ro/~mishoo
428
* Table Of Content generator
431
* Feel free to use this script under the terms of the GNU General Public
432
* License, as long as you do not remove or alter this notice.
435
/* modified by Troy D. Hanson, September 2006. License: GPL */
436
/* modified by Stuart Rackham, 2006, 2009. License: GPL */
439
toc: function (toclevels) {
441
function getText(el) {
443
for (var i = el.firstChild; i != null; i = i.nextSibling) {
444
if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
446
else if (i.firstChild != null)
452
function TocEntry(el, text, toclevel) {
455
this.toclevel = toclevel;
458
function tocEntries(el, toclevels) {
459
var result = new Array;
460
var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
461
// Function that scans the DOM tree for header elements (the DOM2
462
// nodeIterator API would be a better technique but not supported by all
464
var iterate = function (el) {
465
for (var i = el.firstChild; i != null; i = i.nextSibling) {
466
if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
467
var mo = re.exec(i.tagName);
468
if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
469
result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
479
var toc = document.getElementById("toc");
480
var entries = tocEntries(document.getElementById("content"), toclevels);
481
for (var i = 0; i < entries.length; ++i) {
482
var entry = entries[i];
483
if (entry.element.id == "")
484
entry.element.id = "_toc_" + i;
485
var a = document.createElement("a");
486
a.href = "#" + entry.element.id;
487
a.appendChild(document.createTextNode(entry.text));
488
var div = document.createElement("div");
490
div.className = "toclevel" + entry.toclevel;
491
toc.appendChild(div);
493
if (entries.length == 0)
494
toc.parentNode.removeChild(toc);
498
/////////////////////////////////////////////////////////////////////
499
// Footnotes generator
500
/////////////////////////////////////////////////////////////////////
502
/* Based on footnote generation code from:
503
* http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
506
footnotes: function () {
507
var cont = document.getElementById("content");
508
var noteholder = document.getElementById("footnotes");
509
var spans = cont.getElementsByTagName("span");
512
for (i=0; i<spans.length; i++) {
513
if (spans[i].className == "footnote") {
515
// Use [\s\S] in place of . so multi-line matches work.
516
// Because JavaScript has no s (dotall) regex flag.
517
note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
518
noteholder.innerHTML +=
519
"<div class='footnote' id='_footnote_" + n + "'>" +
520
"<a href='#_footnoteref_" + n + "' title='Return to text'>" +
521
n + "</a>. " + note + "</div>";
523
"[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
524
"' title='View footnote' class='footnote'>" + n + "</a>]";
525
var id =spans[i].getAttribute("id");
526
if (id != null) refs["#"+id] = n;
530
noteholder.parentNode.removeChild(noteholder);
532
// Process footnoterefs.
533
for (i=0; i<spans.length; i++) {
534
if (spans[i].className == "footnoteref") {
535
var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
536
href = href.match(/#.*/)[0]; // Because IE return full URL.
539
"[<a href='#_footnote_" + n +
540
"' title='View footnote' class='footnote'>" + n + "</a>]";
550
<body class="manpage">
553
zmq_msg_init(3) Manual Page
556
<div class="sectionbody">
558
initialise empty 0MQ message
564
<h2 id="_synopsis">SYNOPSIS</h2>
565
<div class="sectionbody">
566
<div class="paragraph"><p><strong>int zmq_msg_init (zmq_msg_t <em>*msg</em>);</strong></p></div>
570
<h2 id="_description">DESCRIPTION</h2>
571
<div class="sectionbody">
572
<div class="paragraph"><p>The <em>zmq_msg_init()</em> function shall initialise the message object referenced by
573
<em>msg</em> to represent an empty message. This function is most useful when called
574
before receiving a message with <em>zmq_recv()</em>.</p></div>
575
<div class="admonitionblock">
578
<div class="title">Caution</div>
580
<td class="content">Never access <em>zmq_msg_t</em> members directly, instead always use the
581
<em>zmq_msg</em> family of functions.</td>
584
<div class="admonitionblock">
587
<div class="title">Caution</div>
589
<td class="content">The functions <em>zmq_msg_init()</em>, <em>zmq_msg_init_data()</em> and
590
<em>zmq_msg_init_size()</em> are mutually exclusive. Never initialize the same
591
<em>zmq_msg_t</em> twice.</td>
597
<h2 id="_return_value">RETURN VALUE</h2>
598
<div class="sectionbody">
599
<div class="paragraph"><p>The <em>zmq_msg_init()</em> function shall return zero if successful. Otherwise it
600
shall return <tt>-1</tt> and set <em>errno</em> to one of the values defined below.</p></div>
604
<h2 id="_errors">ERRORS</h2>
605
<div class="sectionbody">
606
<div class="paragraph"><p>No errors are defined.</p></div>
610
<h2 id="_example">EXAMPLE</h2>
611
<div class="sectionbody">
612
<div class="listingblock">
613
<div class="title">Receiving a message from a socket</div>
614
<div class="content">
615
<pre><tt>zmq_msg_t msg;
616
rc = zmq_msg_init (&msg);
618
rc = zmq_recv (socket, &msg, 0);
619
assert (rc == 0);</tt></pre>
624
<h2 id="_see_also">SEE ALSO</h2>
625
<div class="sectionbody">
626
<div class="paragraph"><p><a href="zmq_msg_init_size.html">zmq_msg_init_size(3)</a>
627
<a href="zmq_msg_init_data.html">zmq_msg_init_data(3)</a>
628
<a href="zmq_msg_close.html">zmq_msg_close(3)</a>
629
<a href="zmq_msg_data.html">zmq_msg_data(3)</a>
630
<a href="zmq_msg_size.html">zmq_msg_size(3)</a>
631
<a href="zmq.html">zmq(7)</a></p></div>
635
<h2 id="_authors">AUTHORS</h2>
636
<div class="sectionbody">
637
<div class="paragraph"><p>The ØMQ documentation was written by Martin Sustrik <<a href="mailto:sustrik@250bpm.com">sustrik@250bpm.com</a>> and
638
Martin Lucina <<a href="mailto:martin@lucina.net">martin@lucina.net</a>>.</p></div>
642
<div id="footnotes"><hr /></div>
644
<div id="footer-text">
646
Last updated 2011-12-18 11:17:56 CET