<?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="pop_message"> <!-- ID for references -->

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

<refnamediv>
<refname>pop_message</refname> <!-- function name -->
<refpurpose>pop message from the queue</refpurpose> <!-- short function description -->
</refnamediv>

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

<funcprototype> <!-- function prototype -->
  <funcdef>mq_message_t *<function>pop_message</function></funcdef>
  <paramdef>msg_queue_t *<parameter>q</parameter></paramdef>
</funcprototype>

</funcsynopsis></refsynopsisdiv>

<refsect1><title>Description</title>
<para>Removes first message from the queue. If the queue is empty or an error
occured it returns NULL value. Removed messages are NOT automaticaly freed -
caller must use <function>free_message</function> or free it itself (see <xref
linkend="free_message"/>)!
</para>

</refsect1>

<refsect1><title>Return value</title>
<para>Returns pointer to message removed from the queue. If the queue is empty
or an error occured the return value is NULL.
<!-- return value description -->
</para>
</refsect1>

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

</refentry>