<refentry id="glib-Byte-Order-Macros">
<refmeta>
<refentrytitle>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><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>
<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>
</refsect1>

<refsect1>
<title>Details</title>
<refsect2>
<title><anchor id="G-BYTE-ORDER-CAPS"/>G_BYTE_ORDER</title>
<indexterm><primary>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>
<title><anchor id="G-LITTLE-ENDIAN-CAPS"/>G_LITTLE_ENDIAN</title>
<indexterm><primary>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>
<title><anchor id="G-BIG-ENDIAN-CAPS"/>G_BIG_ENDIAN</title>
<indexterm><primary>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>
<title><anchor id="G-PDP-ENDIAN-CAPS"/>G_PDP_ENDIAN</title>
<indexterm><primary>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>
<title><anchor id="g-htonl"/>g_htonl()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a 32-bit integer value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to network byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="g-htons"/>g_htons()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a 16-bit integer value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to network byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="g-ntohl"/>g_ntohl()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a 32-bit integer value in network byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="g-ntohs"/>g_ntohs()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a 16-bit integer value in network byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GINT-FROM-BE-CAPS"/>GINT_FROM_BE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GINT-FROM-LE-CAPS"/>GINT_FROM_LE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GINT-TO-BE-CAPS"/>GINT_TO_BE()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a <link linkend="gint"><type>gint</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to big-endian byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GINT-TO-LE-CAPS"/>GINT_TO_LE()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a <link linkend="gint"><type>gint</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to little-endian byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT-FROM-BE-CAPS"/>GUINT_FROM_BE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT-FROM-LE-CAPS"/>GUINT_FROM_LE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT-TO-BE-CAPS"/>GUINT_TO_BE()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a <link linkend="guint"><type>guint</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to big-endian byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT-TO-LE-CAPS"/>GUINT_TO_LE()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a <link linkend="guint"><type>guint</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to little-endian byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GLONG-FROM-BE-CAPS"/>GLONG_FROM_BE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GLONG-FROM-LE-CAPS"/>GLONG_FROM_LE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GLONG-TO-BE-CAPS"/>GLONG_TO_BE()</title>
<indexterm><primary>GLONG_TO_BE</primary></indexterm><programlisting>#define GLONG_TO_BE(val)	((glong) GINT32_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>&nbsp;:</term>
<listitem><simpara>a <link linkend="glong"><type>glong</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to big-endian byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GLONG-TO-LE-CAPS"/>GLONG_TO_LE()</title>
<indexterm><primary>GLONG_TO_LE</primary></indexterm><programlisting>#define GLONG_TO_LE(val)	((glong) GINT32_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>&nbsp;:</term>
<listitem><simpara>a <link linkend="glong"><type>glong</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to little-endian.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GULONG-FROM-BE-CAPS"/>GULONG_FROM_BE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GULONG-FROM-LE-CAPS"/>GULONG_FROM_LE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GULONG-TO-BE-CAPS"/>GULONG_TO_BE()</title>
<indexterm><primary>GULONG_TO_BE</primary></indexterm><programlisting>#define GULONG_TO_BE(val)	((gulong) GUINT32_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>&nbsp;:</term>
<listitem><simpara>a <link linkend="gulong"><type>gulong</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to big-endian.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GULONG-TO-LE-CAPS"/>GULONG_TO_LE()</title>
<indexterm><primary>GULONG_TO_LE</primary></indexterm><programlisting>#define GULONG_TO_LE(val)	((gulong) GUINT32_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>&nbsp;:</term>
<listitem><simpara>a <link linkend="gulong"><type>gulong</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to little-endian.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GINT16-FROM-BE-CAPS"/>GINT16_FROM_BE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GINT16-FROM-LE-CAPS"/>GINT16_FROM_LE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GINT16-TO-BE-CAPS"/>GINT16_TO_BE()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a <link linkend="gint16"><type>gint16</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to big-endian.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GINT16-TO-LE-CAPS"/>GINT16_TO_LE()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a <link linkend="gint16"><type>gint16</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to little-endian.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT16-FROM-BE-CAPS"/>GUINT16_FROM_BE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT16-FROM-LE-CAPS"/>GUINT16_FROM_LE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT16-TO-BE-CAPS"/>GUINT16_TO_BE()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a <link linkend="guint16"><type>guint16</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to big-endian.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT16-TO-LE-CAPS"/>GUINT16_TO_LE()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a <link linkend="guint16"><type>guint16</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to little-endian.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GINT32-FROM-BE-CAPS"/>GINT32_FROM_BE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GINT32-FROM-LE-CAPS"/>GINT32_FROM_LE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GINT32-TO-BE-CAPS"/>GINT32_TO_BE()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a <link linkend="gint32"><type>gint32</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to big-endian.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GINT32-TO-LE-CAPS"/>GINT32_TO_LE()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a <link linkend="gint32"><type>gint32</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to little-endian.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT32-FROM-BE-CAPS"/>GUINT32_FROM_BE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT32-FROM-LE-CAPS"/>GUINT32_FROM_LE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT32-TO-BE-CAPS"/>GUINT32_TO_BE()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a <link linkend="guint32"><type>guint32</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to big-endian.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT32-TO-LE-CAPS"/>GUINT32_TO_LE()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a <link linkend="guint32"><type>guint32</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to little-endian.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GINT64-FROM-BE-CAPS"/>GINT64_FROM_BE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GINT64-FROM-LE-CAPS"/>GINT64_FROM_LE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GINT64-TO-BE-CAPS"/>GINT64_TO_BE()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a <link linkend="gint64"><type>gint64</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to big-endian.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GINT64-TO-LE-CAPS"/>GINT64_TO_LE()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a <link linkend="gint64"><type>gint64</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to little-endian.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT64-FROM-BE-CAPS"/>GUINT64_FROM_BE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT64-FROM-LE-CAPS"/>GUINT64_FROM_LE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to host byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT64-TO-BE-CAPS"/>GUINT64_TO_BE()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a <link linkend="guint64"><type>guint64</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to big-endian.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT64-TO-LE-CAPS"/>GUINT64_TO_LE()</title>
<indexterm><primary>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>&nbsp;:</term>
<listitem><simpara>a <link linkend="guint64"><type>guint64</type></link> value in host byte order.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara><parameter>val</parameter> converted to little-endian.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT16-SWAP-BE-PDP-CAPS"/>GUINT16_SWAP_BE_PDP()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to the opposite byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT16-SWAP-LE-BE-CAPS"/>GUINT16_SWAP_LE_BE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to the opposite byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT16-SWAP-LE-PDP-CAPS"/>GUINT16_SWAP_LE_PDP()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to the opposite byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT32-SWAP-BE-PDP-CAPS"/>GUINT32_SWAP_BE_PDP()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to the opposite byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT32-SWAP-LE-BE-CAPS"/>GUINT32_SWAP_LE_BE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to the opposite byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT32-SWAP-LE-PDP-CAPS"/>GUINT32_SWAP_LE_PDP()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to the opposite byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="GUINT64-SWAP-LE-BE-CAPS"/>GUINT64_SWAP_LE_BE()</title>
<indexterm><primary>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>&nbsp;:</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> :</term><listitem><simpara><parameter>val</parameter> converted to the opposite byte order.


</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
