<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN'
                      'http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd' [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<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>

<refsect1 id="glib-Byte-Order-Macros.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="g-htonl">g_htonl</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="g-htons">g_htons</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="g-ntohl">g_ntohl</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="g-ntohs">g_ntohs</link><phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GINT-FROM-BE:CAPS">GINT_FROM_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GINT-FROM-LE:CAPS">GINT_FROM_LE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GINT-TO-BE:CAPS">GINT_TO_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GINT-TO-LE:CAPS">GINT_TO_LE</link><phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT-FROM-BE:CAPS">GUINT_FROM_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT-FROM-LE:CAPS">GUINT_FROM_LE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT-TO-BE:CAPS">GUINT_TO_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT-TO-LE:CAPS">GUINT_TO_LE</link><phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GLONG-FROM-BE:CAPS">GLONG_FROM_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GLONG-FROM-LE:CAPS">GLONG_FROM_LE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GLONG-TO-BE:CAPS">GLONG_TO_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GLONG-TO-LE:CAPS">GLONG_TO_LE</link><phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GULONG-FROM-BE:CAPS">GULONG_FROM_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GULONG-FROM-LE:CAPS">GULONG_FROM_LE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GULONG-TO-BE:CAPS">GULONG_TO_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GULONG-TO-LE:CAPS">GULONG_TO_LE</link><phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GSIZE-FROM-BE:CAPS">GSIZE_FROM_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GSIZE-FROM-LE:CAPS">GSIZE_FROM_LE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GSIZE-TO-BE:CAPS">GSIZE_TO_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GSIZE-TO-LE:CAPS">GSIZE_TO_LE</link><phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GSSIZE-FROM-BE:CAPS">GSSIZE_FROM_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GSSIZE-FROM-LE:CAPS">GSSIZE_FROM_LE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GSSIZE-TO-BE:CAPS">GSSIZE_TO_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GSSIZE-TO-LE:CAPS">GSSIZE_TO_LE</link><phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GINT16-FROM-BE:CAPS">GINT16_FROM_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GINT16-FROM-LE:CAPS">GINT16_FROM_LE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GINT16-TO-BE:CAPS">GINT16_TO_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GINT16-TO-LE:CAPS">GINT16_TO_LE</link><phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT16-FROM-BE:CAPS">GUINT16_FROM_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT16-FROM-LE:CAPS">GUINT16_FROM_LE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT16-TO-BE:CAPS">GUINT16_TO_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT16-TO-LE:CAPS">GUINT16_TO_LE</link><phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GINT32-FROM-BE:CAPS">GINT32_FROM_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GINT32-FROM-LE:CAPS">GINT32_FROM_LE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GINT32-TO-BE:CAPS">GINT32_TO_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GINT32-TO-LE:CAPS">GINT32_TO_LE</link><phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT32-FROM-BE:CAPS">GUINT32_FROM_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT32-FROM-LE:CAPS">GUINT32_FROM_LE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT32-TO-BE:CAPS">GUINT32_TO_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT32-TO-LE:CAPS">GUINT32_TO_LE</link><phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GINT64-FROM-BE:CAPS">GINT64_FROM_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GINT64-FROM-LE:CAPS">GINT64_FROM_LE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GINT64-TO-BE:CAPS">GINT64_TO_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GINT64-TO-LE:CAPS">GINT64_TO_LE</link><phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT64-FROM-BE:CAPS">GUINT64_FROM_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT64-FROM-LE:CAPS">GUINT64_FROM_LE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT64-TO-BE:CAPS">GUINT64_TO_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT64-TO-LE:CAPS">GUINT64_TO_LE</link><phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT16-SWAP-BE-PDP:CAPS">GUINT16_SWAP_BE_PDP</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT16-SWAP-LE-BE:CAPS">GUINT16_SWAP_LE_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT16-SWAP-LE-PDP:CAPS">GUINT16_SWAP_LE_PDP</link><phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT32-SWAP-BE-PDP:CAPS">GUINT32_SWAP_BE_PDP</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT32-SWAP-LE-BE:CAPS">GUINT32_SWAP_LE_BE</link><phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT32-SWAP-LE-PDP:CAPS">GUINT32_SWAP_LE_PDP</link><phrase role="c_punctuation">()</phrase></entry></row>

<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="GUINT64-SWAP-LE-BE:CAPS">GUINT64_SWAP_LE_BE</link><phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="glib-Byte-Order-Macros.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-BYTE-ORDER:CAPS">G_BYTE_ORDER</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-LITTLE-ENDIAN:CAPS">G_LITTLE_ENDIAN</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-BIG-ENDIAN:CAPS">G_BIG_ENDIAN</link></entry></row>
<row><entry role="define_keyword">#define</entry><entry role="function_name"><link linkend="G-PDP-ENDIAN:CAPS">G_PDP_ENDIAN</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>

<refsect1 id="glib-Byte-Order-Macros.includes"><title>Includes</title><synopsis>#include &lt;glib.h&gt;
</synopsis></refsect1>

<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. 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.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="g-htonl" role="macro">
<title>g_htonl()</title>
<indexterm zone="g-htonl"><primary sortas="htonl">g_htonl</primary></indexterm>
<programlisting language="C">#define             g_htonl(val)</programlisting>
<para>Converts a 32-bit integer value from host to network byte order.</para>
<refsect3 id="g-htonl.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a 32-bit integer value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-htonl.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to network byte order</para>
</refsect3></refsect2>
<refsect2 id="g-htons" role="macro">
<title>g_htons()</title>
<indexterm zone="g-htons"><primary sortas="htons">g_htons</primary></indexterm>
<programlisting language="C">#define             g_htons(val)</programlisting>
<para>Converts a 16-bit integer value from host to network byte order.</para>
<refsect3 id="g-htons.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a 16-bit integer value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-htons.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to network byte order</para>
</refsect3></refsect2>
<refsect2 id="g-ntohl" role="macro">
<title>g_ntohl()</title>
<indexterm zone="g-ntohl"><primary sortas="ntohl">g_ntohl</primary></indexterm>
<programlisting language="C">#define             g_ntohl(val)</programlisting>
<para>Converts a 32-bit integer value from network to host byte order.</para>
<refsect3 id="g-ntohl.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a 32-bit integer value in network byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-ntohl.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order.</para>
</refsect3></refsect2>
<refsect2 id="g-ntohs" role="macro">
<title>g_ntohs()</title>
<indexterm zone="g-ntohs"><primary sortas="ntohs">g_ntohs</primary></indexterm>
<programlisting language="C">#define             g_ntohs(val)</programlisting>
<para>Converts a 16-bit integer value from network to host byte order.</para>
<refsect3 id="g-ntohs.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a 16-bit integer value in network byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="g-ntohs.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GINT_FROM_BE(val)&#160;(GINT_TO_BE (val))
</programlisting>
<para>Converts a <link linkend="gint"><type>gint</type></link> value from big-endian to host byte order.</para>
<refsect3 id="GINT-FROM-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gint"><type>gint</type></link> value in big-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GINT-FROM-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GINT_FROM_LE(val)&#160;(GINT_TO_LE (val))
</programlisting>
<para>Converts a <link linkend="gint"><type>gint</type></link> value from little-endian to host byte order.</para>
<refsect3 id="GINT-FROM-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gint"><type>gint</type></link> value in little-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GINT-FROM-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#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>
<refsect3 id="GINT-TO-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gint"><type>gint</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GINT-TO-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to big-endian byte order</para>
</refsect3></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 language="C">#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>
<refsect3 id="GINT-TO-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gint"><type>gint</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GINT-TO-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to little-endian byte order</para>
</refsect3></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 language="C">#define GUINT_FROM_BE(val)&#160;(GUINT_TO_BE (val))
</programlisting>
<para>Converts a <link linkend="guint"><type>guint</type></link> value from big-endian to host byte order.</para>
<refsect3 id="GUINT-FROM-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint"><type>guint</type></link> value in big-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT-FROM-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GUINT_FROM_LE(val)&#160;(GUINT_TO_LE (val))
</programlisting>
<para>Converts a <link linkend="guint"><type>guint</type></link> value from little-endian to host byte order.</para>
<refsect3 id="GUINT-FROM-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint"><type>guint</type></link> value in little-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT-FROM-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GUINT_TO_BE(val)&#160;((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>
<refsect3 id="GUINT-TO-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint"><type>guint</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT-TO-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to big-endian byte order</para>
</refsect3></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 language="C">#define GUINT_TO_LE(val)&#160;((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>
<refsect3 id="GUINT-TO-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint"><type>guint</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT-TO-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to little-endian byte order.</para>
</refsect3></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 language="C">#define GLONG_FROM_BE(val)&#160;(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>
<refsect3 id="GLONG-FROM-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="glong"><type>glong</type></link> value in big-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GLONG-FROM-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GLONG_FROM_LE(val)&#160;(GLONG_TO_LE (val))
</programlisting>
<para>Converts a <link linkend="glong"><type>glong</type></link> value from little-endian to host byte order.</para>
<refsect3 id="GLONG-FROM-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="glong"><type>glong</type></link> value in little-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GLONG-FROM-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GLONG_TO_BE(val)&#160;((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>
<refsect3 id="GLONG-TO-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="glong"><type>glong</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GLONG-TO-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to big-endian byte order</para>
</refsect3></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 language="C">#define GLONG_TO_LE(val)&#160;((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>
<refsect3 id="GLONG-TO-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="glong"><type>glong</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GLONG-TO-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to little-endian</para>
</refsect3></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 language="C">#define GULONG_FROM_BE(val)&#160;(GULONG_TO_BE (val))
</programlisting>
<para>Converts a <link linkend="gulong"><type>gulong</type></link> value from big-endian to host byte order.</para>
<refsect3 id="GULONG-FROM-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gulong"><type>gulong</type></link> value in big-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GULONG-FROM-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GULONG_FROM_LE(val)&#160;(GULONG_TO_LE (val))
</programlisting>
<para>Converts a <link linkend="gulong"><type>gulong</type></link> value from little-endian to host byte order.</para>
<refsect3 id="GULONG-FROM-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gulong"><type>gulong</type></link> value in little-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GULONG-FROM-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GULONG_TO_BE(val)&#160;((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>
<refsect3 id="GULONG-TO-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gulong"><type>gulong</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GULONG-TO-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to big-endian</para>
</refsect3></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 language="C">#define GULONG_TO_LE(val)&#160;((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>
<refsect3 id="GULONG-TO-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gulong"><type>gulong</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GULONG-TO-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to little-endian</para>
</refsect3></refsect2>
<refsect2 id="GSIZE-FROM-BE:CAPS" role="macro">
<title>GSIZE_FROM_BE()</title>
<indexterm zone="GSIZE-FROM-BE:CAPS"><primary sortas="SIZE_FROM_BE">GSIZE_FROM_BE</primary></indexterm>
<programlisting language="C">#define GSIZE_FROM_BE(val)&#160;(GSIZE_TO_BE (val))
</programlisting>
<para>Converts a <link linkend="gsize"><type>gsize</type></link> value from big-endian to the host byte order.</para>
<refsect3 id="GSIZE-FROM-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gsize"><type>gsize</type></link> value in big-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GSIZE-FROM-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></refsect2>
<refsect2 id="GSIZE-FROM-LE:CAPS" role="macro">
<title>GSIZE_FROM_LE()</title>
<indexterm zone="GSIZE-FROM-LE:CAPS"><primary sortas="SIZE_FROM_LE">GSIZE_FROM_LE</primary></indexterm>
<programlisting language="C">#define GSIZE_FROM_LE(val)&#160;(GSIZE_TO_LE (val))
</programlisting>
<para>Converts a <link linkend="gsize"><type>gsize</type></link> value from little-endian to host byte order.</para>
<refsect3 id="GSIZE-FROM-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gsize"><type>gsize</type></link> value in little-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GSIZE-FROM-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></refsect2>
<refsect2 id="GSIZE-TO-BE:CAPS" role="macro">
<title>GSIZE_TO_BE()</title>
<indexterm zone="GSIZE-TO-BE:CAPS"><primary sortas="SIZE_TO_BE">GSIZE_TO_BE</primary></indexterm>
<programlisting language="C">#define GSIZE_TO_BE(val)&#160;((gsize) GUINT64_TO_BE (val))
</programlisting>
<para>Converts a <link linkend="gsize"><type>gsize</type></link> value from host byte order to big-endian.</para>
<refsect3 id="GSIZE-TO-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gsize"><type>gsize</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GSIZE-TO-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to big-endian byte order</para>
</refsect3></refsect2>
<refsect2 id="GSIZE-TO-LE:CAPS" role="macro">
<title>GSIZE_TO_LE()</title>
<indexterm zone="GSIZE-TO-LE:CAPS"><primary sortas="SIZE_TO_LE">GSIZE_TO_LE</primary></indexterm>
<programlisting language="C">#define GSIZE_TO_LE(val)&#160;((gsize) GUINT64_TO_LE (val))
</programlisting>
<para>Converts a <link linkend="gsize"><type>gsize</type></link> value from host byte order to little-endian.</para>
<refsect3 id="GSIZE-TO-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gsize"><type>gsize</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GSIZE-TO-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to little-endian</para>
</refsect3></refsect2>
<refsect2 id="GSSIZE-FROM-BE:CAPS" role="macro">
<title>GSSIZE_FROM_BE()</title>
<indexterm zone="GSSIZE-FROM-BE:CAPS"><primary sortas="SSIZE_FROM_BE">GSSIZE_FROM_BE</primary></indexterm>
<programlisting language="C">#define GSSIZE_FROM_BE(val)&#160;(GSSIZE_TO_BE (val))
</programlisting>
<para>Converts a <link linkend="gssize"><type>gssize</type></link> value from big-endian to host byte order.</para>
<refsect3 id="GSSIZE-FROM-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gssize"><type>gssize</type></link> value in big-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GSSIZE-FROM-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></refsect2>
<refsect2 id="GSSIZE-FROM-LE:CAPS" role="macro">
<title>GSSIZE_FROM_LE()</title>
<indexterm zone="GSSIZE-FROM-LE:CAPS"><primary sortas="SSIZE_FROM_LE">GSSIZE_FROM_LE</primary></indexterm>
<programlisting language="C">#define GSSIZE_FROM_LE(val)&#160;(GSSIZE_TO_LE (val))
</programlisting>
<para>Converts a <link linkend="gssize"><type>gssize</type></link> value from little-endian to host byte order.</para>
<refsect3 id="GSSIZE-FROM-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gssize"><type>gssize</type></link> value in little-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GSSIZE-FROM-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></refsect2>
<refsect2 id="GSSIZE-TO-BE:CAPS" role="macro">
<title>GSSIZE_TO_BE()</title>
<indexterm zone="GSSIZE-TO-BE:CAPS"><primary sortas="SSIZE_TO_BE">GSSIZE_TO_BE</primary></indexterm>
<programlisting language="C">#define GSSIZE_TO_BE(val)&#160;((gssize) GINT64_TO_BE (val))
</programlisting>
<para>Converts a <link linkend="gssize"><type>gssize</type></link> value from host byte order to big-endian.</para>
<refsect3 id="GSSIZE-TO-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gssize"><type>gssize</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GSSIZE-TO-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to big-endian</para>
</refsect3></refsect2>
<refsect2 id="GSSIZE-TO-LE:CAPS" role="macro">
<title>GSSIZE_TO_LE()</title>
<indexterm zone="GSSIZE-TO-LE:CAPS"><primary sortas="SSIZE_TO_LE">GSSIZE_TO_LE</primary></indexterm>
<programlisting language="C">#define GSSIZE_TO_LE(val)&#160;((gssize) GINT64_TO_LE (val))
</programlisting>
<para>Converts a <link linkend="gssize"><type>gssize</type></link> value from host byte order to little-endian.</para>
<refsect3 id="GSSIZE-TO-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gssize"><type>gssize</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GSSIZE-TO-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to little-endian</para>
</refsect3></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 language="C">#define GINT16_FROM_BE(val)&#160;(GINT16_TO_BE (val))
</programlisting>
<para>Converts a <link linkend="gint16"><type>gint16</type></link> value from big-endian to host byte order.</para>
<refsect3 id="GINT16-FROM-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gint16"><type>gint16</type></link> value in big-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GINT16-FROM-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GINT16_FROM_LE(val)&#160;(GINT16_TO_LE (val))
</programlisting>
<para>Converts a <link linkend="gint16"><type>gint16</type></link> value from little-endian to host byte order.</para>
<refsect3 id="GINT16-FROM-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gint16"><type>gint16</type></link> value in little-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GINT16-FROM-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GINT16_TO_BE(val)&#160;((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>
<refsect3 id="GINT16-TO-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gint16"><type>gint16</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GINT16-TO-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to big-endian</para>
</refsect3></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 language="C">#define GINT16_TO_LE(val)&#160;((gint16) (val))
</programlisting>
<para>Converts a <link linkend="gint16"><type>gint16</type></link> value from host byte order to little-endian.</para>
<refsect3 id="GINT16-TO-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gint16"><type>gint16</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GINT16-TO-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to little-endian</para>
</refsect3></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 language="C">#define GUINT16_FROM_BE(val)&#160;(GUINT16_TO_BE (val))
</programlisting>
<para>Converts a <link linkend="guint16"><type>guint16</type></link> value from big-endian to host byte order.</para>
<refsect3 id="GUINT16-FROM-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint16"><type>guint16</type></link> value in big-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT16-FROM-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GUINT16_FROM_LE(val)&#160;(GUINT16_TO_LE (val))
</programlisting>
<para>Converts a <link linkend="guint16"><type>guint16</type></link> value from little-endian to host byte order.</para>
<refsect3 id="GUINT16-FROM-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint16"><type>guint16</type></link> value in little-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT16-FROM-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GUINT16_TO_BE(val)&#160;(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>
<refsect3 id="GUINT16-TO-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint16"><type>guint16</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT16-TO-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to big-endian</para>
</refsect3></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 language="C">#define GUINT16_TO_LE(val)&#160;((guint16) (val))
</programlisting>
<para>Converts a <link linkend="guint16"><type>guint16</type></link> value from host byte order to little-endian.</para>
<refsect3 id="GUINT16-TO-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint16"><type>guint16</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT16-TO-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to little-endian</para>
</refsect3></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 language="C">#define GINT32_FROM_BE(val)&#160;(GINT32_TO_BE (val))
</programlisting>
<para>Converts a <link linkend="gint32"><type>gint32</type></link> value from big-endian to host byte order.</para>
<refsect3 id="GINT32-FROM-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gint32"><type>gint32</type></link> value in big-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GINT32-FROM-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GINT32_FROM_LE(val)&#160;(GINT32_TO_LE (val))
</programlisting>
<para>Converts a <link linkend="gint32"><type>gint32</type></link> value from little-endian to host byte order.</para>
<refsect3 id="GINT32-FROM-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gint32"><type>gint32</type></link> value in little-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GINT32-FROM-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GINT32_TO_BE(val)&#160;((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>
<refsect3 id="GINT32-TO-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gint32"><type>gint32</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GINT32-TO-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to big-endian</para>
</refsect3></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 language="C">#define GINT32_TO_LE(val)&#160;((gint32) (val))
</programlisting>
<para>Converts a <link linkend="gint32"><type>gint32</type></link> value from host byte order to little-endian.</para>
<refsect3 id="GINT32-TO-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gint32"><type>gint32</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GINT32-TO-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to little-endian</para>
</refsect3></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 language="C">#define GUINT32_FROM_BE(val)&#160;(GUINT32_TO_BE (val))
</programlisting>
<para>Converts a <link linkend="guint32"><type>guint32</type></link> value from big-endian to host byte order.</para>
<refsect3 id="GUINT32-FROM-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint32"><type>guint32</type></link> value in big-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT32-FROM-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GUINT32_FROM_LE(val)&#160;(GUINT32_TO_LE (val))
</programlisting>
<para>Converts a <link linkend="guint32"><type>guint32</type></link> value from little-endian to host byte order.</para>
<refsect3 id="GUINT32-FROM-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint32"><type>guint32</type></link> value in little-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT32-FROM-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GUINT32_TO_BE(val)&#160;(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>
<refsect3 id="GUINT32-TO-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint32"><type>guint32</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT32-TO-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to big-endian</para>
</refsect3></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 language="C">#define GUINT32_TO_LE(val)&#160;((guint32) (val))
</programlisting>
<para>Converts a <link linkend="guint32"><type>guint32</type></link> value from host byte order to little-endian.</para>
<refsect3 id="GUINT32-TO-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint32"><type>guint32</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT32-TO-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to little-endian</para>
</refsect3></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 language="C">#define GINT64_FROM_BE(val)&#160;(GINT64_TO_BE (val))
</programlisting>
<para>Converts a <link linkend="gint64"><type>gint64</type></link> value from big-endian to host byte order.</para>
<refsect3 id="GINT64-FROM-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gint64"><type>gint64</type></link> value in big-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GINT64-FROM-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GINT64_FROM_LE(val)&#160;(GINT64_TO_LE (val))
</programlisting>
<para>Converts a <link linkend="gint64"><type>gint64</type></link> value from little-endian to host byte order.</para>
<refsect3 id="GINT64-FROM-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gint64"><type>gint64</type></link> value in little-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GINT64-FROM-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GINT64_TO_BE(val)&#160;((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>
<refsect3 id="GINT64-TO-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gint64"><type>gint64</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GINT64-TO-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to big-endian</para>
</refsect3></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 language="C">#define GINT64_TO_LE(val)&#160;((gint64) (val))
</programlisting>
<para>Converts a <link linkend="gint64"><type>gint64</type></link> value from host byte order to little-endian.</para>
<refsect3 id="GINT64-TO-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="gint64"><type>gint64</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GINT64-TO-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to little-endian</para>
</refsect3></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 language="C">#define GUINT64_FROM_BE(val)&#160;(GUINT64_TO_BE (val))
</programlisting>
<para>Converts a <link linkend="guint64"><type>guint64</type></link> value from big-endian to host byte order.</para>
<refsect3 id="GUINT64-FROM-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint64"><type>guint64</type></link> value in big-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT64-FROM-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GUINT64_FROM_LE(val)&#160;(GUINT64_TO_LE (val))
</programlisting>
<para>Converts a <link linkend="guint64"><type>guint64</type></link> value from little-endian to host byte order.</para>
<refsect3 id="GUINT64-FROM-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint64"><type>guint64</type></link> value in little-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT64-FROM-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to host byte order</para>
</refsect3></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 language="C">#define GUINT64_TO_BE(val)&#160;(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>
<refsect3 id="GUINT64-TO-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint64"><type>guint64</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT64-TO-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to big-endian</para>
</refsect3></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 language="C">#define GUINT64_TO_LE(val)&#160;((guint64) (val))
</programlisting>
<para>Converts a <link linkend="guint64"><type>guint64</type></link> value from host byte order to little-endian.</para>
<refsect3 id="GUINT64-TO-LE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint64"><type>guint64</type></link> value in host byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT64-TO-LE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to little-endian</para>
</refsect3></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 language="C">#define GUINT16_SWAP_BE_PDP(val)&#160;(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>
<refsect3 id="GUINT16-SWAP-BE-PDP.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint16"><type>guint16</type></link> value in big-endian or pdp-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT16-SWAP-BE-PDP.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to the opposite byte order</para>
</refsect3></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 language="C">#    define GUINT16_SWAP_LE_BE(val) (GUINT16_SWAP_LE_BE_IA32 (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>
<refsect3 id="GUINT16-SWAP-LE-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint16"><type>guint16</type></link> value in little-endian or big-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT16-SWAP-LE-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to the opposite byte order</para>
</refsect3></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 language="C">#define GUINT16_SWAP_LE_PDP(val)&#160;((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>
<refsect3 id="GUINT16-SWAP-LE-PDP.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint16"><type>guint16</type></link> value in little-endian or pdp-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT16-SWAP-LE-PDP.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to the opposite byte order</para>
</refsect3></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 language="C">#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>
<refsect3 id="GUINT32-SWAP-BE-PDP.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint32"><type>guint32</type></link> value in big-endian or pdp-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT32-SWAP-BE-PDP.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to the opposite byte order</para>
</refsect3></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 language="C">#    define GUINT32_SWAP_LE_BE(val) ((guint32) __builtin_bswap32 ((guint32) (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>
<refsect3 id="GUINT32-SWAP-LE-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint32"><type>guint32</type></link> value in little-endian or big-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT32-SWAP-LE-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to the opposite byte order</para>
</refsect3></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 language="C">#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>
<refsect3 id="GUINT32-SWAP-LE-PDP.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint32"><type>guint32</type></link> value in little-endian or pdp-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT32-SWAP-LE-PDP.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to the opposite byte order</para>
</refsect3></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 language="C">#    define GUINT64_SWAP_LE_BE(val) ((guint64) __builtin_bswap64 ((guint64) (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>
<refsect3 id="GUINT64-SWAP-LE-BE.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>val</para></entry>
<entry role="parameter_description"><para>a <link linkend="guint64"><type>guint64</type></link> value in little-endian or big-endian byte order</para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="GUINT64-SWAP-LE-BE.returns" role="returns">
<title>Returns</title>
<para> <parameter>val</parameter>
converted to the opposite byte order</para>
</refsect3></refsect2>

</refsect1>
<refsect1 id="glib-Byte-Order-Macros.other_details" role="details">
<title role="details.title">Types and Values</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 language="C">#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 language="C">#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 language="C">#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 language="C">#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>

</refsect1>

</refentry>
