<refentry id="glib-Byte-Order-Macros">
<refmeta>
<refentrytitle role="top_of_page" id="glib-Byte-Order-Macros.top_of_page">Byte Order Macros</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GLIB Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Byte Order Macros</refname>
<refpurpose>a portable way to convert between different byte orders</refpurpose>
</refnamediv>

<refsynopsisdiv id="glib-Byte-Order-Macros.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>

#include &lt;glib.h&gt;

#define             <link linkend="G-BYTE-ORDER--CAPS">G_BYTE_ORDER</link>
#define             <link linkend="G-LITTLE-ENDIAN--CAPS">G_LITTLE_ENDIAN</link>
#define             <link linkend="G-BIG-ENDIAN--CAPS">G_BIG_ENDIAN</link>
#define             <link linkend="G-PDP-ENDIAN--CAPS">G_PDP_ENDIAN</link>

#define             <link linkend="g-htonl">g_htonl</link>                             (val)
#define             <link linkend="g-htons">g_htons</link>                             (val)
#define             <link linkend="g-ntohl">g_ntohl</link>                             (val)
#define             <link linkend="g-ntohs">g_ntohs</link>                             (val)

#define             <link linkend="GINT-FROM-BE--CAPS">GINT_FROM_BE</link>                        (val)
#define             <link linkend="GINT-FROM-LE--CAPS">GINT_FROM_LE</link>                        (val)
#define             <link linkend="GINT-TO-BE--CAPS">GINT_TO_BE</link>                          (val)
#define             <link linkend="GINT-TO-LE--CAPS">GINT_TO_LE</link>                          (val)

#define             <link linkend="GUINT-FROM-BE--CAPS">GUINT_FROM_BE</link>                       (val)
#define             <link linkend="GUINT-FROM-LE--CAPS">GUINT_FROM_LE</link>                       (val)
#define             <link linkend="GUINT-TO-BE--CAPS">GUINT_TO_BE</link>                         (val)
#define             <link linkend="GUINT-TO-LE--CAPS">GUINT_TO_LE</link>                         (val)

#define             <link linkend="GLONG-FROM-BE--CAPS">GLONG_FROM_BE</link>                       (val)
#define             <link linkend="GLONG-FROM-LE--CAPS">GLONG_FROM_LE</link>                       (val)
#define             <link linkend="GLONG-TO-BE--CAPS">GLONG_TO_BE</link>                         (val)
#define             <link linkend="GLONG-TO-LE--CAPS">GLONG_TO_LE</link>                         (val)

#define             <link linkend="GULONG-FROM-BE--CAPS">GULONG_FROM_BE</link>                      (val)
#define             <link linkend="GULONG-FROM-LE--CAPS">GULONG_FROM_LE</link>                      (val)
#define             <link linkend="GULONG-TO-BE--CAPS">GULONG_TO_BE</link>                        (val)
#define             <link linkend="GULONG-TO-LE--CAPS">GULONG_TO_LE</link>                        (val)

#define             <link linkend="GINT16-FROM-BE--CAPS">GINT16_FROM_BE</link>                      (val)
#define             <link linkend="GINT16-FROM-LE--CAPS">GINT16_FROM_LE</link>                      (val)
#define             <link linkend="GINT16-TO-BE--CAPS">GINT16_TO_BE</link>                        (val)
#define             <link linkend="GINT16-TO-LE--CAPS">GINT16_TO_LE</link>                        (val)

#define             <link linkend="GUINT16-FROM-BE--CAPS">GUINT16_FROM_BE</link>                     (val)
#define             <link linkend="GUINT16-FROM-LE--CAPS">GUINT16_FROM_LE</link>                     (val)
#define             <link linkend="GUINT16-TO-BE--CAPS">GUINT16_TO_BE</link>                       (val)
#define             <link linkend="GUINT16-TO-LE--CAPS">GUINT16_TO_LE</link>                       (val)

#define             <link linkend="GINT32-FROM-BE--CAPS">GINT32_FROM_BE</link>                      (val)
#define             <link linkend="GINT32-FROM-LE--CAPS">GINT32_FROM_LE</link>                      (val)
#define             <link linkend="GINT32-TO-BE--CAPS">GINT32_TO_BE</link>                        (val)
#define             <link linkend="GINT32-TO-LE--CAPS">GINT32_TO_LE</link>                        (val)

#define             <link linkend="GUINT32-FROM-BE--CAPS">GUINT32_FROM_BE</link>                     (val)
#define             <link linkend="GUINT32-FROM-LE--CAPS">GUINT32_FROM_LE</link>                     (val)
#define             <link linkend="GUINT32-TO-BE--CAPS">GUINT32_TO_BE</link>                       (val)
#define             <link linkend="GUINT32-TO-LE--CAPS">GUINT32_TO_LE</link>                       (val)

