| Current File : //usr/share/doc/dbus/api/dbus-marshal-byteswap_8c_source.html |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>D-Bus: dbus-marshal-byteswap.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">D-Bus
 <span id="projectnumber">1.8.20</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.6.1 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="pages.html"><span>Related Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="headertitle">
<div class="title">dbus-marshal-byteswap.c</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */</span>
<a name="l00002"></a>00002 <span class="comment">/* dbus-marshal-byteswap.c Swap a block of marshaled data</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2005 Red Hat, Inc.</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * Licensed under the Academic Free License version 2.1</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
<a name="l00009"></a>00009 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
<a name="l00010"></a>00010 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00011"></a>00011 <span class="comment"> * (at your option) any later version.</span>
<a name="l00012"></a>00012 <span class="comment"> *</span>
<a name="l00013"></a>00013 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
<a name="l00014"></a>00014 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00015"></a>00015 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<a name="l00016"></a>00016 <span class="comment"> * GNU General Public License for more details.</span>
<a name="l00017"></a>00017 <span class="comment"> *</span>
<a name="l00018"></a>00018 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
<a name="l00019"></a>00019 <span class="comment"> * along with this program; if not, write to the Free Software</span>
<a name="l00020"></a>00020 <span class="comment"> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA</span>
<a name="l00021"></a>00021 <span class="comment"> *</span>
<a name="l00022"></a>00022 <span class="comment"> */</span>
<a name="l00023"></a>00023
<a name="l00024"></a>00024 <span class="preprocessor">#include <config.h></span>
<a name="l00025"></a>00025 <span class="preprocessor">#include "dbus-marshal-byteswap.h"</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include "dbus-marshal-basic.h"</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include "dbus-signature.h"</span>
<a name="l00028"></a>00028
<a name="l00034"></a>00034 <span class="keyword">static</span> <span class="keywordtype">void</span>
<a name="l00035"></a>00035 byteswap_body_helper (<a class="code" href="structDBusTypeReader.html" title="The type reader is an iterator for reading values from a block of values.">DBusTypeReader</a> *reader,
<a name="l00036"></a>00036 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a> walk_reader_to_end,
<a name="l00037"></a>00037 <span class="keywordtype">int</span> old_byte_order,
<a name="l00038"></a>00038 <span class="keywordtype">int</span> new_byte_order,
<a name="l00039"></a>00039 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *p,
<a name="l00040"></a>00040 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> **new_p)
<a name="l00041"></a>00041 {
<a name="l00042"></a>00042 <span class="keywordtype">int</span> current_type;
<a name="l00043"></a>00043
<a name="l00044"></a>00044 <span class="keywordflow">while</span> ((current_type = <a class="code" href="group__DBusMarshal.html#gab8e39cb8084247d54d7f272c51622a73" title="Gets the type of the value the reader is currently pointing to; or for a types-only reader gets the t...">_dbus_type_reader_get_current_type</a> (reader)) != <a class="code" href="group__DBusProtocol.html#gaa9588da889743b2119dc6664712ae51e" title="Type code that is never equal to a legitimate type code.">DBUS_TYPE_INVALID</a>)
<a name="l00045"></a>00045 {
<a name="l00046"></a>00046 <span class="keywordflow">switch</span> (current_type)
<a name="l00047"></a>00047 {
<a name="l00048"></a>00048 <span class="keywordflow">case</span> <a class="code" href="group__DBusProtocol.html#ga355d6d0998164a5eb915a26fb67fce5f" title="Type code marking an 8-bit unsigned integer.">DBUS_TYPE_BYTE</a>:
<a name="l00049"></a>00049 ++p;
<a name="l00050"></a>00050 <span class="keywordflow">break</span>;
<a name="l00051"></a>00051
<a name="l00052"></a>00052 <span class="keywordflow">case</span> <a class="code" href="group__DBusProtocol.html#ga49cdd4169af84ed7937f34b31f43e331" title="Type code marking a 16-bit signed integer.">DBUS_TYPE_INT16</a>:
<a name="l00053"></a>00053 <span class="keywordflow">case</span> <a class="code" href="group__DBusProtocol.html#gad74b8d93a1464182ac1af7e0e2435f46" title="Type code marking a 16-bit unsigned integer.">DBUS_TYPE_UINT16</a>:
<a name="l00054"></a>00054 {
<a name="l00055"></a>00055 p = _DBUS_ALIGN_ADDRESS (p, 2);
<a name="l00056"></a>00056 *((<a class="code" href="group__DBusTypes.html#ga8132d71032da957f08ce4e0ec87f2063" title="A 16-bit unsigned integer on all platforms.">dbus_uint16_t</a>*)p) = DBUS_UINT16_SWAP_LE_BE (*((<a class="code" href="group__DBusTypes.html#ga8132d71032da957f08ce4e0ec87f2063" title="A 16-bit unsigned integer on all platforms.">dbus_uint16_t</a>*)p));
<a name="l00057"></a>00057 p += 2;
<a name="l00058"></a>00058 }
<a name="l00059"></a>00059 <span class="keywordflow">break</span>;
<a name="l00060"></a>00060
<a name="l00061"></a>00061 <span class="keywordflow">case</span> <a class="code" href="group__DBusProtocol.html#ga624ecee83984330ad89cbf064a2b28e6" title="Type code marking a boolean.">DBUS_TYPE_BOOLEAN</a>:
<a name="l00062"></a>00062 <span class="keywordflow">case</span> <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>:
<a name="l00063"></a>00063 <span class="keywordflow">case</span> <a class="code" href="group__DBusProtocol.html#gaedb1740bd8a9174b98ac593eded25d49" title="Type code marking a 32-bit unsigned integer.">DBUS_TYPE_UINT32</a>:
<a name="l00064"></a>00064 {
<a name="l00065"></a>00065 p = _DBUS_ALIGN_ADDRESS (p, 4);
<a name="l00066"></a>00066 *((<a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a>*)p) = DBUS_UINT32_SWAP_LE_BE (*((<a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a>*)p));
<a name="l00067"></a>00067 p += 4;
<a name="l00068"></a>00068 }
<a name="l00069"></a>00069 <span class="keywordflow">break</span>;
<a name="l00070"></a>00070
<a name="l00071"></a>00071 <span class="keywordflow">case</span> <a class="code" href="group__DBusProtocol.html#gabda4301c14b367f151f86769a1c27c5b" title="Type code marking a 64-bit signed integer.">DBUS_TYPE_INT64</a>:
<a name="l00072"></a>00072 <span class="keywordflow">case</span> <a class="code" href="group__DBusProtocol.html#gac59cc8f824813444cc9585effd4770d7" title="Type code marking a 64-bit unsigned integer.">DBUS_TYPE_UINT64</a>:
<a name="l00073"></a>00073 <span class="keywordflow">case</span> <a class="code" href="group__DBusProtocol.html#gac30c00bb6de04d0886cfbace276ec353" title="Type code marking an 8-byte double in IEEE 754 format.">DBUS_TYPE_DOUBLE</a>:
<a name="l00074"></a>00074 {
<a name="l00075"></a>00075 p = _DBUS_ALIGN_ADDRESS (p, 8);
<a name="l00076"></a>00076 *((<a class="code" href="group__DBusTypes.html#ga0a7c275002dbafa34536a76db079a950" title="A 64-bit unsigned integer.">dbus_uint64_t</a>*)p) = DBUS_UINT64_SWAP_LE_BE (*((<a class="code" href="group__DBusTypes.html#ga0a7c275002dbafa34536a76db079a950" title="A 64-bit unsigned integer.">dbus_uint64_t</a>*)p));
<a name="l00077"></a>00077 p += 8;
<a name="l00078"></a>00078 }
<a name="l00079"></a>00079 <span class="keywordflow">break</span>;
<a name="l00080"></a>00080
<a name="l00081"></a>00081 <span class="keywordflow">case</span> <a class="code" href="group__DBusProtocol.html#ga8912f600f81a773066ca03d9163613a9" title="Type code marking a D-Bus array type.">DBUS_TYPE_ARRAY</a>:
<a name="l00082"></a>00082 <span class="keywordflow">case</span> <a class="code" href="group__DBusProtocol.html#ga7eb77066dadf5415896b44c56d93acce" title="Type code marking a UTF-8 encoded, nul-terminated Unicode string.">DBUS_TYPE_STRING</a>:
<a name="l00083"></a>00083 <span class="keywordflow">case</span> <a class="code" href="group__DBusProtocol.html#ga31cc59c99a6cbbfcef71756e1390dc4c" title="Type code marking a D-Bus object path.">DBUS_TYPE_OBJECT_PATH</a>:
<a name="l00084"></a>00084 {
<a name="l00085"></a>00085 <a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a> array_len;
<a name="l00086"></a>00086
<a name="l00087"></a>00087 p = _DBUS_ALIGN_ADDRESS (p, 4);
<a name="l00088"></a>00088
<a name="l00089"></a>00089 array_len = <a class="code" href="group__DBusMarshal.html#ga50a9187b315cfcd6b311ed1b36488c05" title="Unpacks a 32 bit unsigned integer from a data pointer.">_dbus_unpack_uint32</a> (old_byte_order, p);
<a name="l00090"></a>00090
<a name="l00091"></a>00091 *((<a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a>*)p) = DBUS_UINT32_SWAP_LE_BE (*((<a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a>*)p));
<a name="l00092"></a>00092 p += 4;
<a name="l00093"></a>00093
<a name="l00094"></a>00094 <span class="keywordflow">if</span> (current_type == <a class="code" href="group__DBusProtocol.html#ga8912f600f81a773066ca03d9163613a9" title="Type code marking a D-Bus array type.">DBUS_TYPE_ARRAY</a>)
<a name="l00095"></a>00095 {
<a name="l00096"></a>00096 <span class="keywordtype">int</span> elem_type;
<a name="l00097"></a>00097 <span class="keywordtype">int</span> alignment;
<a name="l00098"></a>00098
<a name="l00099"></a>00099 elem_type = <a class="code" href="group__DBusMarshal.html#ga6e5439f7ca5ee8a1ce943ddab7611d0d" title="Gets the type of an element of the array the reader is currently pointing to.">_dbus_type_reader_get_element_type</a> (reader);
<a name="l00100"></a>00100 alignment = <a class="code" href="group__DBusMarshal.html#ga2ba80f227880e442c140bc67653b0abd" title="Gets the alignment requirement for the given type; will be 1, 4, or 8.">_dbus_type_get_alignment</a> (elem_type);
<a name="l00101"></a>00101
<a name="l00102"></a>00102 _dbus_assert ((array_len / alignment) < <a class="code" href="group__DBusProtocol.html#ga5265afa08a4c8d9f31b287a57e8cb217" title="Max length of a marshaled array in bytes (64M, 2^26) We use signed int for lengths so must be INT_MAX...">DBUS_MAXIMUM_ARRAY_LENGTH</a>);
<a name="l00103"></a>00103
<a name="l00104"></a>00104 p = _DBUS_ALIGN_ADDRESS (p, alignment);
<a name="l00105"></a>00105
<a name="l00106"></a>00106 <span class="keywordflow">if</span> (<a class="code" href="group__DBusSignature.html#ga2f89962cbd33e4ad843824157bae2093" title="Tells you whether values of this type can change length if you set them to some other value...">dbus_type_is_fixed</a> (elem_type))
<a name="l00107"></a>00107 {
<a name="l00108"></a>00108 <span class="keywordflow">if</span> (alignment > 1)
<a name="l00109"></a>00109 <a class="code" href="group__DBusMarshal.html#gaec86e8e1ae2f25b673ae6d900ab323c7" title="Swaps the elements of an array to the opposite byte order.">_dbus_swap_array</a> (p, array_len / alignment, alignment);
<a name="l00110"></a>00110 p += array_len;
<a name="l00111"></a>00111 }
<a name="l00112"></a>00112 <span class="keywordflow">else</span>
<a name="l00113"></a>00113 {
<a name="l00114"></a>00114 <a class="code" href="structDBusTypeReader.html" title="The type reader is an iterator for reading values from a block of values.">DBusTypeReader</a> sub;
<a name="l00115"></a>00115 <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *array_end;
<a name="l00116"></a>00116
<a name="l00117"></a>00117 array_end = p + array_len;
<a name="l00118"></a>00118
<a name="l00119"></a>00119 <a class="code" href="group__DBusMarshal.html#ga082b410820c74b2a6ca816a8e0c91803" title="Initialize a new reader pointing to the first type and corresponding value that's a child of the curr...">_dbus_type_reader_recurse</a> (reader, &sub);
<a name="l00120"></a>00120
<a name="l00121"></a>00121 <span class="keywordflow">while</span> (p < array_end)
<a name="l00122"></a>00122 {
<a name="l00123"></a>00123 byteswap_body_helper (&sub,
<a name="l00124"></a>00124 <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>,
<a name="l00125"></a>00125 old_byte_order,
<a name="l00126"></a>00126 new_byte_order,
<a name="l00127"></a>00127 p, &p);
<a name="l00128"></a>00128 }
<a name="l00129"></a>00129 }
<a name="l00130"></a>00130 }
<a name="l00131"></a>00131 <span class="keywordflow">else</span>
<a name="l00132"></a>00132 {
<a name="l00133"></a>00133 _dbus_assert (current_type == <a class="code" href="group__DBusProtocol.html#ga7eb77066dadf5415896b44c56d93acce" title="Type code marking a UTF-8 encoded, nul-terminated Unicode string.">DBUS_TYPE_STRING</a> ||
<a name="l00134"></a>00134 current_type == <a class="code" href="group__DBusProtocol.html#ga31cc59c99a6cbbfcef71756e1390dc4c" title="Type code marking a D-Bus object path.">DBUS_TYPE_OBJECT_PATH</a>);
<a name="l00135"></a>00135
<a name="l00136"></a>00136 p += (array_len + 1); <span class="comment">/* + 1 for nul */</span>
<a name="l00137"></a>00137 }
<a name="l00138"></a>00138 }
<a name="l00139"></a>00139 <span class="keywordflow">break</span>;
<a name="l00140"></a>00140
<a name="l00141"></a>00141 <span class="keywordflow">case</span> <a class="code" href="group__DBusProtocol.html#ga26ed6c20c3d9f0b50ea0a1cf80be3279" title="Type code marking a D-Bus type signature.">DBUS_TYPE_SIGNATURE</a>:
<a name="l00142"></a>00142 {
<a name="l00143"></a>00143 <a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a> sig_len;
<a name="l00144"></a>00144
<a name="l00145"></a>00145 sig_len = *p;
<a name="l00146"></a>00146
<a name="l00147"></a>00147 p += (sig_len + 2); <span class="comment">/* +2 for len and nul */</span>
<a name="l00148"></a>00148 }
<a name="l00149"></a>00149 <span class="keywordflow">break</span>;
<a name="l00150"></a>00150
<a name="l00151"></a>00151 <span class="keywordflow">case</span> <a class="code" href="group__DBusProtocol.html#ga4aa7a463ad2bce4e9aa95e3e397ddcf1" title="Type code marking a D-Bus variant type.">DBUS_TYPE_VARIANT</a>:
<a name="l00152"></a>00152 {
<a name="l00153"></a>00153 <span class="comment">/* 1 byte sig len, sig typecodes, align to</span>
<a name="l00154"></a>00154 <span class="comment"> * contained-type-boundary, values.</span>
<a name="l00155"></a>00155 <span class="comment"> */</span>
<a name="l00156"></a>00156 <a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a> sig_len;
<a name="l00157"></a>00157 <a class="code" href="structDBusString.html">DBusString</a> sig;
<a name="l00158"></a>00158 <a class="code" href="structDBusTypeReader.html" title="The type reader is an iterator for reading values from a block of values.">DBusTypeReader</a> sub;
<a name="l00159"></a>00159 <span class="keywordtype">int</span> contained_alignment;
<a name="l00160"></a>00160
<a name="l00161"></a>00161 sig_len = *p;
<a name="l00162"></a>00162 ++p;
<a name="l00163"></a>00163
<a name="l00164"></a>00164 <a class="code" href="group__DBusString.html#ga6792a5c1725faa9d635d95f7a3b5bfae" title="Initializes a constant string with a length.">_dbus_string_init_const_len</a> (&sig, p, sig_len);
<a name="l00165"></a>00165
<a name="l00166"></a>00166 p += (sig_len + 1); <span class="comment">/* 1 for nul */</span>
<a name="l00167"></a>00167
<a name="l00168"></a>00168 contained_alignment = <a class="code" href="group__DBusMarshal.html#ga2ba80f227880e442c140bc67653b0abd" title="Gets the alignment requirement for the given type; will be 1, 4, or 8.">_dbus_type_get_alignment</a> (<a class="code" href="group__DBusMarshal.html#ga5866a0fd058aed3396402d0456144fd2" title="Get the first type in the signature.">_dbus_first_type_in_signature</a> (&sig, 0));
<a name="l00169"></a>00169
<a name="l00170"></a>00170 p = _DBUS_ALIGN_ADDRESS (p, contained_alignment);
<a name="l00171"></a>00171
<a name="l00172"></a>00172 <a class="code" href="group__DBusMarshal.html#ga3a5845f555f11c33ebaa71a75abff661" title="Like _dbus_type_reader_init() but the iteration is over the signature, not over values.">_dbus_type_reader_init_types_only</a> (&sub, &sig, 0);
<a name="l00173"></a>00173
<a name="l00174"></a>00174 byteswap_body_helper (&sub, <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to "0".">FALSE</a>, old_byte_order, new_byte_order, p, &p);
<a name="l00175"></a>00175 }
<a name="l00176"></a>00176 <span class="keywordflow">break</span>;
<a name="l00177"></a>00177
<a name="l00178"></a>00178 <span class="keywordflow">case</span> <a class="code" href="group__DBusProtocol.html#gae4b22a74b9edb0ec0ff6e0294794d3f9" title="STRUCT and DICT_ENTRY are sort of special since their codes can't appear in a type string...">DBUS_TYPE_STRUCT</a>:
<a name="l00179"></a>00179 <span class="keywordflow">case</span> <a class="code" href="group__DBusProtocol.html#gad2fc8e6c50e0ad927f4249fb9e53ca97" title="Type code used to represent a dict entry; however, this type code does not appear in type signatures...">DBUS_TYPE_DICT_ENTRY</a>:
<a name="l00180"></a>00180 {
<a name="l00181"></a>00181 <a class="code" href="structDBusTypeReader.html" title="The type reader is an iterator for reading values from a block of values.">DBusTypeReader</a> sub;
<a name="l00182"></a>00182
<a name="l00183"></a>00183 p = _DBUS_ALIGN_ADDRESS (p, 8);
<a name="l00184"></a>00184
<a name="l00185"></a>00185 <a class="code" href="group__DBusMarshal.html#ga082b410820c74b2a6ca816a8e0c91803" title="Initialize a new reader pointing to the first type and corresponding value that's a child of the curr...">_dbus_type_reader_recurse</a> (reader, &sub);
<a name="l00186"></a>00186
<a name="l00187"></a>00187 byteswap_body_helper (&sub, <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a>, old_byte_order, new_byte_order, p, &p);
<a name="l00188"></a>00188 }
<a name="l00189"></a>00189 <span class="keywordflow">break</span>;
<a name="l00190"></a>00190
<a name="l00191"></a>00191 <span class="keywordflow">case</span> <a class="code" href="group__DBusProtocol.html#ga59f8acaeb207b182982dfb97174b7f16" title="Type code marking a unix file descriptor.">DBUS_TYPE_UNIX_FD</a>:
<a name="l00192"></a>00192 <span class="comment">/* fds can only be passed on a local machine, so byte order must always match */</span>
<a name="l00193"></a>00193 _dbus_assert_not_reached(<span class="stringliteral">"attempted to byteswap unix fds which makes no sense"</span>);
<a name="l00194"></a>00194 <span class="keywordflow">break</span>;
<a name="l00195"></a>00195
<a name="l00196"></a>00196 <span class="keywordflow">default</span>:
<a name="l00197"></a>00197 _dbus_assert_not_reached (<span class="stringliteral">"invalid typecode in supposedly-validated signature"</span>);
<a name="l00198"></a>00198 <span class="keywordflow">break</span>;
<a name="l00199"></a>00199 }
<a name="l00200"></a>00200
<a name="l00201"></a>00201 <span class="keywordflow">if</span> (walk_reader_to_end)
<a name="l00202"></a>00202 <a class="code" href="group__DBusMarshal.html#ga746c09512d4905f2d2fac7ed4c3c63c2" title="Skip to the next value on this "level".">_dbus_type_reader_next</a> (reader);
<a name="l00203"></a>00203 <span class="keywordflow">else</span>
<a name="l00204"></a>00204 <span class="keywordflow">break</span>;
<a name="l00205"></a>00205 }
<a name="l00206"></a>00206
<a name="l00207"></a>00207 <span class="keywordflow">if</span> (new_p)
<a name="l00208"></a>00208 *new_p = p;
<a name="l00209"></a>00209 }
<a name="l00210"></a>00210
<a name="l00221"></a>00221 <span class="keywordtype">void</span>
<a name="l00222"></a><a class="code" href="group__DBusMarshal.html#ga609a4b8c0b65096890766fda73a4c40f">00222</a> <a class="code" href="group__DBusMarshal.html#ga609a4b8c0b65096890766fda73a4c40f" title="Byteswaps the marshaled data in the given value_str.">_dbus_marshal_byteswap</a> (<span class="keyword">const</span> <a class="code" href="structDBusString.html">DBusString</a> *signature,
<a name="l00223"></a>00223 <span class="keywordtype">int</span> signature_start,
<a name="l00224"></a>00224 <span class="keywordtype">int</span> old_byte_order,
<a name="l00225"></a>00225 <span class="keywordtype">int</span> new_byte_order,
<a name="l00226"></a>00226 <a class="code" href="structDBusString.html">DBusString</a> *value_str,
<a name="l00227"></a>00227 <span class="keywordtype">int</span> value_pos)
<a name="l00228"></a>00228 {
<a name="l00229"></a>00229 <a class="code" href="structDBusTypeReader.html" title="The type reader is an iterator for reading values from a block of values.">DBusTypeReader</a> reader;
<a name="l00230"></a>00230
<a name="l00231"></a>00231 _dbus_assert (value_pos >= 0);
<a name="l00232"></a>00232 _dbus_assert (value_pos <= <a class="code" href="group__DBusString.html#gaa5136e6fd2c5188f4b88de7863369c6d" title="Gets the length of a string (not including nul termination).">_dbus_string_get_length</a> (value_str));
<a name="l00233"></a>00233
<a name="l00234"></a>00234 <span class="keywordflow">if</span> (old_byte_order == new_byte_order)
<a name="l00235"></a>00235 <span class="keywordflow">return</span>;
<a name="l00236"></a>00236
<a name="l00237"></a>00237 <a class="code" href="group__DBusMarshal.html#ga3a5845f555f11c33ebaa71a75abff661" title="Like _dbus_type_reader_init() but the iteration is over the signature, not over values.">_dbus_type_reader_init_types_only</a> (&reader,
<a name="l00238"></a>00238 signature, signature_start);
<a name="l00239"></a>00239
<a name="l00240"></a>00240 byteswap_body_helper (&reader, <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to "1".">TRUE</a>,
<a name="l00241"></a>00241 old_byte_order, new_byte_order,
<a name="l00242"></a>00242 <a class="code" href="group__DBusString.html#ga7a73fb373398606e6e1d0a86c4587a3c" title="Gets a sub-portion of the raw character buffer from the string.">_dbus_string_get_data_len</a> (value_str, value_pos, 0),
<a name="l00243"></a>00243 <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00244"></a>00244 }
<a name="l00245"></a>00245
<a name="l00248"></a>00248 <span class="comment">/* Tests in dbus-marshal-byteswap-util.c */</span>
</pre></div></div><!-- contents -->
<hr class="footer"/><address class="footer"><small>
Generated on Thu Mar 3 2016 17:50:30 for D-Bus by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>
</body>
</html>