<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" 
   "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">

<refentry id="init_message_ex"> <!-- ID for references -->

<refmeta>
<refentrytitle>init_message_ex</refentrytitle> <!-- title shown in references -->
<manvolnum>3</manvolnum></refmeta> <!-- man volume id (3 for libraries) -->

<refnamediv>
<refname>init_message_ex</refname> <!-- function name -->
<refpurpose>initialize message</refpurpose> <!-- short function description -->
</refnamediv>

<refsynopsisdiv><funcsynopsis>
<funcsynopsisinfo>
#include &lt;cds/msg_queue.h&gt; <!-- included headers -->
</funcsynopsisinfo>

<funcprototype> <!-- function prototype -->
  <funcdef>void <function>init_message_ex</function></funcdef>
  <paramdef>mq_message_t *<parameter>m</parameter></paramdef>
  <paramdef>void *<parameter>data</parameter></paramdef>
  <paramdef>int <parameter>data_len</parameter></paramdef>
  <paramdef>destroy_function_f <parameter>func</parameter></paramdef>
</funcprototype>

</funcsynopsis></refsynopsisdiv>

<refsect1><title>Description</title>
<para>Initializes message structure with given data and given data length like
<function>create_message</function> but without its allocation. </para>
<para>
Parameter <parameter>func</parameter> specifies function called on data pointer
before freeing the message in <function>free_message</function>. It can be NULL.
This function may be used for example for memory deallocation (for example may
have value of <function>cds_free_ptr</function>) or some more complicated
function for freeing complex data structure with pointers inside or so.
<!-- detailed description -->
</para>

</refsect1>

<refsect1><title>See Also</title>
<para>
<!-- references to other pages -->
<xref linkend="create_message"/>, <xref linkend="create_message_ex"/>, <xref
linkend="free_message"/>
</para>
</refsect1>

</refentry> 