#define             <link linkend="GINT64-FROM-BE--CAPS">GINT64_FROM_BE</link>                      (val)
#define             <link linkend="GINT64-FROM-LE--CAPS">GINT64_FROM_LE</link>                      (val)
#define             <link linkend="GINT64-TO-BE--CAPS">GINT64_TO_BE</link>                        (val)
#define             <link linkend="GINT64-TO-LE--CAPS">GINT64_TO_LE</link>                        (val)

#define             <link linkend="GUINT64-FROM-BE--CAPS">GUINT64_FROM_BE</link>                     (val)
#define             <link linkend="GUINT64-FROM-LE--CAPS">GUINT64_FROM_LE</link>                     (val)
#define             <link linkend="GUINT64-TO-BE--CAPS">GUINT64_TO_BE</link>                       (val)
#define             <link linkend="GUINT64-TO-LE--CAPS">GUINT64_TO_LE</link>                       (val)

#define             <link linkend="GUINT16-SWAP-BE-PDP--CAPS">GUINT16_SWAP_BE_PDP</link>                 (val)
#define             <link linkend="GUINT16-SWAP-LE-BE--CAPS">GUINT16_SWAP_LE_BE</link>                  (val)
#define             <link linkend="GUINT16-SWAP-LE-PDP--CAPS">GUINT16_SWAP_LE_PDP</link>                 (val)

#define             <link linkend="GUINT32-SWAP-BE-PDP--CAPS">GUINT32_SWAP_BE_PDP</link>                 (val)
#define             <link linkend="GUINT32-SWAP-LE-BE--CAPS">GUINT32_SWAP_LE_BE</link>                  (val)
#define             <link linkend="GUINT32-SWAP-LE-PDP--CAPS">GUINT32_SWAP_LE_PDP</link>                 (val)

#define             <link linkend="GUINT64-SWAP-LE-BE--CAPS">GUINT64_SWAP_LE_BE</link>                  (val)
</synopsis>
</refsynopsisdiv>









<refsect1 id="glib-Byte-Order-Macros.description" role="desc">
<title role="desc.title">Description</title>
<para>
These macros provide a portable way to determine the host byte order
and to convert values between different byte orders.
</para>
<para>
The byte order is the order in which bytes are stored to create larger
data types such as the <link linkend="gint"><type>gint</type></link> and <link linkend="glong"><type>glong</type></link> values.
The host byte order is the byte order used on the current machine.
</para>
<para>
Some processors store the most significant bytes (i.e. the bytes that
hold the largest part of the value) first. These are known as big-endian
processors.
</para>
<para>
Other processors (notably the x86 family) store the most significant byte
last. These are known as little-endian processors.
</para>
<para>
Finally, to complicate matters, some other processors store the bytes in
a rather curious order known as PDP-endian. For a 4-byte word, the 3rd
most significant byte is stored first, then the 4th, then the 1st and finally
the 2nd.
</para>
<para>
Obviously there is a problem when these different processors communicate
with each other, for example over networks or by using binary file formats.
This is where these macros come in.
They are typically used to convert values into a byte order
which has been agreed on for use when communicating between different
processors. The Internet uses what is known as 'network byte order'
as the standard byte order (which is in fact the big-endian byte order).
</para>
<para>
Note that the byte order conversion macros may evaluate their arguments
multiple times, thus you should not use them with arguments which have
side-effects.
</para>
</refsect1>

<refsect1 id="glib-Byte-Order-Macros.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="G-BYTE-ORDER--CAPS" role="macro">
<title>G_BYTE_ORDER</title>
<indexterm zone="G-BYTE-ORDER--CAPS"><primary sortas="BYTE_ORDER">G_BYTE_ORDER</primary></indexterm><programlisting>#define G_BYTE_ORDER G_LITTLE_ENDIAN
</programlisting>
<para>
The host byte order.
This can be either <link linkend="G-LITTLE-ENDIAN--CAPS"><type>G_LITTLE_ENDIAN</type></link> or <link linkend="G-BIG-ENDIAN--CAPS"><type>G_BIG_ENDIAN</type></link> (support for
<link linkend="G-PDP-ENDIAN--CAPS"><type>G_PDP_ENDIAN</type></link> may be added in future.)
</para></refsect2>
<refsect2 id="G-LITTLE-ENDIAN--CAPS" role="macro">
<title>G_LITTLE_ENDIAN</title>
<indexterm zone="G-LITTLE-ENDIAN--CAPS"><primary sortas="LITTLE_ENDIAN">G_LITTLE_ENDIAN</primary></indexterm><programlisting>#define G_LITTLE_ENDIAN 1234
</programlisting>
<para>
Specifies one of the possible types of byte order.
See <link linkend="G-BYTE-ORDER--CAPS"><type>G_BYTE_ORDER</type></link>.
</para></refsect2>
<refsect2 id="G-BIG-ENDIAN--CAPS" role="macro">
<title>G_BIG_ENDIAN</title>
<indexterm zone="G-BIG-ENDIAN--CAPS"><primary sortas="BIG_ENDIAN">G_BIG_ENDIAN</primary></indexterm><programlisting>#define G_BIG_ENDIAN    4321
</programlisting>
<para>
Specifies one of the possible types of byte order.
See <link linkend="G-BYTE-ORDER--CAPS"><type>G_BYTE_ORDER</type></link>.
</para></refsect2>
<refsect2 id="G-PDP-ENDIAN--CAPS" role="macro">
<title>G_PDP_ENDIAN</title>
<indexterm zone="G-PDP-ENDIAN--CAPS"><primary sortas="PDP_ENDIAN">G_PDP_ENDIAN</primary></indexterm><programlisting>#define G_PDP_ENDIAN    3412		/* unused, need specific PDP check */	
</programlisting>
<para>
Specifies one of the possible types of byte order (currently unused).
See <link linkend="G-BYTE-ORDER--CAPS"><type>G_BYTE_ORDER</type></link>.
</para></refsect2>
<refsect2 id="g-htonl" role="macro">
<title>g_htonl()</title>
<indexterm zone="g-htonl"><primary sortas="htonl">g_htonl</primary></indexterm><programlisting>#define             g_htonl(val)</programlisting>
<para>
Converts a 32-bit integer value from host to network byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a 32-bit integer value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to network byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-htons" role="macro">
<title>g_htons()</title>
<indexterm zone="g-htons"><primary sortas="htons">g_htons</primary></indexterm><programlisting>#define             g_htons(val)</programlisting>
<para>
Converts a 16-bit integer value from host to network byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a 16-bit integer value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to network byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-ntohl" role="macro">
<title>g_ntohl()</title>
<indexterm zone="g-ntohl"><primary sortas="ntohl">g_ntohl</primary></indexterm><programlisting>#define             g_ntohl(val)</programlisting>
<para>
Converts a 32-bit integer value from network to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a 32-bit integer value in network byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="g-ntohs" role="macro">
<title>g_ntohs()</title>
<indexterm zone="g-ntohs"><primary sortas="ntohs">g_ntohs</primary></indexterm><programlisting>#define             g_ntohs(val)</programlisting>
<para>
Converts a 16-bit integer value from network to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a 16-bit integer value in network byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GINT-FROM-BE--CAPS" role="macro">
<title>GINT_FROM_BE()</title>
<indexterm zone="GINT-FROM-BE--CAPS"><primary sortas="INT_FROM_BE">GINT_FROM_BE</primary></indexterm><programlisting>#define GINT_FROM_BE(val)	(GINT_TO_BE (val))
</programlisting>
<para>
Converts a <link linkend="gint"><type>gint</type></link> value from big-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gint"><type>gint</type></link> value in big-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GINT-FROM-LE--CAPS" role="macro">
<title>GINT_FROM_LE()</title>
<indexterm zone="GINT-FROM-LE--CAPS"><primary sortas="INT_FROM_LE">GINT_FROM_LE</primary></indexterm><programlisting>#define GINT_FROM_LE(val)	(GINT_TO_LE (val))
</programlisting>
<para>
Converts a <link linkend="gint"><type>gint</type></link> value from little-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gint"><type>gint</type></link> value in little-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GINT-TO-BE--CAPS" role="macro">
<title>GINT_TO_BE()</title>
<indexterm zone="GINT-TO-BE--CAPS"><primary sortas="INT_TO_BE">GINT_TO_BE</primary></indexterm><programlisting>#define GINT_TO_BE(val)		((gint) GINT32_TO_BE (val))
</programlisting>
<para>
Converts a <link linkend="gint"><type>gint</type></link> value from host byte order to big-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gint"><type>gint</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to big-endian byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GINT-TO-LE--CAPS" role="macro">
<title>GINT_TO_LE()</title>
<indexterm zone="GINT-TO-LE--CAPS"><primary sortas="INT_TO_LE">GINT_TO_LE</primary></indexterm><programlisting>#define GINT_TO_LE(val)		((gint) GINT32_TO_LE (val))
</programlisting>
<para>
Converts a <link linkend="gint"><type>gint</type></link> value from host byte order to little-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gint"><type>gint</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to little-endian byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT-FROM-BE--CAPS" role="macro">
<title>GUINT_FROM_BE()</title>
<indexterm zone="GUINT-FROM-BE--CAPS"><primary sortas="UINT_FROM_BE">GUINT_FROM_BE</primary></indexterm><programlisting>#define GUINT_FROM_BE(val)	(GUINT_TO_BE (val))
</programlisting>
<para>
Converts a <link linkend="guint"><type>guint</type></link> value from big-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint"><type>guint</type></link> value in big-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT-FROM-LE--CAPS" role="macro">
<title>GUINT_FROM_LE()</title>
<indexterm zone="GUINT-FROM-LE--CAPS"><primary sortas="UINT_FROM_LE">GUINT_FROM_LE</primary></indexterm><programlisting>#define GUINT_FROM_LE(val)	(GUINT_TO_LE (val))
</programlisting>
<para>
Converts a <link linkend="guint"><type>guint</type></link> value from little-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint"><type>guint</type></link> value in little-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT-TO-BE--CAPS" role="macro">
<title>GUINT_TO_BE()</title>
<indexterm zone="GUINT-TO-BE--CAPS"><primary sortas="UINT_TO_BE">GUINT_TO_BE</primary></indexterm><programlisting>#define GUINT_TO_BE(val)	((guint) GUINT32_TO_BE (val))
</programlisting>
<para>
Converts a <link linkend="guint"><type>guint</type></link> value from host byte order to big-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint"><type>guint</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to big-endian byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT-TO-LE--CAPS" role="macro">
<title>GUINT_TO_LE()</title>
<indexterm zone="GUINT-TO-LE--CAPS"><primary sortas="UINT_TO_LE">GUINT_TO_LE</primary></indexterm><programlisting>#define GUINT_TO_LE(val)	((guint) GUINT32_TO_LE (val))
</programlisting>
<para>
Converts a <link linkend="guint"><type>guint</type></link> value from host byte order to little-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint"><type>guint</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to little-endian byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GLONG-FROM-BE--CAPS" role="macro">
<title>GLONG_FROM_BE()</title>
<indexterm zone="GLONG-FROM-BE--CAPS"><primary sortas="LONG_FROM_BE">GLONG_FROM_BE</primary></indexterm><programlisting>#define GLONG_FROM_BE(val)	(GLONG_TO_BE (val))
</programlisting>
<para>
Converts a <link linkend="glong"><type>glong</type></link> value from big-endian to the host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="glong"><type>glong</type></link> value in big-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GLONG-FROM-LE--CAPS" role="macro">
<title>GLONG_FROM_LE()</title>
<indexterm zone="GLONG-FROM-LE--CAPS"><primary sortas="LONG_FROM_LE">GLONG_FROM_LE</primary></indexterm><programlisting>#define GLONG_FROM_LE(val)	(GLONG_TO_LE (val))
</programlisting>
<para>
Converts a <link linkend="glong"><type>glong</type></link> value from little-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="glong"><type>glong</type></link> value in little-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GLONG-TO-BE--CAPS" role="macro">
<title>GLONG_TO_BE()</title>
<indexterm zone="GLONG-TO-BE--CAPS"><primary sortas="LONG_TO_BE">GLONG_TO_BE</primary></indexterm><programlisting>#define GLONG_TO_BE(val)	((glong) GINT64_TO_BE (val))
</programlisting>
<para>
Converts a <link linkend="glong"><type>glong</type></link> value from host byte order to big-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="glong"><type>glong</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to big-endian byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GLONG-TO-LE--CAPS" role="macro">
<title>GLONG_TO_LE()</title>
<indexterm zone="GLONG-TO-LE--CAPS"><primary sortas="LONG_TO_LE">GLONG_TO_LE</primary></indexterm><programlisting>#define GLONG_TO_LE(val)	((glong) GINT64_TO_LE (val))
</programlisting>
<para>
Converts a <link linkend="glong"><type>glong</type></link> value from host byte order to little-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="glong"><type>glong</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to little-endian.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GULONG-FROM-BE--CAPS" role="macro">
<title>GULONG_FROM_BE()</title>
<indexterm zone="GULONG-FROM-BE--CAPS"><primary sortas="ULONG_FROM_BE">GULONG_FROM_BE</primary></indexterm><programlisting>#define GULONG_FROM_BE(val)	(GULONG_TO_BE (val))
</programlisting>
<para>
Converts a <link linkend="gulong"><type>gulong</type></link> value from big-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gulong"><type>gulong</type></link> value in big-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GULONG-FROM-LE--CAPS" role="macro">
<title>GULONG_FROM_LE()</title>
<indexterm zone="GULONG-FROM-LE--CAPS"><primary sortas="ULONG_FROM_LE">GULONG_FROM_LE</primary></indexterm><programlisting>#define GULONG_FROM_LE(val)	(GULONG_TO_LE (val))
</programlisting>
<para>
Converts a <link linkend="gulong"><type>gulong</type></link> value from little-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gulong"><type>gulong</type></link> value in little-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GULONG-TO-BE--CAPS" role="macro">
<title>GULONG_TO_BE()</title>
<indexterm zone="GULONG-TO-BE--CAPS"><primary sortas="ULONG_TO_BE">GULONG_TO_BE</primary></indexterm><programlisting>#define GULONG_TO_BE(val)	((gulong) GUINT64_TO_BE (val))
</programlisting>
<para>
Converts a <link linkend="gulong"><type>gulong</type></link> value from host byte order to big-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gulong"><type>gulong</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to big-endian.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GULONG-TO-LE--CAPS" role="macro">
<title>GULONG_TO_LE()</title>
<indexterm zone="GULONG-TO-LE--CAPS"><primary sortas="ULONG_TO_LE">GULONG_TO_LE</primary></indexterm><programlisting>#define GULONG_TO_LE(val)	((gulong) GUINT64_TO_LE (val))
</programlisting>
<para>
Converts a <link linkend="gulong"><type>gulong</type></link> value from host byte order to little-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gulong"><type>gulong</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to little-endian.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GINT16-FROM-BE--CAPS" role="macro">
<title>GINT16_FROM_BE()</title>
<indexterm zone="GINT16-FROM-BE--CAPS"><primary sortas="INT16_FROM_BE">GINT16_FROM_BE</primary></indexterm><programlisting>#define GINT16_FROM_BE(val)	(GINT16_TO_BE (val))
</programlisting>
<para>
Converts a <link linkend="gint16"><type>gint16</type></link> value from big-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gint16"><type>gint16</type></link> value in big-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GINT16-FROM-LE--CAPS" role="macro">
<title>GINT16_FROM_LE()</title>
<indexterm zone="GINT16-FROM-LE--CAPS"><primary sortas="INT16_FROM_LE">GINT16_FROM_LE</primary></indexterm><programlisting>#define GINT16_FROM_LE(val)	(GINT16_TO_LE (val))
</programlisting>
<para>
Converts a <link linkend="gint16"><type>gint16</type></link> value from little-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gint16"><type>gint16</type></link> value in little-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GINT16-TO-BE--CAPS" role="macro">
<title>GINT16_TO_BE()</title>
<indexterm zone="GINT16-TO-BE--CAPS"><primary sortas="INT16_TO_BE">GINT16_TO_BE</primary></indexterm><programlisting>#define GINT16_TO_BE(val)	((gint16) GUINT16_SWAP_LE_BE (val))
</programlisting>
<para>
Converts a <link linkend="gint16"><type>gint16</type></link> value from host byte order to big-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gint16"><type>gint16</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to big-endian.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GINT16-TO-LE--CAPS" role="macro">
<title>GINT16_TO_LE()</title>
<indexterm zone="GINT16-TO-LE--CAPS"><primary sortas="INT16_TO_LE">GINT16_TO_LE</primary></indexterm><programlisting>#define GINT16_TO_LE(val)	((gint16) (val))
</programlisting>
<para>
Converts a <link linkend="gint16"><type>gint16</type></link> value from host byte order to little-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gint16"><type>gint16</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to little-endian.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT16-FROM-BE--CAPS" role="macro">
<title>GUINT16_FROM_BE()</title>
<indexterm zone="GUINT16-FROM-BE--CAPS"><primary sortas="UINT16_FROM_BE">GUINT16_FROM_BE</primary></indexterm><programlisting>#define GUINT16_FROM_BE(val)	(GUINT16_TO_BE (val))
</programlisting>
<para>
Converts a <link linkend="guint16"><type>guint16</type></link> value from big-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint16"><type>guint16</type></link> value in big-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT16-FROM-LE--CAPS" role="macro">
<title>GUINT16_FROM_LE()</title>
<indexterm zone="GUINT16-FROM-LE--CAPS"><primary sortas="UINT16_FROM_LE">GUINT16_FROM_LE</primary></indexterm><programlisting>#define GUINT16_FROM_LE(val)	(GUINT16_TO_LE (val))
</programlisting>
<para>
Converts a <link linkend="guint16"><type>guint16</type></link> value from little-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint16"><type>guint16</type></link> value in little-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT16-TO-BE--CAPS" role="macro">
<title>GUINT16_TO_BE()</title>
<indexterm zone="GUINT16-TO-BE--CAPS"><primary sortas="UINT16_TO_BE">GUINT16_TO_BE</primary></indexterm><programlisting>#define GUINT16_TO_BE(val)	(GUINT16_SWAP_LE_BE (val))
</programlisting>
<para>
Converts a <link linkend="guint16"><type>guint16</type></link> value from host byte order to big-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint16"><type>guint16</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to big-endian.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT16-TO-LE--CAPS" role="macro">
<title>GUINT16_TO_LE()</title>
<indexterm zone="GUINT16-TO-LE--CAPS"><primary sortas="UINT16_TO_LE">GUINT16_TO_LE</primary></indexterm><programlisting>#define GUINT16_TO_LE(val)	((guint16) (val))
</programlisting>
<para>
Converts a <link linkend="guint16"><type>guint16</type></link> value from host byte order to little-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint16"><type>guint16</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to little-endian.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GINT32-FROM-BE--CAPS" role="macro">
<title>GINT32_FROM_BE()</title>
<indexterm zone="GINT32-FROM-BE--CAPS"><primary sortas="INT32_FROM_BE">GINT32_FROM_BE</primary></indexterm><programlisting>#define GINT32_FROM_BE(val)	(GINT32_TO_BE (val))
</programlisting>
<para>
Converts a <link linkend="gint32"><type>gint32</type></link> value from big-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gint32"><type>gint32</type></link> value in big-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GINT32-FROM-LE--CAPS" role="macro">
<title>GINT32_FROM_LE()</title>
<indexterm zone="GINT32-FROM-LE--CAPS"><primary sortas="INT32_FROM_LE">GINT32_FROM_LE</primary></indexterm><programlisting>#define GINT32_FROM_LE(val)	(GINT32_TO_LE (val))
</programlisting>
<para>
Converts a <link linkend="gint32"><type>gint32</type></link> value from little-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gint32"><type>gint32</type></link> value in little-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GINT32-TO-BE--CAPS" role="macro">
<title>GINT32_TO_BE()</title>
<indexterm zone="GINT32-TO-BE--CAPS"><primary sortas="INT32_TO_BE">GINT32_TO_BE</primary></indexterm><programlisting>#define GINT32_TO_BE(val)	((gint32) GUINT32_SWAP_LE_BE (val))
</programlisting>
<para>
Converts a <link linkend="gint32"><type>gint32</type></link> value from host byte order to big-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gint32"><type>gint32</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to big-endian.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GINT32-TO-LE--CAPS" role="macro">
<title>GINT32_TO_LE()</title>
<indexterm zone="GINT32-TO-LE--CAPS"><primary sortas="INT32_TO_LE">GINT32_TO_LE</primary></indexterm><programlisting>#define GINT32_TO_LE(val)	((gint32) (val))
</programlisting>
<para>
Converts a <link linkend="gint32"><type>gint32</type></link> value from host byte order to little-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gint32"><type>gint32</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to little-endian.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT32-FROM-BE--CAPS" role="macro">
<title>GUINT32_FROM_BE()</title>
<indexterm zone="GUINT32-FROM-BE--CAPS"><primary sortas="UINT32_FROM_BE">GUINT32_FROM_BE</primary></indexterm><programlisting>#define GUINT32_FROM_BE(val)	(GUINT32_TO_BE (val))
</programlisting>
<para>
Converts a <link linkend="guint32"><type>guint32</type></link> value from big-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint32"><type>guint32</type></link> value in big-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT32-FROM-LE--CAPS" role="macro">
<title>GUINT32_FROM_LE()</title>
<indexterm zone="GUINT32-FROM-LE--CAPS"><primary sortas="UINT32_FROM_LE">GUINT32_FROM_LE</primary></indexterm><programlisting>#define GUINT32_FROM_LE(val)	(GUINT32_TO_LE (val))
</programlisting>
<para>
Converts a <link linkend="guint32"><type>guint32</type></link> value from little-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint32"><type>guint32</type></link> value in little-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT32-TO-BE--CAPS" role="macro">
<title>GUINT32_TO_BE()</title>
<indexterm zone="GUINT32-TO-BE--CAPS"><primary sortas="UINT32_TO_BE">GUINT32_TO_BE</primary></indexterm><programlisting>#define GUINT32_TO_BE(val)	(GUINT32_SWAP_LE_BE (val))
</programlisting>
<para>
Converts a <link linkend="guint32"><type>guint32</type></link> value from host byte order to big-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint32"><type>guint32</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to big-endian.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT32-TO-LE--CAPS" role="macro">
<title>GUINT32_TO_LE()</title>
<indexterm zone="GUINT32-TO-LE--CAPS"><primary sortas="UINT32_TO_LE">GUINT32_TO_LE</primary></indexterm><programlisting>#define GUINT32_TO_LE(val)	((guint32) (val))
</programlisting>
<para>
Converts a <link linkend="guint32"><type>guint32</type></link> value from host byte order to little-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint32"><type>guint32</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to little-endian.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GINT64-FROM-BE--CAPS" role="macro">
<title>GINT64_FROM_BE()</title>
<indexterm zone="GINT64-FROM-BE--CAPS"><primary sortas="INT64_FROM_BE">GINT64_FROM_BE</primary></indexterm><programlisting>#define GINT64_FROM_BE(val)	(GINT64_TO_BE (val))
</programlisting>
<para>
Converts a <link linkend="gint64"><type>gint64</type></link> value from big-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gint64"><type>gint64</type></link> value in big-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GINT64-FROM-LE--CAPS" role="macro">
<title>GINT64_FROM_LE()</title>
<indexterm zone="GINT64-FROM-LE--CAPS"><primary sortas="INT64_FROM_LE">GINT64_FROM_LE</primary></indexterm><programlisting>#define GINT64_FROM_LE(val)	(GINT64_TO_LE (val))
</programlisting>
<para>
Converts a <link linkend="gint64"><type>gint64</type></link> value from little-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gint64"><type>gint64</type></link> value in little-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GINT64-TO-BE--CAPS" role="macro">
<title>GINT64_TO_BE()</title>
<indexterm zone="GINT64-TO-BE--CAPS"><primary sortas="INT64_TO_BE">GINT64_TO_BE</primary></indexterm><programlisting>#define GINT64_TO_BE(val)	((gint64) GUINT64_SWAP_LE_BE (val))
</programlisting>
<para>
Converts a <link linkend="gint64"><type>gint64</type></link> value from host byte order to big-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gint64"><type>gint64</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to big-endian.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GINT64-TO-LE--CAPS" role="macro">
<title>GINT64_TO_LE()</title>
<indexterm zone="GINT64-TO-LE--CAPS"><primary sortas="INT64_TO_LE">GINT64_TO_LE</primary></indexterm><programlisting>#define GINT64_TO_LE(val)	((gint64) (val))
</programlisting>
<para>
Converts a <link linkend="gint64"><type>gint64</type></link> value from host byte order to little-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="gint64"><type>gint64</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to little-endian.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT64-FROM-BE--CAPS" role="macro">
<title>GUINT64_FROM_BE()</title>
<indexterm zone="GUINT64-FROM-BE--CAPS"><primary sortas="UINT64_FROM_BE">GUINT64_FROM_BE</primary></indexterm><programlisting>#define GUINT64_FROM_BE(val)	(GUINT64_TO_BE (val))
</programlisting>
<para>
Converts a <link linkend="guint64"><type>guint64</type></link> value from big-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint64"><type>guint64</type></link> value in big-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT64-FROM-LE--CAPS" role="macro">
<title>GUINT64_FROM_LE()</title>
<indexterm zone="GUINT64-FROM-LE--CAPS"><primary sortas="UINT64_FROM_LE">GUINT64_FROM_LE</primary></indexterm><programlisting>#define GUINT64_FROM_LE(val)	(GUINT64_TO_LE (val))
</programlisting>
<para>
Converts a <link linkend="guint64"><type>guint64</type></link> value from little-endian to host byte order.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint64"><type>guint64</type></link> value in little-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to host byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT64-TO-BE--CAPS" role="macro">
<title>GUINT64_TO_BE()</title>
<indexterm zone="GUINT64-TO-BE--CAPS"><primary sortas="UINT64_TO_BE">GUINT64_TO_BE</primary></indexterm><programlisting>#define GUINT64_TO_BE(val)	(GUINT64_SWAP_LE_BE (val))
</programlisting>
<para>
Converts a <link linkend="guint64"><type>guint64</type></link> value from host byte order to big-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint64"><type>guint64</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to big-endian.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT64-TO-LE--CAPS" role="macro">
<title>GUINT64_TO_LE()</title>
<indexterm zone="GUINT64-TO-LE--CAPS"><primary sortas="UINT64_TO_LE">GUINT64_TO_LE</primary></indexterm><programlisting>#define GUINT64_TO_LE(val)	((guint64) (val))
</programlisting>
<para>
Converts a <link linkend="guint64"><type>guint64</type></link> value from host byte order to little-endian.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint64"><type>guint64</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to little-endian.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT16-SWAP-BE-PDP--CAPS" role="macro">
<title>GUINT16_SWAP_BE_PDP()</title>
<indexterm zone="GUINT16-SWAP-BE-PDP--CAPS"><primary sortas="UINT16_SWAP_BE_PDP">GUINT16_SWAP_BE_PDP</primary></indexterm><programlisting>#define GUINT16_SWAP_BE_PDP(val)	(GUINT16_SWAP_LE_BE (val))
</programlisting>
<para>
Converts a <link linkend="guint16"><type>guint16</type></link> value between big-endian and pdp-endian byte order.
The conversion is symmetric so it can be used both ways.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint16"><type>guint16</type></link> value in big-endian or pdp-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to the opposite byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT16-SWAP-LE-BE--CAPS" role="macro">
<title>GUINT16_SWAP_LE_BE()</title>
<indexterm zone="GUINT16-SWAP-LE-BE--CAPS"><primary sortas="UINT16_SWAP_LE_BE">GUINT16_SWAP_LE_BE</primary></indexterm><programlisting>#define             GUINT16_SWAP_LE_BE(val)</programlisting>
<para>
Converts a <link linkend="guint16"><type>guint16</type></link> value between little-endian and big-endian byte order.
The conversion is symmetric so it can be used both ways.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint16"><type>guint16</type></link> value in little-endian or big-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to the opposite byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT16-SWAP-LE-PDP--CAPS" role="macro">
<title>GUINT16_SWAP_LE_PDP()</title>
<indexterm zone="GUINT16-SWAP-LE-PDP--CAPS"><primary sortas="UINT16_SWAP_LE_PDP">GUINT16_SWAP_LE_PDP</primary></indexterm><programlisting>#define GUINT16_SWAP_LE_PDP(val)	((guint16) (val))
</programlisting>
<para>
Converts a <link linkend="guint16"><type>guint16</type></link> value between little-endian and pdp-endian byte order.
The conversion is symmetric so it can be used both ways.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint16"><type>guint16</type></link> value in little-endian or pdp-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to the opposite byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT32-SWAP-BE-PDP--CAPS" role="macro">
<title>GUINT32_SWAP_BE_PDP()</title>
<indexterm zone="GUINT32-SWAP-BE-PDP--CAPS"><primary sortas="UINT32_SWAP_BE_PDP">GUINT32_SWAP_BE_PDP</primary></indexterm><programlisting>#define             GUINT32_SWAP_BE_PDP(val)</programlisting>
<para>
Converts a <link linkend="guint32"><type>guint32</type></link> value between big-endian and pdp-endian byte order.
The conversion is symmetric so it can be used both ways.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint32"><type>guint32</type></link> value in big-endian or pdp-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to the opposite byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT32-SWAP-LE-BE--CAPS" role="macro">
<title>GUINT32_SWAP_LE_BE()</title>
<indexterm zone="GUINT32-SWAP-LE-BE--CAPS"><primary sortas="UINT32_SWAP_LE_BE">GUINT32_SWAP_LE_BE</primary></indexterm><programlisting>#define             GUINT32_SWAP_LE_BE(val)</programlisting>
<para>
Converts a <link linkend="guint32"><type>guint32</type></link> value between little-endian and big-endian byte order.
The conversion is symmetric so it can be used both ways.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint32"><type>guint32</type></link> value in little-endian or big-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to the opposite byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT32-SWAP-LE-PDP--CAPS" role="macro">
<title>GUINT32_SWAP_LE_PDP()</title>
<indexterm zone="GUINT32-SWAP-LE-PDP--CAPS"><primary sortas="UINT32_SWAP_LE_PDP">GUINT32_SWAP_LE_PDP</primary></indexterm><programlisting>#define             GUINT32_SWAP_LE_PDP(val)</programlisting>
<para>
Converts a <link linkend="guint32"><type>guint32</type></link> value between little-endian and pdp-endian byte order.
The conversion is symmetric so it can be used both ways.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint32"><type>guint32</type></link> value in little-endian or pdp-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to the opposite byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="GUINT64-SWAP-LE-BE--CAPS" role="macro">
<title>GUINT64_SWAP_LE_BE()</title>
<indexterm zone="GUINT64-SWAP-LE-BE--CAPS"><primary sortas="UINT64_SWAP_LE_BE">GUINT64_SWAP_LE_BE</primary></indexterm><programlisting>#define             GUINT64_SWAP_LE_BE(val)</programlisting>
<para>
Converts a <link linkend="guint64"><type>guint64</type></link> value between little-endian and big-endian byte order.
The conversion is symmetric so it can be used both ways.
</para><variablelist role="params">
<varlistentry><term><parameter>val</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="guint64"><type>guint64</type></link> value in little-endian or big-endian byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>@val converted to the opposite byte order.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
