Current File : //usr/share/doc/dbus/api/dbus-message-factory_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-message-factory.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
   &#160;<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&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;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&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">dbus-message-factory.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: &quot;gnu&quot;; indent-tabs-mode: nil; -*- */</span>
<a name="l00002"></a>00002 <span class="comment">/* dbus-message-factory.c Generator of valid and invalid message data for test suite</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 <span class="preprocessor">#include &lt;config.h&gt;</span>
<a name="l00024"></a>00024 
<a name="l00025"></a>00025 <span class="preprocessor">#ifndef DOXYGEN_SHOULD_SKIP_THIS</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span>
<a name="l00027"></a>00027 <span class="preprocessor">#ifdef DBUS_ENABLE_EMBEDDED_TESTS</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#include &quot;dbus-message-factory.h&quot;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &quot;dbus-message-private.h&quot;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &quot;dbus-signature.h&quot;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &quot;dbus-test.h&quot;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;stdio.h&gt;</span>
<a name="l00033"></a>00033 
<a name="l00034"></a>00034 <span class="keyword">typedef</span> <span class="keyword">enum</span>
<a name="l00035"></a>00035   {
<a name="l00036"></a>00036     CHANGE_TYPE_ADJUST,
<a name="l00037"></a>00037     CHANGE_TYPE_ABSOLUTE
<a name="l00038"></a>00038   } ChangeType;
<a name="l00039"></a>00039 
<a name="l00040"></a>00040 <span class="preprocessor">#define BYTE_ORDER_OFFSET  0</span>
<a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#define TYPE_OFFSET        1</span>
<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#define BODY_LENGTH_OFFSET 4</span>
<a name="l00043"></a>00043 <span class="preprocessor"></span><span class="preprocessor">#define FIELDS_ARRAY_LENGTH_OFFSET 12</span>
<a name="l00044"></a>00044 <span class="preprocessor"></span>
<a name="l00045"></a>00045 <span class="keyword">static</span> <span class="keywordtype">void</span>
<a name="l00046"></a>00046 iter_recurse (DBusMessageDataIter *iter)
<a name="l00047"></a>00047 {
<a name="l00048"></a>00048   iter-&gt;depth += 1;
<a name="l00049"></a>00049   _dbus_assert (iter-&gt;depth &lt; _DBUS_MESSAGE_DATA_MAX_NESTING);
<a name="l00050"></a>00050   _dbus_assert (iter-&gt;sequence_nos[iter-&gt;depth] &gt;= 0);
<a name="l00051"></a>00051 }
<a name="l00052"></a>00052 
<a name="l00053"></a>00053 <span class="keyword">static</span> <span class="keywordtype">int</span>
<a name="l00054"></a>00054 iter_get_sequence (DBusMessageDataIter *iter)
<a name="l00055"></a>00055 {
<a name="l00056"></a>00056   _dbus_assert (iter-&gt;sequence_nos[iter-&gt;depth] &gt;= 0);
<a name="l00057"></a>00057   <span class="keywordflow">return</span> iter-&gt;sequence_nos[iter-&gt;depth];
<a name="l00058"></a>00058 }
<a name="l00059"></a>00059 
<a name="l00060"></a>00060 <span class="keyword">static</span> <span class="keywordtype">void</span>
<a name="l00061"></a>00061 iter_set_sequence (DBusMessageDataIter *iter,
<a name="l00062"></a>00062                    <span class="keywordtype">int</span>                  sequence)
<a name="l00063"></a>00063 {
<a name="l00064"></a>00064   _dbus_assert (sequence &gt;= 0);
<a name="l00065"></a>00065   iter-&gt;sequence_nos[iter-&gt;depth] = sequence;
<a name="l00066"></a>00066 }
<a name="l00067"></a>00067 
<a name="l00068"></a>00068 <span class="keyword">static</span> <span class="keywordtype">void</span>
<a name="l00069"></a>00069 iter_unrecurse (DBusMessageDataIter *iter)
<a name="l00070"></a>00070 {
<a name="l00071"></a>00071   iter-&gt;depth -= 1;
<a name="l00072"></a>00072   _dbus_assert (iter-&gt;depth &gt;= 0);
<a name="l00073"></a>00073 }
<a name="l00074"></a>00074 
<a name="l00075"></a>00075 <span class="keyword">static</span> <span class="keywordtype">void</span>
<a name="l00076"></a>00076 iter_next (DBusMessageDataIter *iter)
<a name="l00077"></a>00077 {
<a name="l00078"></a>00078   iter-&gt;sequence_nos[iter-&gt;depth] += 1;
<a name="l00079"></a>00079 }
<a name="l00080"></a>00080 
<a name="l00081"></a>00081 <span class="keyword">static</span> <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00082"></a>00082 iter_first_in_series (DBusMessageDataIter *iter)
<a name="l00083"></a>00083 {
<a name="l00084"></a>00084   <span class="keywordtype">int</span> i;
<a name="l00085"></a>00085 
<a name="l00086"></a>00086   i = iter-&gt;depth;
<a name="l00087"></a>00087   <span class="keywordflow">while</span> (i &lt; _DBUS_MESSAGE_DATA_MAX_NESTING)
<a name="l00088"></a>00088     {
<a name="l00089"></a>00089       <span class="keywordflow">if</span> (iter-&gt;sequence_nos[i] != 0)
<a name="l00090"></a>00090         <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to &quot;0&quot;.">FALSE</a>;
<a name="l00091"></a>00091       ++i;
<a name="l00092"></a>00092     }
<a name="l00093"></a>00093   <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to &quot;1&quot;.">TRUE</a>;
<a name="l00094"></a>00094 }
<a name="l00095"></a>00095 
<a name="l00096"></a>00096 <span class="keyword">typedef</span> <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a> (* DBusInnerGeneratorFunc)   (DBusMessageDataIter *iter,
<a name="l00097"></a>00097                                                   <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a>        **message_p);
<a name="l00098"></a>00098 <span class="keyword">typedef</span> <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a> (* DBusMessageGeneratorFunc) (DBusMessageDataIter *iter,
<a name="l00099"></a>00099                                                   <a class="code" href="structDBusString.html">DBusString</a>          *data,
<a name="l00100"></a>00100                                                   <a class="code" href="group__DBusMarshal.html#ga0c4521d30d6650a33673a4d7f9cc007c" title="This is primarily used in unit testing, so we can verify that each invalid message is invalid for the...">DBusValidity</a>        *expected_validity);
<a name="l00101"></a>00101 
<a name="l00102"></a>00102 <span class="keyword">static</span> <span class="keywordtype">void</span>
<a name="l00103"></a>00103 set_reply_serial (<a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a> *message)
<a name="l00104"></a>00104 {
<a name="l00105"></a>00105   <span class="keywordflow">if</span> (message == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00106"></a>00106     _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00107"></a>00107   <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#gaec08603ff3d49bbcded67d25188a23f1" title="Sets the reply serial of a message (the serial of the message this is a reply to).">dbus_message_set_reply_serial</a> (message, 100))
<a name="l00108"></a>00108     _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00109"></a>00109 }
<a name="l00110"></a>00110 
<a name="l00111"></a>00111 <span class="keyword">static</span> <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00112"></a>00112 generate_trivial_inner (DBusMessageDataIter *iter,
<a name="l00113"></a>00113                         <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a>        **message_p)
<a name="l00114"></a>00114 {
<a name="l00115"></a>00115   <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a> *message;
<a name="l00116"></a>00116 
<a name="l00117"></a>00117   <span class="keywordflow">switch</span> (iter_get_sequence (iter))
<a name="l00118"></a>00118     {
<a name="l00119"></a>00119     <span class="keywordflow">case</span> 0:
<a name="l00120"></a>00120       message = <a class="code" href="group__DBusMessage.html#ga98ddc82450d818138ef326a284201ee0" title="Constructs a new message to invoke a method on a remote object.">dbus_message_new_method_call</a> (<span class="stringliteral">&quot;org.freedesktop.TextEditor&quot;</span>,
<a name="l00121"></a>00121                                               <span class="stringliteral">&quot;/foo/bar&quot;</span>,
<a name="l00122"></a>00122                                               <span class="stringliteral">&quot;org.freedesktop.DocumentFactory&quot;</span>,
<a name="l00123"></a>00123                                               <span class="stringliteral">&quot;Create&quot;</span>);
<a name="l00124"></a>00124       <span class="keywordflow">break</span>;
<a name="l00125"></a>00125     <span class="keywordflow">case</span> 1:
<a name="l00126"></a>00126       message = <a class="code" href="group__DBusMessage.html#gab9e5bf8d87a95c5ca7026a791148ebd4" title="Constructs a new message of the given message type.">dbus_message_new</a> (<a class="code" href="group__DBusProtocol.html#ga4a9012edd7f22342f845e98150aeb858" title="Message type of a method return message, see dbus_message_get_type()">DBUS_MESSAGE_TYPE_METHOD_RETURN</a>);
<a name="l00127"></a>00127       set_reply_serial (message);
<a name="l00128"></a>00128       <span class="keywordflow">break</span>;
<a name="l00129"></a>00129     <span class="keywordflow">case</span> 2:
<a name="l00130"></a>00130       message = <a class="code" href="group__DBusMessage.html#ga6ce3213dfb17be7956affba40207a5a0" title="Constructs a new message representing a signal emission.">dbus_message_new_signal</a> (<span class="stringliteral">&quot;/foo/bar&quot;</span>,
<a name="l00131"></a>00131                                          <span class="stringliteral">&quot;org.freedesktop.DocumentFactory&quot;</span>,
<a name="l00132"></a>00132                                          <span class="stringliteral">&quot;Created&quot;</span>);
<a name="l00133"></a>00133       <span class="keywordflow">break</span>;
<a name="l00134"></a>00134     <span class="keywordflow">case</span> 3:
<a name="l00135"></a>00135       message = <a class="code" href="group__DBusMessage.html#gab9e5bf8d87a95c5ca7026a791148ebd4" title="Constructs a new message of the given message type.">dbus_message_new</a> (<a class="code" href="group__DBusProtocol.html#ga2b9423d95066313d73eeea8eeaf86812" title="Message type of an error reply message, see dbus_message_get_type()">DBUS_MESSAGE_TYPE_ERROR</a>);
<a name="l00136"></a>00136 
<a name="l00137"></a>00137       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#ga892f9857707371c2a53cec6b54c843c7" title="Sets the name of the error (DBUS_MESSAGE_TYPE_ERROR).">dbus_message_set_error_name</a> (message,
<a name="l00138"></a>00138                                         <span class="stringliteral">&quot;org.freedesktop.TestErrorName&quot;</span>))
<a name="l00139"></a>00139         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00140"></a>00140       
<a name="l00141"></a>00141       {
<a name="l00142"></a>00142         <a class="code" href="structDBusMessageIter.html" title="DBusMessageIter struct; contains no public fields.">DBusMessageIter</a> iter;
<a name="l00143"></a>00143         <span class="keyword">const</span> <span class="keywordtype">char</span> *v_STRING = <span class="stringliteral">&quot;This is an error&quot;</span>;
<a name="l00144"></a>00144         
<a name="l00145"></a>00145         <a class="code" href="group__DBusMessage.html#gaf733047c467ce21f4a53b65a388f1e9d" title="Initializes a DBusMessageIter for appending arguments to the end of a message.">dbus_message_iter_init_append</a> (message, &amp;iter);
<a name="l00146"></a>00146         <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#ga17491f3b75b3203f6fc47dcc2e3b221b" title="Appends a basic-typed value to the message.">dbus_message_iter_append_basic</a> (&amp;iter,
<a name="l00147"></a>00147                                              <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="l00148"></a>00148                                              &amp;v_STRING))
<a name="l00149"></a>00149           _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00150"></a>00150       }
<a name="l00151"></a>00151       
<a name="l00152"></a>00152       set_reply_serial (message);
<a name="l00153"></a>00153       <span class="keywordflow">break</span>;
<a name="l00154"></a>00154     <span class="keywordflow">default</span>:
<a name="l00155"></a>00155       <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to &quot;0&quot;.">FALSE</a>;
<a name="l00156"></a>00156     }
<a name="l00157"></a>00157   
<a name="l00158"></a>00158   <span class="keywordflow">if</span> (message == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00159"></a>00159     _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00160"></a>00160 
<a name="l00161"></a>00161   *message_p = message;
<a name="l00162"></a>00162   
<a name="l00163"></a>00163   <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to &quot;1&quot;.">TRUE</a>;
<a name="l00164"></a>00164 }
<a name="l00165"></a>00165 
<a name="l00166"></a>00166 <span class="keyword">static</span> <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00167"></a>00167 generate_many_bodies_inner (DBusMessageDataIter *iter,
<a name="l00168"></a>00168                             <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a>        **message_p)
<a name="l00169"></a>00169 {
<a name="l00170"></a>00170   <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a> *message;
<a name="l00171"></a>00171   <a class="code" href="structDBusString.html">DBusString</a> signature;
<a name="l00172"></a>00172   <a class="code" href="structDBusString.html">DBusString</a> body;
<a name="l00173"></a>00173   <span class="keywordtype">char</span> byte_order;
<a name="l00174"></a>00174 
<a name="l00175"></a>00175   <span class="comment">/* Keeping this small makes things go faster */</span>
<a name="l00176"></a>00176   message = <a class="code" href="group__DBusMessage.html#ga98ddc82450d818138ef326a284201ee0" title="Constructs a new message to invoke a method on a remote object.">dbus_message_new_method_call</a> (<span class="stringliteral">&quot;o.z.F&quot;</span>,
<a name="l00177"></a>00177                                           <span class="stringliteral">&quot;/&quot;</span>,
<a name="l00178"></a>00178                                           <span class="stringliteral">&quot;o.z.B&quot;</span>,
<a name="l00179"></a>00179                                           <span class="stringliteral">&quot;Nah&quot;</span>);
<a name="l00180"></a>00180   <span class="keywordflow">if</span> (message == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00181"></a>00181     _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00182"></a>00182 
<a name="l00183"></a>00183   byte_order = <a class="code" href="group__DBusMarshal.html#ga65c023673b837c27e8ccda5c2528d806" title="Returns the header&#39;s byte order.">_dbus_header_get_byte_order</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>);
<a name="l00184"></a>00184 
<a name="l00185"></a>00185   set_reply_serial (message);
<a name="l00186"></a>00186 
<a name="l00187"></a>00187   <span class="keywordflow">if</span> (!<a class="code" href="group__DBusString.html#ga348252317f7bb8ac43529972945830ae" title="Initializes a string.">_dbus_string_init</a> (&amp;signature) || !<a class="code" href="group__DBusString.html#ga348252317f7bb8ac43529972945830ae" title="Initializes a string.">_dbus_string_init</a> (&amp;body))
<a name="l00188"></a>00188     _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00189"></a>00189   
<a name="l00190"></a>00190   <span class="keywordflow">if</span> (dbus_internal_do_not_use_generate_bodies (iter_get_sequence (iter),
<a name="l00191"></a>00191                                                 byte_order,
<a name="l00192"></a>00192                                                 &amp;signature, &amp;body))
<a name="l00193"></a>00193     {
<a name="l00194"></a>00194       <span class="keyword">const</span> <span class="keywordtype">char</span> *v_SIGNATURE;
<a name="l00195"></a>00195 
<a name="l00196"></a>00196       v_SIGNATURE = <a class="code" href="group__DBusString.html#ga33e20241ae7d784624f97d89b1a0539e" title="Gets the raw character buffer from a const string.">_dbus_string_get_const_data</a> (&amp;signature);
<a name="l00197"></a>00197       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMarshal.html#ga4349de00b7754a337526e36fda133464" title="Sets the value of a field with basic type.">_dbus_header_set_field_basic</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>,
<a name="l00198"></a>00198                                          <a class="code" href="group__DBusProtocol.html#ga450d63fa110d3cb891082e23291580b4" title="Header field code for the type signature of a message.">DBUS_HEADER_FIELD_SIGNATURE</a>,
<a name="l00199"></a>00199                                          <a class="code" href="group__DBusProtocol.html#ga26ed6c20c3d9f0b50ea0a1cf80be3279" title="Type code marking a D-Bus type signature.">DBUS_TYPE_SIGNATURE</a>,
<a name="l00200"></a>00200                                          &amp;v_SIGNATURE))
<a name="l00201"></a>00201         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00202"></a>00202 
<a name="l00203"></a>00203       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusString.html#gad379fce8d4ef4f7e28f81f50b46ee4c9" title="Moves the end of one string into another string.">_dbus_string_move</a> (&amp;body, 0, &amp;message-&gt;<a class="code" href="structDBusMessage.html#a0b9d14d6e0529f0ec2e3c0087fe62a9e" title="Body network data.">body</a>, 0))
<a name="l00204"></a>00204         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00205"></a>00205 
<a name="l00206"></a>00206       <a class="code" href="group__DBusMarshal.html#ga4bcfb6a664c7e46c7ffc31f96d532a02" title="Sets the 4 bytes at the given offset to a marshaled unsigned integer, replacing anything found there ...">_dbus_marshal_set_uint32</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>.<a class="code" href="structDBusHeader.html#a67df8bff43c10e2d4f6ae36b56ee5814" title="Header network data, stored separately from body so we can independently realloc it.">data</a>, <a class="code" href="group__DBusMarshal.html#ga190a2d89e79c9d76fcba4f06ec8b5b5c" title="Offset to body length from start of header.">BODY_LENGTH_OFFSET</a>,
<a name="l00207"></a>00207                                 <a class="code" href="group__DBusString.html#gaa5136e6fd2c5188f4b88de7863369c6d" title="Gets the length of a string (not including nul termination).">_dbus_string_get_length</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a0b9d14d6e0529f0ec2e3c0087fe62a9e" title="Body network data.">body</a>),
<a name="l00208"></a>00208                                 byte_order);
<a name="l00209"></a>00209       
<a name="l00210"></a>00210       *message_p = message;
<a name="l00211"></a>00211     }
<a name="l00212"></a>00212   <span class="keywordflow">else</span>
<a name="l00213"></a>00213     {
<a name="l00214"></a>00214       <a class="code" href="group__DBusMessage.html#gab69441efe683918f6a82469c8763f464" title="Decrements the reference count of a DBusMessage, freeing the message if the count reaches 0...">dbus_message_unref</a> (message);
<a name="l00215"></a>00215       *message_p = <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00216"></a>00216     }
<a name="l00217"></a>00217   
<a name="l00218"></a>00218   <a class="code" href="group__DBusString.html#ga781ca91acda49a834dce7d0ed0eef212" title="Frees a string created by _dbus_string_init().">_dbus_string_free</a> (&amp;signature);
<a name="l00219"></a>00219   <a class="code" href="group__DBusString.html#ga781ca91acda49a834dce7d0ed0eef212" title="Frees a string created by _dbus_string_init().">_dbus_string_free</a> (&amp;body);
<a name="l00220"></a>00220 
<a name="l00221"></a>00221   <span class="keywordflow">return</span> *message_p != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00222"></a>00222 }
<a name="l00223"></a>00223 
<a name="l00224"></a>00224 <span class="keyword">static</span> <span class="keywordtype">void</span>
<a name="l00225"></a>00225 generate_from_message (<a class="code" href="structDBusString.html">DBusString</a>            *data,
<a name="l00226"></a>00226                        <a class="code" href="group__DBusMarshal.html#ga0c4521d30d6650a33673a4d7f9cc007c" title="This is primarily used in unit testing, so we can verify that each invalid message is invalid for the...">DBusValidity</a>          *expected_validity,
<a name="l00227"></a>00227                        <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a>           *message)
<a name="l00228"></a>00228 {
<a name="l00229"></a>00229   <a class="code" href="group__DBusMessageInternals.html#ga3dd30a62c63eb9972cc0c564f2a89c3b" title="Sets the serial number of a message.">dbus_message_set_serial</a> (message, 1);
<a name="l00230"></a>00230   <a class="code" href="group__DBusMessageInternals.html#ga3ecc9c24381af05289161f477ad6a578" title="Locks a message.">dbus_message_lock</a> (message);
<a name="l00231"></a>00231 
<a name="l00232"></a>00232   *expected_validity = DBUS_VALID;
<a name="l00233"></a>00233   
<a name="l00234"></a>00234   <span class="comment">/* move for efficiency, since we&#39;ll nuke the message anyway */</span>
<a name="l00235"></a>00235   <span class="keywordflow">if</span> (!<a class="code" href="group__DBusString.html#gad379fce8d4ef4f7e28f81f50b46ee4c9" title="Moves the end of one string into another string.">_dbus_string_move</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>.<a class="code" href="structDBusHeader.html#a67df8bff43c10e2d4f6ae36b56ee5814" title="Header network data, stored separately from body so we can independently realloc it.">data</a>, 0,
<a name="l00236"></a>00236                           data, 0))
<a name="l00237"></a>00237     _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00238"></a>00238 
<a name="l00239"></a>00239   <span class="keywordflow">if</span> (!<a class="code" href="group__DBusString.html#ga3c10f0d1bcaa3b450025b9c6a8b901d7" title="Like _dbus_string_move(), but does not delete the section of the source string that&#39;s copied to the d...">_dbus_string_copy</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a0b9d14d6e0529f0ec2e3c0087fe62a9e" title="Body network data.">body</a>, 0,
<a name="l00240"></a>00240                           data, <a class="code" href="group__DBusString.html#gaa5136e6fd2c5188f4b88de7863369c6d" title="Gets the length of a string (not including nul termination).">_dbus_string_get_length</a> (data)))
<a name="l00241"></a>00241     _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00242"></a>00242 }
<a name="l00243"></a>00243 
<a name="l00244"></a>00244 <span class="keyword">static</span> <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00245"></a>00245 generate_outer (DBusMessageDataIter   *iter,
<a name="l00246"></a>00246                 <a class="code" href="structDBusString.html">DBusString</a>            *data,
<a name="l00247"></a>00247                 <a class="code" href="group__DBusMarshal.html#ga0c4521d30d6650a33673a4d7f9cc007c" title="This is primarily used in unit testing, so we can verify that each invalid message is invalid for the...">DBusValidity</a>          *expected_validity,
<a name="l00248"></a>00248                 DBusInnerGeneratorFunc func)
<a name="l00249"></a>00249 {
<a name="l00250"></a>00250   <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a> *message;
<a name="l00251"></a>00251 
<a name="l00252"></a>00252   message = <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00253"></a>00253   <span class="keywordflow">if</span> (!(*func)(iter, &amp;message))
<a name="l00254"></a>00254     <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to &quot;0&quot;.">FALSE</a>;
<a name="l00255"></a>00255 
<a name="l00256"></a>00256   iter_next (iter);
<a name="l00257"></a>00257   
<a name="l00258"></a>00258   _dbus_assert (message != <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00259"></a>00259 
<a name="l00260"></a>00260   generate_from_message (data, expected_validity, message);
<a name="l00261"></a>00261 
<a name="l00262"></a>00262   <a class="code" href="group__DBusMessage.html#gab69441efe683918f6a82469c8763f464" title="Decrements the reference count of a DBusMessage, freeing the message if the count reaches 0...">dbus_message_unref</a> (message);
<a name="l00263"></a>00263 
<a name="l00264"></a>00264   <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to &quot;1&quot;.">TRUE</a>;
<a name="l00265"></a>00265 }
<a name="l00266"></a>00266 
<a name="l00267"></a>00267 <span class="keyword">static</span> <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00268"></a>00268 generate_trivial (DBusMessageDataIter   *iter,
<a name="l00269"></a>00269                   <a class="code" href="structDBusString.html">DBusString</a>            *data,
<a name="l00270"></a>00270                   <a class="code" href="group__DBusMarshal.html#ga0c4521d30d6650a33673a4d7f9cc007c" title="This is primarily used in unit testing, so we can verify that each invalid message is invalid for the...">DBusValidity</a>          *expected_validity)
<a name="l00271"></a>00271 {
<a name="l00272"></a>00272   <span class="keywordflow">return</span> generate_outer (iter, data, expected_validity,
<a name="l00273"></a>00273                          generate_trivial_inner);
<a name="l00274"></a>00274 }
<a name="l00275"></a>00275 
<a name="l00276"></a>00276 <span class="keyword">static</span> <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00277"></a>00277 generate_many_bodies (DBusMessageDataIter   *iter,
<a name="l00278"></a>00278                       <a class="code" href="structDBusString.html">DBusString</a>            *data,
<a name="l00279"></a>00279                       <a class="code" href="group__DBusMarshal.html#ga0c4521d30d6650a33673a4d7f9cc007c" title="This is primarily used in unit testing, so we can verify that each invalid message is invalid for the...">DBusValidity</a>          *expected_validity)
<a name="l00280"></a>00280 {
<a name="l00281"></a>00281   <span class="keywordflow">return</span> generate_outer (iter, data, expected_validity,
<a name="l00282"></a>00282                          generate_many_bodies_inner);
<a name="l00283"></a>00283 }
<a name="l00284"></a>00284 
<a name="l00285"></a>00285 <span class="keyword">static</span> <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a>*
<a name="l00286"></a>00286 simple_method_call (<span class="keywordtype">void</span>)
<a name="l00287"></a>00287 {
<a name="l00288"></a>00288   <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a> *message;
<a name="l00289"></a>00289   <span class="comment">/* Keeping this small makes stuff go faster */</span>
<a name="l00290"></a>00290   message = <a class="code" href="group__DBusMessage.html#ga98ddc82450d818138ef326a284201ee0" title="Constructs a new message to invoke a method on a remote object.">dbus_message_new_method_call</a> (<span class="stringliteral">&quot;o.b.Q&quot;</span>,
<a name="l00291"></a>00291                                           <span class="stringliteral">&quot;/f/b&quot;</span>,
<a name="l00292"></a>00292                                           <span class="stringliteral">&quot;o.b.Z&quot;</span>,
<a name="l00293"></a>00293                                           <span class="stringliteral">&quot;Fro&quot;</span>);
<a name="l00294"></a>00294   <span class="keywordflow">if</span> (message == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00295"></a>00295     _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00296"></a>00296   <span class="keywordflow">return</span> message;
<a name="l00297"></a>00297 }
<a name="l00298"></a>00298 
<a name="l00299"></a>00299 <span class="keyword">static</span> <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a>*
<a name="l00300"></a>00300 simple_signal (<span class="keywordtype">void</span>)
<a name="l00301"></a>00301 {
<a name="l00302"></a>00302   <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a> *message;
<a name="l00303"></a>00303   message = <a class="code" href="group__DBusMessage.html#ga6ce3213dfb17be7956affba40207a5a0" title="Constructs a new message representing a signal emission.">dbus_message_new_signal</a> (<span class="stringliteral">&quot;/f/b&quot;</span>,
<a name="l00304"></a>00304                                      <span class="stringliteral">&quot;o.b.Z&quot;</span>,
<a name="l00305"></a>00305                                      <span class="stringliteral">&quot;Fro&quot;</span>);
<a name="l00306"></a>00306   <span class="keywordflow">if</span> (message == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00307"></a>00307     _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00308"></a>00308   <span class="keywordflow">return</span> message;
<a name="l00309"></a>00309 }
<a name="l00310"></a>00310 
<a name="l00311"></a>00311 <span class="keyword">static</span> <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a>*
<a name="l00312"></a>00312 simple_method_return (<span class="keywordtype">void</span>)
<a name="l00313"></a>00313 {
<a name="l00314"></a>00314   <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a> *message;
<a name="l00315"></a>00315   message =  <a class="code" href="group__DBusMessage.html#gab9e5bf8d87a95c5ca7026a791148ebd4" title="Constructs a new message of the given message type.">dbus_message_new</a> (<a class="code" href="group__DBusProtocol.html#ga4a9012edd7f22342f845e98150aeb858" title="Message type of a method return message, see dbus_message_get_type()">DBUS_MESSAGE_TYPE_METHOD_RETURN</a>);
<a name="l00316"></a>00316   <span class="keywordflow">if</span> (message == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00317"></a>00317     _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00318"></a>00318 
<a name="l00319"></a>00319   set_reply_serial (message);
<a name="l00320"></a>00320   
<a name="l00321"></a>00321   <span class="keywordflow">return</span> message;
<a name="l00322"></a>00322 }
<a name="l00323"></a>00323 
<a name="l00324"></a>00324 <span class="keyword">static</span> <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a>*
<a name="l00325"></a>00325 simple_error (<span class="keywordtype">void</span>)
<a name="l00326"></a>00326 {
<a name="l00327"></a>00327   <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a> *message;
<a name="l00328"></a>00328   message =  <a class="code" href="group__DBusMessage.html#gab9e5bf8d87a95c5ca7026a791148ebd4" title="Constructs a new message of the given message type.">dbus_message_new</a> (<a class="code" href="group__DBusProtocol.html#ga2b9423d95066313d73eeea8eeaf86812" title="Message type of an error reply message, see dbus_message_get_type()">DBUS_MESSAGE_TYPE_ERROR</a>);
<a name="l00329"></a>00329   <span class="keywordflow">if</span> (message == <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>)
<a name="l00330"></a>00330     _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00331"></a>00331 
<a name="l00332"></a>00332   <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#ga892f9857707371c2a53cec6b54c843c7" title="Sets the name of the error (DBUS_MESSAGE_TYPE_ERROR).">dbus_message_set_error_name</a> (message, <span class="stringliteral">&quot;foo.bar&quot;</span>))
<a name="l00333"></a>00333     _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00334"></a>00334   
<a name="l00335"></a>00335   set_reply_serial (message);
<a name="l00336"></a>00336   
<a name="l00337"></a>00337   <span class="keywordflow">return</span> message;
<a name="l00338"></a>00338 }
<a name="l00339"></a>00339 
<a name="l00340"></a>00340 <span class="keyword">static</span> <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a>*
<a name="l00341"></a>00341 message_with_nesting_levels (<span class="keywordtype">int</span> levels)
<a name="l00342"></a>00342 {
<a name="l00343"></a>00343   <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a> *message;
<a name="l00344"></a>00344   <a class="code" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8" title="A 32-bit signed integer on all platforms.">dbus_int32_t</a> v_INT32;
<a name="l00345"></a>00345   <a class="code" href="structDBusMessageIter.html" title="DBusMessageIter struct; contains no public fields.">DBusMessageIter</a> *parents;
<a name="l00346"></a>00346   <a class="code" href="structDBusMessageIter.html" title="DBusMessageIter struct; contains no public fields.">DBusMessageIter</a> *children;
<a name="l00347"></a>00347   <span class="keywordtype">int</span> i;
<a name="l00348"></a>00348 
<a name="l00349"></a>00349   <span class="comment">/* If levels is higher it breaks sig_refcount in DBusMessageRealIter</span>
<a name="l00350"></a>00350 <span class="comment">   * in dbus-message.c, this assert is just to help you know you need</span>
<a name="l00351"></a>00351 <span class="comment">   * to fix that if you hit it</span>
<a name="l00352"></a>00352 <span class="comment">   */</span>
<a name="l00353"></a>00353   _dbus_assert (levels &lt; 256);
<a name="l00354"></a>00354 
<a name="l00355"></a>00355   parents = <a class="code" href="group__DBusMemory.html#ga54ccb556e7964112a825a7f46c156ca0" title="Safe macro for using dbus_malloc().">dbus_new</a>(<a class="code" href="structDBusMessageIter.html" title="DBusMessageIter struct; contains no public fields.">DBusMessageIter</a>, levels + 1);
<a name="l00356"></a>00356   children = <a class="code" href="group__DBusMemory.html#ga54ccb556e7964112a825a7f46c156ca0" title="Safe macro for using dbus_malloc().">dbus_new</a>(<a class="code" href="structDBusMessageIter.html" title="DBusMessageIter struct; contains no public fields.">DBusMessageIter</a>, levels + 1);
<a name="l00357"></a>00357 
<a name="l00358"></a>00358   v_INT32 = 42;
<a name="l00359"></a>00359   message = simple_method_call ();
<a name="l00360"></a>00360 
<a name="l00361"></a>00361   i = 0;
<a name="l00362"></a>00362   <a class="code" href="group__DBusMessage.html#gaf733047c467ce21f4a53b65a388f1e9d" title="Initializes a DBusMessageIter for appending arguments to the end of a message.">dbus_message_iter_init_append</a> (message, &amp;parents[i]);
<a name="l00363"></a>00363   <span class="keywordflow">while</span> (i &lt; levels)
<a name="l00364"></a>00364     {
<a name="l00365"></a>00365       <a class="code" href="group__DBusMessage.html#ga943150f4e87fd8507da224d22c266100" title="Appends a container-typed value to the message; you are required to append the contents of the contai...">dbus_message_iter_open_container</a> (&amp;parents[i], <a class="code" href="group__DBusProtocol.html#ga4aa7a463ad2bce4e9aa95e3e397ddcf1" title="Type code marking a D-Bus variant type.">DBUS_TYPE_VARIANT</a>,
<a name="l00366"></a>00366                                         i == (levels - 1) ?
<a name="l00367"></a>00367                                         <a class="code" href="group__DBusProtocol.html#ga5a7e049ba73ac54c2ffed02c28625b9e" title="DBUS_TYPE_INT32 as a string literal instead of a int literal">DBUS_TYPE_INT32_AS_STRING</a> :
<a name="l00368"></a>00368                                         <a class="code" href="group__DBusProtocol.html#gac5d9893972a0fdcd77eab6534cada8be" title="DBUS_TYPE_VARIANT as a string literal instead of a int literal">DBUS_TYPE_VARIANT_AS_STRING</a>,
<a name="l00369"></a>00369                                         &amp;children[i]);
<a name="l00370"></a>00370       ++i;
<a name="l00371"></a>00371       parents[i] = children[i-1];
<a name="l00372"></a>00372     }
<a name="l00373"></a>00373   --i;
<a name="l00374"></a>00374   <a class="code" href="group__DBusMessage.html#ga17491f3b75b3203f6fc47dcc2e3b221b" title="Appends a basic-typed value to the message.">dbus_message_iter_append_basic</a> (&amp;children[i], <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32);
<a name="l00375"></a>00375   <span class="keywordflow">while</span> (i &gt;= 0)
<a name="l00376"></a>00376     {
<a name="l00377"></a>00377       <a class="code" href="group__DBusMessage.html#gaf00482f63d4af88b7851621d1f24087a" title="Closes a container-typed value appended to the message; may write out more information to the message...">dbus_message_iter_close_container</a> (&amp;parents[i], &amp;children[i]);
<a name="l00378"></a>00378       --i;
<a name="l00379"></a>00379     }
<a name="l00380"></a>00380 
<a name="l00381"></a>00381   <a class="code" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a" title="Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().">dbus_free</a>(parents);
<a name="l00382"></a>00382   <a class="code" href="group__DBusMemory.html#ga34e666b19b015035a9a31e53da84b39a" title="Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().">dbus_free</a>(children);
<a name="l00383"></a>00383 
<a name="l00384"></a>00384   <span class="keywordflow">return</span> message;
<a name="l00385"></a>00385 }
<a name="l00386"></a>00386 
<a name="l00387"></a>00387 <span class="keyword">static</span> <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00388"></a>00388 generate_special (DBusMessageDataIter   *iter,
<a name="l00389"></a>00389                   <a class="code" href="structDBusString.html">DBusString</a>            *data,
<a name="l00390"></a>00390                   <a class="code" href="group__DBusMarshal.html#ga0c4521d30d6650a33673a4d7f9cc007c" title="This is primarily used in unit testing, so we can verify that each invalid message is invalid for the...">DBusValidity</a>          *expected_validity)
<a name="l00391"></a>00391 {
<a name="l00392"></a>00392   <span class="keywordtype">int</span> item_seq;
<a name="l00393"></a>00393   <a class="code" href="structDBusMessage.html" title="Internals of DBusMessage.">DBusMessage</a> *message;
<a name="l00394"></a>00394   <span class="keywordtype">int</span> pos;
<a name="l00395"></a>00395   <a class="code" href="group__DBusTypes.html#gab18afa60e9b17b6e322735bda3d863d8" title="A 32-bit signed integer on all platforms.">dbus_int32_t</a> v_INT32;
<a name="l00396"></a>00396 
<a name="l00397"></a>00397   _dbus_assert (<a class="code" href="group__DBusString.html#gaa5136e6fd2c5188f4b88de7863369c6d" title="Gets the length of a string (not including nul termination).">_dbus_string_get_length</a> (data) == 0);
<a name="l00398"></a>00398   
<a name="l00399"></a>00399   message = <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>;
<a name="l00400"></a>00400   pos = -1;
<a name="l00401"></a>00401   v_INT32 = 42;
<a name="l00402"></a>00402   item_seq = iter_get_sequence (iter);
<a name="l00403"></a>00403 
<a name="l00404"></a>00404   <span class="keywordflow">if</span> (item_seq == 0)
<a name="l00405"></a>00405     {
<a name="l00406"></a>00406       message = simple_method_call ();
<a name="l00407"></a>00407       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#ga591f3aab5dd2c87e56e05423c2a671d9" title="Appends fields to a message given a variable argument list.">dbus_message_append_args</a> (message,
<a name="l00408"></a>00408                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00409"></a>00409                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00410"></a>00410                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00411"></a>00411                                      <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="l00412"></a>00412         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00413"></a>00413                                      
<a name="l00414"></a>00414       <a class="code" href="group__DBusMarshal.html#gaf4661ba8e7067f349ba03c9f5776bbb0" title="Gets the raw marshaled data for a field.">_dbus_header_get_field_raw</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>,
<a name="l00415"></a>00415                                   <a class="code" href="group__DBusProtocol.html#ga450d63fa110d3cb891082e23291580b4" title="Header field code for the type signature of a message.">DBUS_HEADER_FIELD_SIGNATURE</a>,
<a name="l00416"></a>00416                                   <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, &amp;pos);
<a name="l00417"></a>00417       generate_from_message (data, expected_validity, message);
<a name="l00418"></a>00418       
<a name="l00419"></a>00419       <span class="comment">/* set an invalid typecode */</span>
<a name="l00420"></a>00420       <a class="code" href="group__DBusString.html#gab6c823e9406208363fcb5e96d580e738" title="Sets the value of the byte at the given position.">_dbus_string_set_byte</a> (data, pos + 1, <span class="charliteral">&#39;$&#39;</span>);
<a name="l00421"></a>00421 
<a name="l00422"></a>00422       *expected_validity = DBUS_INVALID_UNKNOWN_TYPECODE;
<a name="l00423"></a>00423     }
<a name="l00424"></a>00424   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 1)
<a name="l00425"></a>00425     {
<a name="l00426"></a>00426       <span class="keywordtype">char</span> long_sig[<a class="code" href="group__DBusProtocol.html#gaab86b8c110c95911e1c83ae4422b4018" title="Depth of recursion in the type tree.">DBUS_MAXIMUM_TYPE_RECURSION_DEPTH</a>+2];
<a name="l00427"></a>00427       <span class="keyword">const</span> <span class="keywordtype">char</span> *v_STRING;
<a name="l00428"></a>00428       <span class="keywordtype">int</span> i;
<a name="l00429"></a>00429       
<a name="l00430"></a>00430       message = simple_method_call ();
<a name="l00431"></a>00431       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#ga591f3aab5dd2c87e56e05423c2a671d9" title="Appends fields to a message given a variable argument list.">dbus_message_append_args</a> (message,
<a name="l00432"></a>00432                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00433"></a>00433                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00434"></a>00434                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00435"></a>00435                                      <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="l00436"></a>00436         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00437"></a>00437 
<a name="l00438"></a>00438       i = 0;
<a name="l00439"></a>00439       <span class="keywordflow">while</span> (i &lt; (<a class="code" href="group__DBusProtocol.html#gaab86b8c110c95911e1c83ae4422b4018" title="Depth of recursion in the type tree.">DBUS_MAXIMUM_TYPE_RECURSION_DEPTH</a> + 1))
<a name="l00440"></a>00440         {
<a name="l00441"></a>00441           long_sig[i] = <a class="code" href="group__DBusProtocol.html#ga8912f600f81a773066ca03d9163613a9" title="Type code marking a D-Bus array type.">DBUS_TYPE_ARRAY</a>;
<a name="l00442"></a>00442           ++i;
<a name="l00443"></a>00443         }
<a name="l00444"></a>00444       long_sig[i] = <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="l00445"></a>00445 
<a name="l00446"></a>00446       v_STRING = long_sig;
<a name="l00447"></a>00447       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMarshal.html#ga4349de00b7754a337526e36fda133464" title="Sets the value of a field with basic type.">_dbus_header_set_field_basic</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>,
<a name="l00448"></a>00448                                          <a class="code" href="group__DBusProtocol.html#ga450d63fa110d3cb891082e23291580b4" title="Header field code for the type signature of a message.">DBUS_HEADER_FIELD_SIGNATURE</a>,
<a name="l00449"></a>00449                                          <a class="code" href="group__DBusProtocol.html#ga26ed6c20c3d9f0b50ea0a1cf80be3279" title="Type code marking a D-Bus type signature.">DBUS_TYPE_SIGNATURE</a>,
<a name="l00450"></a>00450                                          &amp;v_STRING))
<a name="l00451"></a>00451         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00452"></a>00452       
<a name="l00453"></a>00453       <a class="code" href="group__DBusMarshal.html#gaf4661ba8e7067f349ba03c9f5776bbb0" title="Gets the raw marshaled data for a field.">_dbus_header_get_field_raw</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>,
<a name="l00454"></a>00454                                   <a class="code" href="group__DBusProtocol.html#ga450d63fa110d3cb891082e23291580b4" title="Header field code for the type signature of a message.">DBUS_HEADER_FIELD_SIGNATURE</a>,
<a name="l00455"></a>00455                                   <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, &amp;pos);
<a name="l00456"></a>00456       generate_from_message (data, expected_validity, message);
<a name="l00457"></a>00457       
<a name="l00458"></a>00458       *expected_validity = DBUS_INVALID_EXCEEDED_MAXIMUM_ARRAY_RECURSION;
<a name="l00459"></a>00459     }
<a name="l00460"></a>00460   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 2)
<a name="l00461"></a>00461     {
<a name="l00462"></a>00462       <span class="keywordtype">char</span> long_sig[<a class="code" href="group__DBusProtocol.html#gaab86b8c110c95911e1c83ae4422b4018" title="Depth of recursion in the type tree.">DBUS_MAXIMUM_TYPE_RECURSION_DEPTH</a>*2+4];
<a name="l00463"></a>00463       <span class="keyword">const</span> <span class="keywordtype">char</span> *v_STRING;
<a name="l00464"></a>00464       <span class="keywordtype">int</span> i;
<a name="l00465"></a>00465       
<a name="l00466"></a>00466       message = simple_method_call ();
<a name="l00467"></a>00467       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#ga591f3aab5dd2c87e56e05423c2a671d9" title="Appends fields to a message given a variable argument list.">dbus_message_append_args</a> (message,
<a name="l00468"></a>00468                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00469"></a>00469                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00470"></a>00470                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00471"></a>00471                                      <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="l00472"></a>00472         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00473"></a>00473 
<a name="l00474"></a>00474       i = 0;
<a name="l00475"></a>00475       <span class="keywordflow">while</span> (i &lt;= (<a class="code" href="group__DBusProtocol.html#gaab86b8c110c95911e1c83ae4422b4018" title="Depth of recursion in the type tree.">DBUS_MAXIMUM_TYPE_RECURSION_DEPTH</a> + 1))
<a name="l00476"></a>00476         {
<a name="l00477"></a>00477           long_sig[i] = <a class="code" href="group__DBusProtocol.html#ga725657eca93175475e0694b858f51fd6" title="Code marking the start of a struct type in a type signature.">DBUS_STRUCT_BEGIN_CHAR</a>;
<a name="l00478"></a>00478           ++i;
<a name="l00479"></a>00479         }
<a name="l00480"></a>00480 
<a name="l00481"></a>00481       long_sig[i] = <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>;
<a name="l00482"></a>00482       ++i;
<a name="l00483"></a>00483 
<a name="l00484"></a>00484       <span class="keywordflow">while</span> (i &lt; (<a class="code" href="group__DBusProtocol.html#gaab86b8c110c95911e1c83ae4422b4018" title="Depth of recursion in the type tree.">DBUS_MAXIMUM_TYPE_RECURSION_DEPTH</a>*2 + 3))
<a name="l00485"></a>00485         {
<a name="l00486"></a>00486           long_sig[i] = <a class="code" href="group__DBusProtocol.html#gaeab5ea0def3f587a0ed548b77d5c5cea" title="Code marking the end of a struct type in a type signature.">DBUS_STRUCT_END_CHAR</a>;
<a name="l00487"></a>00487           ++i;
<a name="l00488"></a>00488         }
<a name="l00489"></a>00489       long_sig[i] = <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="l00490"></a>00490       
<a name="l00491"></a>00491       v_STRING = long_sig;
<a name="l00492"></a>00492       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMarshal.html#ga4349de00b7754a337526e36fda133464" title="Sets the value of a field with basic type.">_dbus_header_set_field_basic</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>,
<a name="l00493"></a>00493                                          <a class="code" href="group__DBusProtocol.html#ga450d63fa110d3cb891082e23291580b4" title="Header field code for the type signature of a message.">DBUS_HEADER_FIELD_SIGNATURE</a>,
<a name="l00494"></a>00494                                          <a class="code" href="group__DBusProtocol.html#ga26ed6c20c3d9f0b50ea0a1cf80be3279" title="Type code marking a D-Bus type signature.">DBUS_TYPE_SIGNATURE</a>,
<a name="l00495"></a>00495                                          &amp;v_STRING))
<a name="l00496"></a>00496         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00497"></a>00497       
<a name="l00498"></a>00498       <a class="code" href="group__DBusMarshal.html#gaf4661ba8e7067f349ba03c9f5776bbb0" title="Gets the raw marshaled data for a field.">_dbus_header_get_field_raw</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>,
<a name="l00499"></a>00499                                   <a class="code" href="group__DBusProtocol.html#ga450d63fa110d3cb891082e23291580b4" title="Header field code for the type signature of a message.">DBUS_HEADER_FIELD_SIGNATURE</a>,
<a name="l00500"></a>00500                                   <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, &amp;pos);
<a name="l00501"></a>00501       generate_from_message (data, expected_validity, message);
<a name="l00502"></a>00502       
<a name="l00503"></a>00503       *expected_validity = DBUS_INVALID_EXCEEDED_MAXIMUM_STRUCT_RECURSION;
<a name="l00504"></a>00504     }
<a name="l00505"></a>00505   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 3)
<a name="l00506"></a>00506     {
<a name="l00507"></a>00507       message = simple_method_call ();
<a name="l00508"></a>00508       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#ga591f3aab5dd2c87e56e05423c2a671d9" title="Appends fields to a message given a variable argument list.">dbus_message_append_args</a> (message,
<a name="l00509"></a>00509                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00510"></a>00510                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00511"></a>00511                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00512"></a>00512                                      <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="l00513"></a>00513         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00514"></a>00514                                      
<a name="l00515"></a>00515       <a class="code" href="group__DBusMarshal.html#gaf4661ba8e7067f349ba03c9f5776bbb0" title="Gets the raw marshaled data for a field.">_dbus_header_get_field_raw</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>,
<a name="l00516"></a>00516                                   <a class="code" href="group__DBusProtocol.html#ga450d63fa110d3cb891082e23291580b4" title="Header field code for the type signature of a message.">DBUS_HEADER_FIELD_SIGNATURE</a>,
<a name="l00517"></a>00517                                   <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, &amp;pos);
<a name="l00518"></a>00518       generate_from_message (data, expected_validity, message);
<a name="l00519"></a>00519       
<a name="l00520"></a>00520       <a class="code" href="group__DBusString.html#gab6c823e9406208363fcb5e96d580e738" title="Sets the value of the byte at the given position.">_dbus_string_set_byte</a> (data, pos + 1, <a class="code" href="group__DBusProtocol.html#ga725657eca93175475e0694b858f51fd6" title="Code marking the start of a struct type in a type signature.">DBUS_STRUCT_BEGIN_CHAR</a>);
<a name="l00521"></a>00521       
<a name="l00522"></a>00522       *expected_validity = DBUS_INVALID_STRUCT_STARTED_BUT_NOT_ENDED;
<a name="l00523"></a>00523     }
<a name="l00524"></a>00524   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 4)
<a name="l00525"></a>00525     {
<a name="l00526"></a>00526       message = simple_method_call ();
<a name="l00527"></a>00527       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#ga591f3aab5dd2c87e56e05423c2a671d9" title="Appends fields to a message given a variable argument list.">dbus_message_append_args</a> (message,
<a name="l00528"></a>00528                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00529"></a>00529                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00530"></a>00530                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00531"></a>00531                                      <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="l00532"></a>00532         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00533"></a>00533                                      
<a name="l00534"></a>00534       <a class="code" href="group__DBusMarshal.html#gaf4661ba8e7067f349ba03c9f5776bbb0" title="Gets the raw marshaled data for a field.">_dbus_header_get_field_raw</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>,
<a name="l00535"></a>00535                                   <a class="code" href="group__DBusProtocol.html#ga450d63fa110d3cb891082e23291580b4" title="Header field code for the type signature of a message.">DBUS_HEADER_FIELD_SIGNATURE</a>,
<a name="l00536"></a>00536                                   <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, &amp;pos);
<a name="l00537"></a>00537       generate_from_message (data, expected_validity, message);
<a name="l00538"></a>00538       
<a name="l00539"></a>00539       <a class="code" href="group__DBusString.html#gab6c823e9406208363fcb5e96d580e738" title="Sets the value of the byte at the given position.">_dbus_string_set_byte</a> (data, pos + 1, <a class="code" href="group__DBusProtocol.html#gaeab5ea0def3f587a0ed548b77d5c5cea" title="Code marking the end of a struct type in a type signature.">DBUS_STRUCT_END_CHAR</a>);
<a name="l00540"></a>00540       
<a name="l00541"></a>00541       *expected_validity = DBUS_INVALID_STRUCT_ENDED_BUT_NOT_STARTED;
<a name="l00542"></a>00542     }
<a name="l00543"></a>00543   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 5)
<a name="l00544"></a>00544     {
<a name="l00545"></a>00545       message = simple_method_call ();
<a name="l00546"></a>00546       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#ga591f3aab5dd2c87e56e05423c2a671d9" title="Appends fields to a message given a variable argument list.">dbus_message_append_args</a> (message,
<a name="l00547"></a>00547                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00548"></a>00548                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00549"></a>00549                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00550"></a>00550                                      <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="l00551"></a>00551         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00552"></a>00552                                      
<a name="l00553"></a>00553       <a class="code" href="group__DBusMarshal.html#gaf4661ba8e7067f349ba03c9f5776bbb0" title="Gets the raw marshaled data for a field.">_dbus_header_get_field_raw</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>,
<a name="l00554"></a>00554                                   <a class="code" href="group__DBusProtocol.html#ga450d63fa110d3cb891082e23291580b4" title="Header field code for the type signature of a message.">DBUS_HEADER_FIELD_SIGNATURE</a>,
<a name="l00555"></a>00555                                   <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, &amp;pos);
<a name="l00556"></a>00556       generate_from_message (data, expected_validity, message);
<a name="l00557"></a>00557       
<a name="l00558"></a>00558       <a class="code" href="group__DBusString.html#gab6c823e9406208363fcb5e96d580e738" title="Sets the value of the byte at the given position.">_dbus_string_set_byte</a> (data, pos + 1, <a class="code" href="group__DBusProtocol.html#ga725657eca93175475e0694b858f51fd6" title="Code marking the start of a struct type in a type signature.">DBUS_STRUCT_BEGIN_CHAR</a>);
<a name="l00559"></a>00559       <a class="code" href="group__DBusString.html#gab6c823e9406208363fcb5e96d580e738" title="Sets the value of the byte at the given position.">_dbus_string_set_byte</a> (data, pos + 2, <a class="code" href="group__DBusProtocol.html#gaeab5ea0def3f587a0ed548b77d5c5cea" title="Code marking the end of a struct type in a type signature.">DBUS_STRUCT_END_CHAR</a>);
<a name="l00560"></a>00560       
<a name="l00561"></a>00561       *expected_validity = DBUS_INVALID_STRUCT_HAS_NO_FIELDS;
<a name="l00562"></a>00562     }
<a name="l00563"></a>00563   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 6)
<a name="l00564"></a>00564     {
<a name="l00565"></a>00565       message = simple_method_call ();
<a name="l00566"></a>00566       generate_from_message (data, expected_validity, message);
<a name="l00567"></a>00567       
<a name="l00568"></a>00568       <a class="code" href="group__DBusString.html#gab6c823e9406208363fcb5e96d580e738" title="Sets the value of the byte at the given position.">_dbus_string_set_byte</a> (data, <a class="code" href="group__DBusMarshal.html#gaf4fe78df75f4afa2ec63304462614b03" title="Offset to type from start of header.">TYPE_OFFSET</a>, <a class="code" href="group__DBusProtocol.html#gac975525a6ce258a7a70c583c9741b516" title="This value is never a valid message type, see dbus_message_get_type()">DBUS_MESSAGE_TYPE_INVALID</a>);
<a name="l00569"></a>00569       
<a name="l00570"></a>00570       *expected_validity = DBUS_INVALID_BAD_MESSAGE_TYPE;
<a name="l00571"></a>00571     }
<a name="l00572"></a>00572   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 7)
<a name="l00573"></a>00573     {
<a name="l00574"></a>00574       <span class="comment">/* Messages of unknown type are considered valid */</span>
<a name="l00575"></a>00575       message = simple_method_call ();
<a name="l00576"></a>00576       generate_from_message (data, expected_validity, message);
<a name="l00577"></a>00577       
<a name="l00578"></a>00578       <a class="code" href="group__DBusString.html#gab6c823e9406208363fcb5e96d580e738" title="Sets the value of the byte at the given position.">_dbus_string_set_byte</a> (data, <a class="code" href="group__DBusMarshal.html#gaf4fe78df75f4afa2ec63304462614b03" title="Offset to type from start of header.">TYPE_OFFSET</a>, 100);
<a name="l00579"></a>00579       
<a name="l00580"></a>00580       *expected_validity = DBUS_VALID;
<a name="l00581"></a>00581     }
<a name="l00582"></a>00582   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 8)
<a name="l00583"></a>00583     {
<a name="l00584"></a>00584       <span class="keywordtype">char</span> byte_order;
<a name="l00585"></a>00585 
<a name="l00586"></a>00586       message = simple_method_call ();
<a name="l00587"></a>00587       byte_order = <a class="code" href="group__DBusMarshal.html#ga65c023673b837c27e8ccda5c2528d806" title="Returns the header&#39;s byte order.">_dbus_header_get_byte_order</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>);
<a name="l00588"></a>00588       generate_from_message (data, expected_validity, message);
<a name="l00589"></a>00589       
<a name="l00590"></a>00590       <a class="code" href="group__DBusMarshal.html#ga4bcfb6a664c7e46c7ffc31f96d532a02" title="Sets the 4 bytes at the given offset to a marshaled unsigned integer, replacing anything found there ...">_dbus_marshal_set_uint32</a> (data, <a class="code" href="group__DBusMarshal.html#ga190a2d89e79c9d76fcba4f06ec8b5b5c" title="Offset to body length from start of header.">BODY_LENGTH_OFFSET</a>,
<a name="l00591"></a>00591                                 <a class="code" href="group__DBusProtocol.html#ga2874c299e1c87fe745ef09bf231264e9" title="The maximum total message size including header and body; similar rationale to max array size...">DBUS_MAXIMUM_MESSAGE_LENGTH</a> / 2 + 4,
<a name="l00592"></a>00592                                 byte_order);
<a name="l00593"></a>00593       <a class="code" href="group__DBusMarshal.html#ga4bcfb6a664c7e46c7ffc31f96d532a02" title="Sets the 4 bytes at the given offset to a marshaled unsigned integer, replacing anything found there ...">_dbus_marshal_set_uint32</a> (data, <a class="code" href="group__DBusMarshal.html#gae9759e0de1d8a650f37632c3dc22427e" title="Offset to fields array length from start of header.">FIELDS_ARRAY_LENGTH_OFFSET</a>,
<a name="l00594"></a>00594                                 <a class="code" href="group__DBusProtocol.html#ga2874c299e1c87fe745ef09bf231264e9" title="The maximum total message size including header and body; similar rationale to max array size...">DBUS_MAXIMUM_MESSAGE_LENGTH</a> / 2 + 4,
<a name="l00595"></a>00595                                 byte_order);
<a name="l00596"></a>00596       *expected_validity = DBUS_INVALID_MESSAGE_TOO_LONG;
<a name="l00597"></a>00597     }
<a name="l00598"></a>00598   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 9)
<a name="l00599"></a>00599     {
<a name="l00600"></a>00600       <span class="keyword">const</span> <span class="keywordtype">char</span> *v_STRING = <span class="stringliteral">&quot;not a valid bus name&quot;</span>;
<a name="l00601"></a>00601       message = simple_method_call ();
<a name="l00602"></a>00602 
<a name="l00603"></a>00603       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMarshal.html#ga4349de00b7754a337526e36fda133464" title="Sets the value of a field with basic type.">_dbus_header_set_field_basic</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>,
<a name="l00604"></a>00604                                          <a class="code" href="group__DBusProtocol.html#ga3ba84ae623951832bd73e2796bb13e71" title="Header field code for the sender of a message; usually initialized by the message bus...">DBUS_HEADER_FIELD_SENDER</a>,
<a name="l00605"></a>00605                                          <a class="code" href="group__DBusProtocol.html#ga7eb77066dadf5415896b44c56d93acce" title="Type code marking a UTF-8 encoded, nul-terminated Unicode string.">DBUS_TYPE_STRING</a>, &amp;v_STRING))
<a name="l00606"></a>00606         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00607"></a>00607       
<a name="l00608"></a>00608       generate_from_message (data, expected_validity, message);
<a name="l00609"></a>00609 
<a name="l00610"></a>00610       *expected_validity = DBUS_INVALID_BAD_SENDER;
<a name="l00611"></a>00611     }
<a name="l00612"></a>00612   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 10)
<a name="l00613"></a>00613     {
<a name="l00614"></a>00614       message = simple_method_call ();
<a name="l00615"></a>00615 
<a name="l00616"></a>00616       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#ga02b754855e4d9a1cade8e4fc17a3f5c7" title="Sets the interface this message is being sent to (for DBUS_MESSAGE_TYPE_METHOD_CALL) or the interface...">dbus_message_set_interface</a> (message, <a class="code" href="group__DBusShared.html#ga9ef6478aae637449ec0c5de1679f75ce" title="This is a special interface whose methods can only be invoked by the local implementation (messages f...">DBUS_INTERFACE_LOCAL</a>))
<a name="l00617"></a>00617         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00618"></a>00618       
<a name="l00619"></a>00619       generate_from_message (data, expected_validity, message);
<a name="l00620"></a>00620 
<a name="l00621"></a>00621       *expected_validity = DBUS_INVALID_USES_LOCAL_INTERFACE;
<a name="l00622"></a>00622     }
<a name="l00623"></a>00623   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 11)
<a name="l00624"></a>00624     {
<a name="l00625"></a>00625       message = simple_method_call ();
<a name="l00626"></a>00626 
<a name="l00627"></a>00627       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#gaaf25da0ba1482266293d329314c21786" title="Sets the object path this message is being sent to (for DBUS_MESSAGE_TYPE_METHOD_CALL) or the one a s...">dbus_message_set_path</a> (message, <a class="code" href="group__DBusShared.html#ga850990a54a46142ee7c5f8174cc932c1" title="The object path used in local/in-process-generated messages.">DBUS_PATH_LOCAL</a>))
<a name="l00628"></a>00628         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00629"></a>00629       
<a name="l00630"></a>00630       generate_from_message (data, expected_validity, message);
<a name="l00631"></a>00631 
<a name="l00632"></a>00632       *expected_validity = DBUS_INVALID_USES_LOCAL_PATH;
<a name="l00633"></a>00633     }
<a name="l00634"></a>00634   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 12)
<a name="l00635"></a>00635     {
<a name="l00636"></a>00636       <span class="comment">/* Method calls don&#39;t have to have interface */</span>
<a name="l00637"></a>00637       message = simple_method_call ();
<a name="l00638"></a>00638 
<a name="l00639"></a>00639       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#ga02b754855e4d9a1cade8e4fc17a3f5c7" title="Sets the interface this message is being sent to (for DBUS_MESSAGE_TYPE_METHOD_CALL) or the interface...">dbus_message_set_interface</a> (message, <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>))
<a name="l00640"></a>00640         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00641"></a>00641       
<a name="l00642"></a>00642       generate_from_message (data, expected_validity, message);
<a name="l00643"></a>00643       
<a name="l00644"></a>00644       *expected_validity = DBUS_VALID;
<a name="l00645"></a>00645     }
<a name="l00646"></a>00646   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 13)
<a name="l00647"></a>00647     {
<a name="l00648"></a>00648       <span class="comment">/* Signals require an interface */</span>
<a name="l00649"></a>00649       message = simple_signal ();
<a name="l00650"></a>00650 
<a name="l00651"></a>00651       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#ga02b754855e4d9a1cade8e4fc17a3f5c7" title="Sets the interface this message is being sent to (for DBUS_MESSAGE_TYPE_METHOD_CALL) or the interface...">dbus_message_set_interface</a> (message, <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>))
<a name="l00652"></a>00652         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00653"></a>00653       
<a name="l00654"></a>00654       generate_from_message (data, expected_validity, message);
<a name="l00655"></a>00655       
<a name="l00656"></a>00656       *expected_validity = DBUS_INVALID_MISSING_INTERFACE;
<a name="l00657"></a>00657     }
<a name="l00658"></a>00658   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 14)
<a name="l00659"></a>00659     {
<a name="l00660"></a>00660       message = simple_method_return ();
<a name="l00661"></a>00661 
<a name="l00662"></a>00662       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMarshal.html#ga7814248f4d74d109d29dc00487cd9b0c" title="Deletes a field, if it exists.">_dbus_header_delete_field</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>, <a class="code" href="group__DBusProtocol.html#ga1067e28a7151a161e5fd601a3b017584" title="Header field code for a reply serial, used to match a DBUS_MESSAGE_TYPE_METHOD_RETURN message with th...">DBUS_HEADER_FIELD_REPLY_SERIAL</a>))
<a name="l00663"></a>00663         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00664"></a>00664       
<a name="l00665"></a>00665       generate_from_message (data, expected_validity, message);
<a name="l00666"></a>00666       
<a name="l00667"></a>00667       *expected_validity = DBUS_INVALID_MISSING_REPLY_SERIAL;
<a name="l00668"></a>00668     }
<a name="l00669"></a>00669   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 15)
<a name="l00670"></a>00670     {
<a name="l00671"></a>00671       message = simple_error ();
<a name="l00672"></a>00672 
<a name="l00673"></a>00673       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#ga892f9857707371c2a53cec6b54c843c7" title="Sets the name of the error (DBUS_MESSAGE_TYPE_ERROR).">dbus_message_set_error_name</a> (message, <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>))
<a name="l00674"></a>00674         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00675"></a>00675       
<a name="l00676"></a>00676       generate_from_message (data, expected_validity, message);
<a name="l00677"></a>00677       
<a name="l00678"></a>00678       *expected_validity = DBUS_INVALID_MISSING_ERROR_NAME;
<a name="l00679"></a>00679     }
<a name="l00680"></a>00680   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 16)
<a name="l00681"></a>00681     {
<a name="l00682"></a>00682       <span class="keywordtype">char</span> long_sig[<a class="code" href="group__DBusProtocol.html#gaab86b8c110c95911e1c83ae4422b4018" title="Depth of recursion in the type tree.">DBUS_MAXIMUM_TYPE_RECURSION_DEPTH</a>*4+10];
<a name="l00683"></a>00683       <span class="keyword">const</span> <span class="keywordtype">char</span> *v_STRING;
<a name="l00684"></a>00684       <span class="keywordtype">int</span> i;
<a name="l00685"></a>00685       <span class="keywordtype">int</span> n_begins;
<a name="l00686"></a>00686       
<a name="l00687"></a>00687       message = simple_method_call ();
<a name="l00688"></a>00688       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#ga591f3aab5dd2c87e56e05423c2a671d9" title="Appends fields to a message given a variable argument list.">dbus_message_append_args</a> (message,
<a name="l00689"></a>00689                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00690"></a>00690                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00691"></a>00691                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00692"></a>00692                                      <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="l00693"></a>00693         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00694"></a>00694 
<a name="l00695"></a>00695       i = 0;
<a name="l00696"></a>00696       <span class="keywordflow">while</span> (i &lt;= (<a class="code" href="group__DBusProtocol.html#gaab86b8c110c95911e1c83ae4422b4018" title="Depth of recursion in the type tree.">DBUS_MAXIMUM_TYPE_RECURSION_DEPTH</a>*3 + 3))
<a name="l00697"></a>00697         {
<a name="l00698"></a>00698           long_sig[i] = <a class="code" href="group__DBusProtocol.html#ga8912f600f81a773066ca03d9163613a9" title="Type code marking a D-Bus array type.">DBUS_TYPE_ARRAY</a>;
<a name="l00699"></a>00699           ++i;
<a name="l00700"></a>00700           long_sig[i] = <a class="code" href="group__DBusProtocol.html#gad51b5f7a2e6d927295479dd371f6b353" title="Code marking the start of a dict entry type in a type signature.">DBUS_DICT_ENTRY_BEGIN_CHAR</a>;
<a name="l00701"></a>00701           ++i;
<a name="l00702"></a>00702           long_sig[i] = <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>;
<a name="l00703"></a>00703           ++i;
<a name="l00704"></a>00704         }
<a name="l00705"></a>00705       n_begins = i / 3;
<a name="l00706"></a>00706 
<a name="l00707"></a>00707       long_sig[i] = <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>;
<a name="l00708"></a>00708       ++i;
<a name="l00709"></a>00709       
<a name="l00710"></a>00710       <span class="keywordflow">while</span> (n_begins &gt; 0)
<a name="l00711"></a>00711         {
<a name="l00712"></a>00712           long_sig[i] = <a class="code" href="group__DBusProtocol.html#ga29ad22c7342ead042ae9e55ae20b49f1" title="Code marking the end of a dict entry type in a type signature.">DBUS_DICT_ENTRY_END_CHAR</a>;
<a name="l00713"></a>00713           ++i;
<a name="l00714"></a>00714           n_begins -= 1;
<a name="l00715"></a>00715         }
<a name="l00716"></a>00716       long_sig[i] = <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="l00717"></a>00717       
<a name="l00718"></a>00718       v_STRING = long_sig;
<a name="l00719"></a>00719       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMarshal.html#ga4349de00b7754a337526e36fda133464" title="Sets the value of a field with basic type.">_dbus_header_set_field_basic</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>,
<a name="l00720"></a>00720                                          <a class="code" href="group__DBusProtocol.html#ga450d63fa110d3cb891082e23291580b4" title="Header field code for the type signature of a message.">DBUS_HEADER_FIELD_SIGNATURE</a>,
<a name="l00721"></a>00721                                          <a class="code" href="group__DBusProtocol.html#ga26ed6c20c3d9f0b50ea0a1cf80be3279" title="Type code marking a D-Bus type signature.">DBUS_TYPE_SIGNATURE</a>,
<a name="l00722"></a>00722                                          &amp;v_STRING))
<a name="l00723"></a>00723         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00724"></a>00724       
<a name="l00725"></a>00725       <a class="code" href="group__DBusMarshal.html#gaf4661ba8e7067f349ba03c9f5776bbb0" title="Gets the raw marshaled data for a field.">_dbus_header_get_field_raw</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>,
<a name="l00726"></a>00726                                   <a class="code" href="group__DBusProtocol.html#ga450d63fa110d3cb891082e23291580b4" title="Header field code for the type signature of a message.">DBUS_HEADER_FIELD_SIGNATURE</a>,
<a name="l00727"></a>00727                                   <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, &amp;pos);
<a name="l00728"></a>00728       generate_from_message (data, expected_validity, message);
<a name="l00729"></a>00729       
<a name="l00730"></a>00730       *expected_validity = DBUS_INVALID_EXCEEDED_MAXIMUM_DICT_ENTRY_RECURSION;
<a name="l00731"></a>00731     }
<a name="l00732"></a>00732   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 17)
<a name="l00733"></a>00733     {
<a name="l00734"></a>00734       message = simple_method_call ();
<a name="l00735"></a>00735       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#ga591f3aab5dd2c87e56e05423c2a671d9" title="Appends fields to a message given a variable argument list.">dbus_message_append_args</a> (message,
<a name="l00736"></a>00736                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00737"></a>00737                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00738"></a>00738                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00739"></a>00739                                      <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="l00740"></a>00740         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00741"></a>00741                                      
<a name="l00742"></a>00742       <a class="code" href="group__DBusMarshal.html#gaf4661ba8e7067f349ba03c9f5776bbb0" title="Gets the raw marshaled data for a field.">_dbus_header_get_field_raw</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>,
<a name="l00743"></a>00743                                   <a class="code" href="group__DBusProtocol.html#ga450d63fa110d3cb891082e23291580b4" title="Header field code for the type signature of a message.">DBUS_HEADER_FIELD_SIGNATURE</a>,
<a name="l00744"></a>00744                                   <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, &amp;pos);
<a name="l00745"></a>00745       generate_from_message (data, expected_validity, message);
<a name="l00746"></a>00746 
<a name="l00747"></a>00747       <a class="code" href="group__DBusString.html#gab6c823e9406208363fcb5e96d580e738" title="Sets the value of the byte at the given position.">_dbus_string_set_byte</a> (data, pos + 1, <a class="code" href="group__DBusProtocol.html#ga8912f600f81a773066ca03d9163613a9" title="Type code marking a D-Bus array type.">DBUS_TYPE_ARRAY</a>);
<a name="l00748"></a>00748       <a class="code" href="group__DBusString.html#gab6c823e9406208363fcb5e96d580e738" title="Sets the value of the byte at the given position.">_dbus_string_set_byte</a> (data, pos + 2, <a class="code" href="group__DBusProtocol.html#gad51b5f7a2e6d927295479dd371f6b353" title="Code marking the start of a dict entry type in a type signature.">DBUS_DICT_ENTRY_BEGIN_CHAR</a>);
<a name="l00749"></a>00749       
<a name="l00750"></a>00750       *expected_validity = DBUS_INVALID_DICT_ENTRY_STARTED_BUT_NOT_ENDED;
<a name="l00751"></a>00751     }
<a name="l00752"></a>00752   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 18)
<a name="l00753"></a>00753     {
<a name="l00754"></a>00754       message = simple_method_call ();
<a name="l00755"></a>00755       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#ga591f3aab5dd2c87e56e05423c2a671d9" title="Appends fields to a message given a variable argument list.">dbus_message_append_args</a> (message,
<a name="l00756"></a>00756                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00757"></a>00757                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00758"></a>00758                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00759"></a>00759                                      <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="l00760"></a>00760         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00761"></a>00761                                      
<a name="l00762"></a>00762       <a class="code" href="group__DBusMarshal.html#gaf4661ba8e7067f349ba03c9f5776bbb0" title="Gets the raw marshaled data for a field.">_dbus_header_get_field_raw</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>,
<a name="l00763"></a>00763                                   <a class="code" href="group__DBusProtocol.html#ga450d63fa110d3cb891082e23291580b4" title="Header field code for the type signature of a message.">DBUS_HEADER_FIELD_SIGNATURE</a>,
<a name="l00764"></a>00764                                   <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, &amp;pos);
<a name="l00765"></a>00765       generate_from_message (data, expected_validity, message);
<a name="l00766"></a>00766       
<a name="l00767"></a>00767       <a class="code" href="group__DBusString.html#gab6c823e9406208363fcb5e96d580e738" title="Sets the value of the byte at the given position.">_dbus_string_set_byte</a> (data, pos + 1, <a class="code" href="group__DBusProtocol.html#ga29ad22c7342ead042ae9e55ae20b49f1" title="Code marking the end of a dict entry type in a type signature.">DBUS_DICT_ENTRY_END_CHAR</a>);
<a name="l00768"></a>00768       
<a name="l00769"></a>00769       *expected_validity = DBUS_INVALID_DICT_ENTRY_ENDED_BUT_NOT_STARTED;
<a name="l00770"></a>00770     }
<a name="l00771"></a>00771   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 19)
<a name="l00772"></a>00772     {
<a name="l00773"></a>00773       message = simple_method_call ();
<a name="l00774"></a>00774       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusMessage.html#ga591f3aab5dd2c87e56e05423c2a671d9" title="Appends fields to a message given a variable argument list.">dbus_message_append_args</a> (message,
<a name="l00775"></a>00775                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00776"></a>00776                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00777"></a>00777                                      <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>, &amp;v_INT32,
<a name="l00778"></a>00778                                      <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="l00779"></a>00779         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00780"></a>00780                                      
<a name="l00781"></a>00781       <a class="code" href="group__DBusMarshal.html#gaf4661ba8e7067f349ba03c9f5776bbb0" title="Gets the raw marshaled data for a field.">_dbus_header_get_field_raw</a> (&amp;message-&gt;<a class="code" href="structDBusMessage.html#a00cf6910d9f3bee5d5a82137c8c64a42" title="Header network data and associated cache.">header</a>,
<a name="l00782"></a>00782                                   <a class="code" href="group__DBusProtocol.html#ga450d63fa110d3cb891082e23291580b4" title="Header field code for the type signature of a message.">DBUS_HEADER_FIELD_SIGNATURE</a>,
<a name="l00783"></a>00783                                   <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>, &amp;pos);
<a name="l00784"></a>00784       generate_from_message (data, expected_validity, message);
<a name="l00785"></a>00785 
<a name="l00786"></a>00786       <a class="code" href="group__DBusString.html#gab6c823e9406208363fcb5e96d580e738" title="Sets the value of the byte at the given position.">_dbus_string_set_byte</a> (data, pos + 1, <a class="code" href="group__DBusProtocol.html#ga8912f600f81a773066ca03d9163613a9" title="Type code marking a D-Bus array type.">DBUS_TYPE_ARRAY</a>);
<a name="l00787"></a>00787       <a class="code" href="group__DBusString.html#gab6c823e9406208363fcb5e96d580e738" title="Sets the value of the byte at the given position.">_dbus_string_set_byte</a> (data, pos + 2, <a class="code" href="group__DBusProtocol.html#gad51b5f7a2e6d927295479dd371f6b353" title="Code marking the start of a dict entry type in a type signature.">DBUS_DICT_ENTRY_BEGIN_CHAR</a>);
<a name="l00788"></a>00788       <a class="code" href="group__DBusString.html#gab6c823e9406208363fcb5e96d580e738" title="Sets the value of the byte at the given position.">_dbus_string_set_byte</a> (data, pos + 3, <a class="code" href="group__DBusProtocol.html#ga29ad22c7342ead042ae9e55ae20b49f1" title="Code marking the end of a dict entry type in a type signature.">DBUS_DICT_ENTRY_END_CHAR</a>);
<a name="l00789"></a>00789       
<a name="l00790"></a>00790       *expected_validity = DBUS_INVALID_DICT_ENTRY_HAS_NO_FIELDS;
<a name="l00791"></a>00791     }
<a name="l00792"></a>00792   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 20)
<a name="l00793"></a>00793     {
<a name="l00794"></a>00794       <span class="comment">/* 64 levels of nesting is OK */</span>
<a name="l00795"></a>00795       message = message_with_nesting_levels(64);
<a name="l00796"></a>00796 
<a name="l00797"></a>00797       generate_from_message (data, expected_validity, message);
<a name="l00798"></a>00798 
<a name="l00799"></a>00799       *expected_validity = DBUS_VALID;
<a name="l00800"></a>00800     }
<a name="l00801"></a>00801   <span class="keywordflow">else</span> <span class="keywordflow">if</span> (item_seq == 21)
<a name="l00802"></a>00802     {
<a name="l00803"></a>00803       <span class="comment">/* 65 levels of nesting is not OK */</span>
<a name="l00804"></a>00804       message = message_with_nesting_levels(65);
<a name="l00805"></a>00805 
<a name="l00806"></a>00806       generate_from_message (data, expected_validity, message);
<a name="l00807"></a>00807 
<a name="l00808"></a>00808       *expected_validity = DBUS_INVALID_NESTED_TOO_DEEPLY;
<a name="l00809"></a>00809     }
<a name="l00810"></a>00810   <span class="keywordflow">else</span>
<a name="l00811"></a>00811     {
<a name="l00812"></a>00812       <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to &quot;0&quot;.">FALSE</a>;
<a name="l00813"></a>00813     }
<a name="l00814"></a>00814 
<a name="l00815"></a>00815   <span class="keywordflow">if</span> (message)
<a name="l00816"></a>00816     <a class="code" href="group__DBusMessage.html#gab69441efe683918f6a82469c8763f464" title="Decrements the reference count of a DBusMessage, freeing the message if the count reaches 0...">dbus_message_unref</a> (message);
<a name="l00817"></a>00817 
<a name="l00818"></a>00818   iter_next (iter);
<a name="l00819"></a>00819   <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to &quot;1&quot;.">TRUE</a>;
<a name="l00820"></a>00820 }
<a name="l00821"></a>00821 
<a name="l00822"></a>00822 <span class="keyword">static</span> <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00823"></a>00823 generate_wrong_length (DBusMessageDataIter *iter,
<a name="l00824"></a>00824                        <a class="code" href="structDBusString.html">DBusString</a>          *data,
<a name="l00825"></a>00825                        <a class="code" href="group__DBusMarshal.html#ga0c4521d30d6650a33673a4d7f9cc007c" title="This is primarily used in unit testing, so we can verify that each invalid message is invalid for the...">DBusValidity</a>        *expected_validity)
<a name="l00826"></a>00826 {
<a name="l00827"></a>00827   <span class="keywordtype">int</span> lengths[] = { -42, -17, -16, -15, -9, -8, -7, -6, -5, -4, -3, -2, -1,
<a name="l00828"></a>00828                     1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 16, 30 };
<a name="l00829"></a>00829   <span class="keywordtype">int</span> adjust;
<a name="l00830"></a>00830   <span class="keywordtype">int</span> len_seq;
<a name="l00831"></a>00831 
<a name="l00832"></a>00832  restart:
<a name="l00833"></a>00833   len_seq = iter_get_sequence (iter);
<a name="l00834"></a>00834   <span class="keywordflow">if</span> (len_seq == _DBUS_N_ELEMENTS (lengths))
<a name="l00835"></a>00835     <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to &quot;0&quot;.">FALSE</a>;
<a name="l00836"></a>00836 
<a name="l00837"></a>00837   _dbus_assert (len_seq &lt; _DBUS_N_ELEMENTS (lengths));
<a name="l00838"></a>00838   
<a name="l00839"></a>00839   iter_recurse (iter);
<a name="l00840"></a>00840   <span class="keywordflow">if</span> (!generate_many_bodies (iter, data, expected_validity))
<a name="l00841"></a>00841     {
<a name="l00842"></a>00842       iter_set_sequence (iter, 0); <span class="comment">/* reset to first body */</span>
<a name="l00843"></a>00843       iter_unrecurse (iter);
<a name="l00844"></a>00844       iter_next (iter);            <span class="comment">/* next length adjustment */</span>
<a name="l00845"></a>00845       <span class="keywordflow">goto</span> restart;
<a name="l00846"></a>00846     }
<a name="l00847"></a>00847   iter_unrecurse (iter);
<a name="l00848"></a>00848 
<a name="l00849"></a>00849   adjust = lengths[len_seq];
<a name="l00850"></a>00850 
<a name="l00851"></a>00851   <span class="keywordflow">if</span> (adjust &lt; 0)
<a name="l00852"></a>00852     {
<a name="l00853"></a>00853       <span class="keywordflow">if</span> ((<a class="code" href="group__DBusString.html#gaa5136e6fd2c5188f4b88de7863369c6d" title="Gets the length of a string (not including nul termination).">_dbus_string_get_length</a> (data) + adjust) &lt; <a class="code" href="group__DBusProtocol.html#gaf8c13dd883c21b5dea179d77d8ac12e3" title="The smallest header size that can occur.">DBUS_MINIMUM_HEADER_SIZE</a>)
<a name="l00854"></a>00854         <a class="code" href="group__DBusString.html#ga08c423b93c28dd746dcb93e0461ab95c" title="Sets the length of a string.">_dbus_string_set_length</a> (data, <a class="code" href="group__DBusProtocol.html#gaf8c13dd883c21b5dea179d77d8ac12e3" title="The smallest header size that can occur.">DBUS_MINIMUM_HEADER_SIZE</a>);
<a name="l00855"></a>00855       <span class="keywordflow">else</span>
<a name="l00856"></a>00856         <a class="code" href="group__DBusString.html#ga7af1cbfa905f26d972ab644d890548b8" title="Makes a string shorter by the given number of bytes.">_dbus_string_shorten</a> (data, - adjust);
<a name="l00857"></a>00857       *expected_validity = DBUS_INVALID_FOR_UNKNOWN_REASON;
<a name="l00858"></a>00858     }
<a name="l00859"></a>00859   <span class="keywordflow">else</span>
<a name="l00860"></a>00860     {      
<a name="l00861"></a>00861       <span class="keywordflow">if</span> (!<a class="code" href="group__DBusString.html#ga8f13997d90ceed2f437706e6b7804d9b" title="Makes a string longer by the given number of bytes.">_dbus_string_lengthen</a> (data, adjust))
<a name="l00862"></a>00862         _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l00863"></a>00863       *expected_validity = DBUS_INVALID_TOO_MUCH_DATA;
<a name="l00864"></a>00864     }
<a name="l00865"></a>00865 
<a name="l00866"></a>00866   <span class="comment">/* Fixup lengths */</span>
<a name="l00867"></a>00867   {
<a name="l00868"></a>00868     <span class="keywordtype">int</span> old_body_len;
<a name="l00869"></a>00869     <span class="keywordtype">int</span> new_body_len;
<a name="l00870"></a>00870     <span class="keywordtype">int</span> byte_order;
<a name="l00871"></a>00871     
<a name="l00872"></a>00872     _dbus_assert (<a class="code" href="group__DBusString.html#gaa5136e6fd2c5188f4b88de7863369c6d" title="Gets the length of a string (not including nul termination).">_dbus_string_get_length</a> (data) &gt;= <a class="code" href="group__DBusProtocol.html#gaf8c13dd883c21b5dea179d77d8ac12e3" title="The smallest header size that can occur.">DBUS_MINIMUM_HEADER_SIZE</a>);
<a name="l00873"></a>00873     
<a name="l00874"></a>00874     byte_order = <a class="code" href="group__DBusString.html#gac1cb7b207eac3c6527a5d42fbc5449b1" title="Gets the byte at the given position.">_dbus_string_get_byte</a> (data, <a class="code" href="group__DBusMarshal.html#gaa5b7e77f37761139698892e4b8aad029" title="Offset to byte order from start of header.">BYTE_ORDER_OFFSET</a>);
<a name="l00875"></a>00875     old_body_len = <a class="code" href="group__DBusMarshal.html#ga6dd82a202c19758cbf76dbed2946615d" title="Convenience function to demarshal a 32 bit unsigned integer.">_dbus_marshal_read_uint32</a> (data,
<a name="l00876"></a>00876                                               <a class="code" href="group__DBusMarshal.html#ga190a2d89e79c9d76fcba4f06ec8b5b5c" title="Offset to body length from start of header.">BODY_LENGTH_OFFSET</a>,
<a name="l00877"></a>00877                                               byte_order,
<a name="l00878"></a>00878                                               <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l00879"></a>00879     _dbus_assert (old_body_len &lt; <a class="code" href="group__DBusString.html#gaa5136e6fd2c5188f4b88de7863369c6d" title="Gets the length of a string (not including nul termination).">_dbus_string_get_length</a> (data));
<a name="l00880"></a>00880     new_body_len = old_body_len + adjust;
<a name="l00881"></a>00881     <span class="keywordflow">if</span> (new_body_len &lt; 0)
<a name="l00882"></a>00882       {
<a name="l00883"></a>00883         new_body_len = 0;
<a name="l00884"></a>00884         <span class="comment">/* we just munged the header, and aren&#39;t sure how */</span>
<a name="l00885"></a>00885         *expected_validity = DBUS_VALIDITY_UNKNOWN;
<a name="l00886"></a>00886       }
<a name="l00887"></a>00887 
<a name="l00888"></a>00888     _dbus_verbose (<span class="stringliteral">&quot;changing body len from %u to %u by adjust %d\n&quot;</span>,
<a name="l00889"></a>00889                    old_body_len, new_body_len, adjust);
<a name="l00890"></a>00890     
<a name="l00891"></a>00891     <a class="code" href="group__DBusMarshal.html#ga4bcfb6a664c7e46c7ffc31f96d532a02" title="Sets the 4 bytes at the given offset to a marshaled unsigned integer, replacing anything found there ...">_dbus_marshal_set_uint32</a> (data, <a class="code" href="group__DBusMarshal.html#ga190a2d89e79c9d76fcba4f06ec8b5b5c" title="Offset to body length from start of header.">BODY_LENGTH_OFFSET</a>,
<a name="l00892"></a>00892                               new_body_len,
<a name="l00893"></a>00893                               byte_order);
<a name="l00894"></a>00894   }
<a name="l00895"></a>00895 
<a name="l00896"></a>00896   <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to &quot;1&quot;.">TRUE</a>;
<a name="l00897"></a>00897 }
<a name="l00898"></a>00898 
<a name="l00899"></a>00899 <span class="keyword">static</span> <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00900"></a>00900 generate_byte_changed (DBusMessageDataIter *iter,
<a name="l00901"></a>00901                        <a class="code" href="structDBusString.html">DBusString</a>          *data,
<a name="l00902"></a>00902                        <a class="code" href="group__DBusMarshal.html#ga0c4521d30d6650a33673a4d7f9cc007c" title="This is primarily used in unit testing, so we can verify that each invalid message is invalid for the...">DBusValidity</a>        *expected_validity)
<a name="l00903"></a>00903 {
<a name="l00904"></a>00904   <span class="keywordtype">int</span> byte_seq;
<a name="l00905"></a>00905   <span class="keywordtype">int</span> v_BYTE;
<a name="l00906"></a>00906 
<a name="l00907"></a>00907   <span class="comment">/* This is a little convoluted to make the bodies the</span>
<a name="l00908"></a>00908 <span class="comment">   * outer loop and each byte of each body the inner</span>
<a name="l00909"></a>00909 <span class="comment">   * loop</span>
<a name="l00910"></a>00910 <span class="comment">   */</span>
<a name="l00911"></a>00911 
<a name="l00912"></a>00912  restart:
<a name="l00913"></a>00913   <span class="keywordflow">if</span> (!generate_many_bodies (iter, data, expected_validity))
<a name="l00914"></a>00914     <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to &quot;0&quot;.">FALSE</a>;
<a name="l00915"></a>00915 
<a name="l00916"></a>00916   iter_recurse (iter);
<a name="l00917"></a>00917   byte_seq = iter_get_sequence (iter);
<a name="l00918"></a>00918   iter_next (iter);
<a name="l00919"></a>00919   iter_unrecurse (iter);
<a name="l00920"></a>00920   
<a name="l00921"></a>00921   <span class="keywordflow">if</span> (byte_seq == <a class="code" href="group__DBusString.html#gaa5136e6fd2c5188f4b88de7863369c6d" title="Gets the length of a string (not including nul termination).">_dbus_string_get_length</a> (data))
<a name="l00922"></a>00922     {
<a name="l00923"></a>00923       <a class="code" href="group__DBusString.html#ga08c423b93c28dd746dcb93e0461ab95c" title="Sets the length of a string.">_dbus_string_set_length</a> (data, 0);
<a name="l00924"></a>00924       <span class="comment">/* reset byte count */</span>
<a name="l00925"></a>00925       iter_recurse (iter);
<a name="l00926"></a>00926       iter_set_sequence (iter, 0);
<a name="l00927"></a>00927       iter_unrecurse (iter);
<a name="l00928"></a>00928       <span class="keywordflow">goto</span> restart;
<a name="l00929"></a>00929     }
<a name="l00930"></a>00930   <span class="keywordflow">else</span>
<a name="l00931"></a>00931     {
<a name="l00932"></a>00932       <span class="comment">/* Undo the &quot;next&quot; in generate_many_bodies */</span>
<a name="l00933"></a>00933       iter_set_sequence (iter, iter_get_sequence (iter) - 1);
<a name="l00934"></a>00934     }
<a name="l00935"></a>00935 
<a name="l00936"></a>00936   _dbus_assert (byte_seq &lt; <a class="code" href="group__DBusString.html#gaa5136e6fd2c5188f4b88de7863369c6d" title="Gets the length of a string (not including nul termination).">_dbus_string_get_length</a> (data));
<a name="l00937"></a>00937   v_BYTE = <a class="code" href="group__DBusString.html#gac1cb7b207eac3c6527a5d42fbc5449b1" title="Gets the byte at the given position.">_dbus_string_get_byte</a> (data, byte_seq);
<a name="l00938"></a>00938   v_BYTE += byte_seq; <span class="comment">/* arbitrary but deterministic change to the byte */</span>
<a name="l00939"></a>00939   <a class="code" href="group__DBusString.html#gab6c823e9406208363fcb5e96d580e738" title="Sets the value of the byte at the given position.">_dbus_string_set_byte</a> (data, byte_seq, v_BYTE);
<a name="l00940"></a>00940   *expected_validity = DBUS_VALIDITY_UNKNOWN;
<a name="l00941"></a>00941 
<a name="l00942"></a>00942   <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to &quot;1&quot;.">TRUE</a>;
<a name="l00943"></a>00943 }
<a name="l00944"></a>00944 
<a name="l00945"></a>00945 <span class="preprocessor">#if 0</span>
<a name="l00946"></a>00946 <span class="preprocessor"></span><span class="comment">/* This is really expensive and doesn&#39;t add too much coverage */</span>
<a name="l00947"></a>00947 
<a name="l00948"></a>00948 <span class="keyword">static</span> <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l00949"></a>00949 find_next_typecode (DBusMessageDataIter *iter,
<a name="l00950"></a>00950                     <a class="code" href="structDBusString.html">DBusString</a>          *data,
<a name="l00951"></a>00951                     <a class="code" href="group__DBusMarshal.html#ga0c4521d30d6650a33673a4d7f9cc007c" title="This is primarily used in unit testing, so we can verify that each invalid message is invalid for the...">DBusValidity</a>        *expected_validity)
<a name="l00952"></a>00952 {
<a name="l00953"></a>00953   <span class="keywordtype">int</span> body_seq;
<a name="l00954"></a>00954   <span class="keywordtype">int</span> byte_seq;
<a name="l00955"></a>00955   <span class="keywordtype">int</span> base_depth;
<a name="l00956"></a>00956 
<a name="l00957"></a>00957   base_depth = iter-&gt;depth;
<a name="l00958"></a>00958 
<a name="l00959"></a>00959  restart:
<a name="l00960"></a>00960   _dbus_assert (iter-&gt;depth == (base_depth + 0));
<a name="l00961"></a>00961   <a class="code" href="group__DBusString.html#ga08c423b93c28dd746dcb93e0461ab95c" title="Sets the length of a string.">_dbus_string_set_length</a> (data, 0);
<a name="l00962"></a>00962 
<a name="l00963"></a>00963   body_seq = iter_get_sequence (iter);
<a name="l00964"></a>00964   
<a name="l00965"></a>00965   <span class="keywordflow">if</span> (!generate_many_bodies (iter, data, expected_validity))
<a name="l00966"></a>00966     <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to &quot;0&quot;.">FALSE</a>;
<a name="l00967"></a>00967   <span class="comment">/* Undo the &quot;next&quot; in generate_many_bodies */</span>
<a name="l00968"></a>00968   iter_set_sequence (iter, body_seq);
<a name="l00969"></a>00969   
<a name="l00970"></a>00970   iter_recurse (iter);
<a name="l00971"></a>00971   <span class="keywordflow">while</span> (<a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to &quot;1&quot;.">TRUE</a>)
<a name="l00972"></a>00972     {
<a name="l00973"></a>00973       _dbus_assert (iter-&gt;depth == (base_depth + 1));
<a name="l00974"></a>00974       
<a name="l00975"></a>00975       byte_seq = iter_get_sequence (iter);
<a name="l00976"></a>00976 
<a name="l00977"></a>00977       _dbus_assert (byte_seq &lt;= <a class="code" href="group__DBusString.html#gaa5136e6fd2c5188f4b88de7863369c6d" title="Gets the length of a string (not including nul termination).">_dbus_string_get_length</a> (data));
<a name="l00978"></a>00978       
<a name="l00979"></a>00979       <span class="keywordflow">if</span> (byte_seq == <a class="code" href="group__DBusString.html#gaa5136e6fd2c5188f4b88de7863369c6d" title="Gets the length of a string (not including nul termination).">_dbus_string_get_length</a> (data))
<a name="l00980"></a>00980         {
<a name="l00981"></a>00981           <span class="comment">/* reset byte count */</span>
<a name="l00982"></a>00982           iter_set_sequence (iter, 0);
<a name="l00983"></a>00983           iter_unrecurse (iter);
<a name="l00984"></a>00984           _dbus_assert (iter-&gt;depth == (base_depth + 0));
<a name="l00985"></a>00985           iter_next (iter); <span class="comment">/* go to the next body */</span>
<a name="l00986"></a>00986           <span class="keywordflow">goto</span> restart;
<a name="l00987"></a>00987         }
<a name="l00988"></a>00988 
<a name="l00989"></a>00989       _dbus_assert (byte_seq &lt; <a class="code" href="group__DBusString.html#gaa5136e6fd2c5188f4b88de7863369c6d" title="Gets the length of a string (not including nul termination).">_dbus_string_get_length</a> (data));
<a name="l00990"></a>00990 
<a name="l00991"></a>00991       <span class="keywordflow">if</span> (<a class="code" href="group__DBusSignature.html#ga7093ae3b35eb073dab939dae69b8c689" title="Return TRUE if the argument is a valid typecode.">dbus_type_is_valid</a> (<a class="code" href="group__DBusString.html#gac1cb7b207eac3c6527a5d42fbc5449b1" title="Gets the byte at the given position.">_dbus_string_get_byte</a> (data, byte_seq)))
<a name="l00992"></a>00992         <span class="keywordflow">break</span>;
<a name="l00993"></a>00993       <span class="keywordflow">else</span>
<a name="l00994"></a>00994         iter_next (iter);
<a name="l00995"></a>00995     }
<a name="l00996"></a>00996 
<a name="l00997"></a>00997   _dbus_assert (byte_seq == iter_get_sequence (iter));
<a name="l00998"></a>00998   _dbus_assert (byte_seq &lt; <a class="code" href="group__DBusString.html#gaa5136e6fd2c5188f4b88de7863369c6d" title="Gets the length of a string (not including nul termination).">_dbus_string_get_length</a> (data));
<a name="l00999"></a>00999 
<a name="l01000"></a>01000   iter_unrecurse (iter);
<a name="l01001"></a>01001 
<a name="l01002"></a>01002   _dbus_assert (iter-&gt;depth == (base_depth + 0));
<a name="l01003"></a>01003   
<a name="l01004"></a>01004   <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to &quot;1&quot;.">TRUE</a>;
<a name="l01005"></a>01005 }
<a name="l01006"></a>01006 
<a name="l01007"></a>01007 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> typecodes[] = {
<a name="l01008"></a>01008   <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="l01009"></a>01009   <a class="code" href="group__DBusProtocol.html#ga355d6d0998164a5eb915a26fb67fce5f" title="Type code marking an 8-bit unsigned integer.">DBUS_TYPE_BYTE</a>,
<a name="l01010"></a>01010   <a class="code" href="group__DBusProtocol.html#ga624ecee83984330ad89cbf064a2b28e6" title="Type code marking a boolean.">DBUS_TYPE_BOOLEAN</a>,
<a name="l01011"></a>01011   <a class="code" href="group__DBusProtocol.html#ga49cdd4169af84ed7937f34b31f43e331" title="Type code marking a 16-bit signed integer.">DBUS_TYPE_INT16</a>,
<a name="l01012"></a>01012   <a class="code" href="group__DBusProtocol.html#gad74b8d93a1464182ac1af7e0e2435f46" title="Type code marking a 16-bit unsigned integer.">DBUS_TYPE_UINT16</a>,
<a name="l01013"></a>01013   <a class="code" href="group__DBusProtocol.html#ga5943b497db2e1dec04fae60584a294bb" title="Type code marking a 32-bit signed integer.">DBUS_TYPE_INT32</a>,
<a name="l01014"></a>01014   <a class="code" href="group__DBusProtocol.html#gaedb1740bd8a9174b98ac593eded25d49" title="Type code marking a 32-bit unsigned integer.">DBUS_TYPE_UINT32</a>,
<a name="l01015"></a>01015   <a class="code" href="group__DBusProtocol.html#gabda4301c14b367f151f86769a1c27c5b" title="Type code marking a 64-bit signed integer.">DBUS_TYPE_INT64</a>,
<a name="l01016"></a>01016   <a class="code" href="group__DBusProtocol.html#gac59cc8f824813444cc9585effd4770d7" title="Type code marking a 64-bit unsigned integer.">DBUS_TYPE_UINT64</a>,
<a name="l01017"></a>01017   <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="l01018"></a>01018   <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="l01019"></a>01019   <a class="code" href="group__DBusProtocol.html#ga31cc59c99a6cbbfcef71756e1390dc4c" title="Type code marking a D-Bus object path.">DBUS_TYPE_OBJECT_PATH</a>,
<a name="l01020"></a>01020   <a class="code" href="group__DBusProtocol.html#ga26ed6c20c3d9f0b50ea0a1cf80be3279" title="Type code marking a D-Bus type signature.">DBUS_TYPE_SIGNATURE</a>,
<a name="l01021"></a>01021   <a class="code" href="group__DBusProtocol.html#ga8912f600f81a773066ca03d9163613a9" title="Type code marking a D-Bus array type.">DBUS_TYPE_ARRAY</a>,
<a name="l01022"></a>01022   <a class="code" href="group__DBusProtocol.html#ga4aa7a463ad2bce4e9aa95e3e397ddcf1" title="Type code marking a D-Bus variant type.">DBUS_TYPE_VARIANT</a>,
<a name="l01023"></a>01023   <a class="code" href="group__DBusProtocol.html#ga725657eca93175475e0694b858f51fd6" title="Code marking the start of a struct type in a type signature.">DBUS_STRUCT_BEGIN_CHAR</a>,
<a name="l01024"></a>01024   <a class="code" href="group__DBusProtocol.html#gaeab5ea0def3f587a0ed548b77d5c5cea" title="Code marking the end of a struct type in a type signature.">DBUS_STRUCT_END_CHAR</a>,
<a name="l01025"></a>01025   <a class="code" href="group__DBusProtocol.html#gad51b5f7a2e6d927295479dd371f6b353" title="Code marking the start of a dict entry type in a type signature.">DBUS_DICT_ENTRY_BEGIN_CHAR</a>,
<a name="l01026"></a>01026   <a class="code" href="group__DBusProtocol.html#ga29ad22c7342ead042ae9e55ae20b49f1" title="Code marking the end of a dict entry type in a type signature.">DBUS_DICT_ENTRY_END_CHAR</a>,
<a name="l01027"></a>01027   <a class="code" href="group__DBusProtocol.html#ga59f8acaeb207b182982dfb97174b7f16" title="Type code marking a unix file descriptor.">DBUS_TYPE_UNIX_FD</a>,
<a name="l01028"></a>01028   255 <span class="comment">/* random invalid typecode */</span>
<a name="l01029"></a>01029 };
<a name="l01030"></a>01030 
<a name="l01031"></a>01031 <span class="keyword">static</span> <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l01032"></a>01032 generate_typecode_changed (DBusMessageDataIter *iter,
<a name="l01033"></a>01033                            <a class="code" href="structDBusString.html">DBusString</a>          *data,
<a name="l01034"></a>01034                            <a class="code" href="group__DBusMarshal.html#ga0c4521d30d6650a33673a4d7f9cc007c" title="This is primarily used in unit testing, so we can verify that each invalid message is invalid for the...">DBusValidity</a>        *expected_validity)
<a name="l01035"></a>01035 {
<a name="l01036"></a>01036   <span class="keywordtype">int</span> byte_seq;
<a name="l01037"></a>01037   <span class="keywordtype">int</span> typecode_seq;
<a name="l01038"></a>01038   <span class="keywordtype">int</span> base_depth;
<a name="l01039"></a>01039 
<a name="l01040"></a>01040   base_depth = iter-&gt;depth;
<a name="l01041"></a>01041 
<a name="l01042"></a>01042  restart:
<a name="l01043"></a>01043   _dbus_assert (iter-&gt;depth == (base_depth + 0));
<a name="l01044"></a>01044   <a class="code" href="group__DBusString.html#ga08c423b93c28dd746dcb93e0461ab95c" title="Sets the length of a string.">_dbus_string_set_length</a> (data, 0);
<a name="l01045"></a>01045   
<a name="l01046"></a>01046   <span class="keywordflow">if</span> (!find_next_typecode (iter, data, expected_validity))
<a name="l01047"></a>01047     <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to &quot;0&quot;.">FALSE</a>;
<a name="l01048"></a>01048 
<a name="l01049"></a>01049   iter_recurse (iter);
<a name="l01050"></a>01050   byte_seq = iter_get_sequence (iter);
<a name="l01051"></a>01051 
<a name="l01052"></a>01052   _dbus_assert (byte_seq &lt; <a class="code" href="group__DBusString.html#gaa5136e6fd2c5188f4b88de7863369c6d" title="Gets the length of a string (not including nul termination).">_dbus_string_get_length</a> (data));
<a name="l01053"></a>01053   
<a name="l01054"></a>01054   iter_recurse (iter);
<a name="l01055"></a>01055   typecode_seq = iter_get_sequence (iter);
<a name="l01056"></a>01056   iter_next (iter);
<a name="l01057"></a>01057 
<a name="l01058"></a>01058   _dbus_assert (typecode_seq &lt;= _DBUS_N_ELEMENTS (typecodes));
<a name="l01059"></a>01059   
<a name="l01060"></a>01060   <span class="keywordflow">if</span> (typecode_seq == _DBUS_N_ELEMENTS (typecodes))
<a name="l01061"></a>01061     {
<a name="l01062"></a>01062       _dbus_assert (iter-&gt;depth == (base_depth + 2));
<a name="l01063"></a>01063       iter_set_sequence (iter, 0); <span class="comment">/* reset typecode sequence */</span>
<a name="l01064"></a>01064       iter_unrecurse (iter);
<a name="l01065"></a>01065       _dbus_assert (iter-&gt;depth == (base_depth + 1));
<a name="l01066"></a>01066       iter_next (iter); <span class="comment">/* go to the next byte_seq */</span>
<a name="l01067"></a>01067       iter_unrecurse (iter);
<a name="l01068"></a>01068       _dbus_assert (iter-&gt;depth == (base_depth + 0));
<a name="l01069"></a>01069       <span class="keywordflow">goto</span> restart;
<a name="l01070"></a>01070     }
<a name="l01071"></a>01071 
<a name="l01072"></a>01072   _dbus_assert (iter-&gt;depth == (base_depth + 2));
<a name="l01073"></a>01073   iter_unrecurse (iter);
<a name="l01074"></a>01074   _dbus_assert (iter-&gt;depth == (base_depth + 1));
<a name="l01075"></a>01075   iter_unrecurse (iter);
<a name="l01076"></a>01076   _dbus_assert (iter-&gt;depth == (base_depth + 0));
<a name="l01077"></a>01077 
<a name="l01078"></a>01078 <span class="preprocessor">#if 0</span>
<a name="l01079"></a>01079 <span class="preprocessor"></span>  printf (<span class="stringliteral">&quot;Changing byte %d in message %d to %c\n&quot;</span>,
<a name="l01080"></a>01080           byte_seq, iter_get_sequence (iter), typecodes[typecode_seq]);
<a name="l01081"></a>01081 <span class="preprocessor">#endif</span>
<a name="l01082"></a>01082 <span class="preprocessor"></span>  
<a name="l01083"></a>01083   <a class="code" href="group__DBusString.html#gab6c823e9406208363fcb5e96d580e738" title="Sets the value of the byte at the given position.">_dbus_string_set_byte</a> (data, byte_seq, typecodes[typecode_seq]);
<a name="l01084"></a>01084   *expected_validity = DBUS_VALIDITY_UNKNOWN;
<a name="l01085"></a>01085   <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to &quot;1&quot;.">TRUE</a>;
<a name="l01086"></a>01086 }
<a name="l01087"></a>01087 <span class="preprocessor">#endif</span>
<a name="l01088"></a>01088 <span class="preprocessor"></span>
<a name="l01089"></a>01089 <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l01090"></a>01090 {
<a name="l01091"></a>01091   ChangeType type;
<a name="l01092"></a>01092   <a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a> value; <span class="comment">/* cast to signed for adjusts */</span>
<a name="l01093"></a>01093 } UIntChange;
<a name="l01094"></a>01094 
<a name="l01095"></a>01095 <span class="keyword">static</span> <span class="keyword">const</span> UIntChange uint32_changes[] = {
<a name="l01096"></a>01096   { CHANGE_TYPE_ADJUST, (<a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a>) -1 },
<a name="l01097"></a>01097   { CHANGE_TYPE_ADJUST, (<a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a>) -2 },
<a name="l01098"></a>01098   { CHANGE_TYPE_ADJUST, (<a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a>) -3 },
<a name="l01099"></a>01099   { CHANGE_TYPE_ADJUST, (<a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a>) 1 },
<a name="l01100"></a>01100   { CHANGE_TYPE_ADJUST, (<a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a>) 2 },
<a name="l01101"></a>01101   { CHANGE_TYPE_ADJUST, (<a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a>) 3 },
<a name="l01102"></a>01102   { CHANGE_TYPE_ABSOLUTE, _DBUS_UINT32_MAX },
<a name="l01103"></a>01103   { CHANGE_TYPE_ABSOLUTE, 0 },
<a name="l01104"></a>01104   { CHANGE_TYPE_ABSOLUTE, 1 },
<a name="l01105"></a>01105   { CHANGE_TYPE_ABSOLUTE, _DBUS_UINT32_MAX - 1 },
<a name="l01106"></a>01106   { CHANGE_TYPE_ABSOLUTE, _DBUS_UINT32_MAX - 5 }
<a name="l01107"></a>01107 };
<a name="l01108"></a>01108 
<a name="l01109"></a>01109 <span class="keyword">static</span> <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l01110"></a>01110 generate_uint32_changed (DBusMessageDataIter *iter,
<a name="l01111"></a>01111                          <a class="code" href="structDBusString.html">DBusString</a>          *data,
<a name="l01112"></a>01112                          <a class="code" href="group__DBusMarshal.html#ga0c4521d30d6650a33673a4d7f9cc007c" title="This is primarily used in unit testing, so we can verify that each invalid message is invalid for the...">DBusValidity</a>        *expected_validity)
<a name="l01113"></a>01113 {
<a name="l01114"></a>01114   <span class="keywordtype">int</span> body_seq;
<a name="l01115"></a>01115   <span class="keywordtype">int</span> byte_seq;
<a name="l01116"></a>01116   <span class="keywordtype">int</span> change_seq;
<a name="l01117"></a>01117   <a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a> v_UINT32;
<a name="l01118"></a>01118   <span class="keywordtype">int</span> byte_order;
<a name="l01119"></a>01119   <span class="keyword">const</span> UIntChange *change;
<a name="l01120"></a>01120   <span class="keywordtype">int</span> base_depth;
<a name="l01121"></a>01121 
<a name="l01122"></a>01122   <span class="comment">/* Outer loop is each body, next loop is each change,</span>
<a name="l01123"></a>01123 <span class="comment">   * inner loop is each change location</span>
<a name="l01124"></a>01124 <span class="comment">   */</span>
<a name="l01125"></a>01125 
<a name="l01126"></a>01126   base_depth = iter-&gt;depth;
<a name="l01127"></a>01127   
<a name="l01128"></a>01128  next_body:
<a name="l01129"></a>01129   _dbus_assert (iter-&gt;depth == (base_depth + 0));
<a name="l01130"></a>01130   <a class="code" href="group__DBusString.html#ga08c423b93c28dd746dcb93e0461ab95c" title="Sets the length of a string.">_dbus_string_set_length</a> (data, 0);
<a name="l01131"></a>01131   body_seq = iter_get_sequence (iter);
<a name="l01132"></a>01132   
<a name="l01133"></a>01133   <span class="keywordflow">if</span> (!generate_many_bodies (iter, data, expected_validity))
<a name="l01134"></a>01134     <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to &quot;0&quot;.">FALSE</a>;
<a name="l01135"></a>01135 
<a name="l01136"></a>01136   _dbus_assert (iter-&gt;depth == (base_depth + 0));
<a name="l01137"></a>01137 
<a name="l01138"></a>01138   iter_set_sequence (iter, body_seq); <span class="comment">/* undo the &quot;next&quot; from generate_many_bodies */</span>
<a name="l01139"></a>01139   iter_recurse (iter);
<a name="l01140"></a>01140  next_change:
<a name="l01141"></a>01141   _dbus_assert (iter-&gt;depth == (base_depth + 1));
<a name="l01142"></a>01142   change_seq = iter_get_sequence (iter);
<a name="l01143"></a>01143   
<a name="l01144"></a>01144   <span class="keywordflow">if</span> (change_seq == _DBUS_N_ELEMENTS (uint32_changes))
<a name="l01145"></a>01145     {
<a name="l01146"></a>01146       <span class="comment">/* Reset change count */</span>
<a name="l01147"></a>01147       iter_set_sequence (iter, 0);
<a name="l01148"></a>01148       iter_unrecurse (iter);
<a name="l01149"></a>01149       iter_next (iter);
<a name="l01150"></a>01150       <span class="keywordflow">goto</span> next_body;
<a name="l01151"></a>01151     }
<a name="l01152"></a>01152 
<a name="l01153"></a>01153   _dbus_assert (iter-&gt;depth == (base_depth + 1));
<a name="l01154"></a>01154   
<a name="l01155"></a>01155   iter_recurse (iter);
<a name="l01156"></a>01156   _dbus_assert (iter-&gt;depth == (base_depth + 2));
<a name="l01157"></a>01157   byte_seq = iter_get_sequence (iter);
<a name="l01158"></a>01158   <span class="comment">/* skip 4 bytes at a time */</span>
<a name="l01159"></a>01159   iter_next (iter);
<a name="l01160"></a>01160   iter_next (iter);
<a name="l01161"></a>01161   iter_next (iter);
<a name="l01162"></a>01162   iter_next (iter);
<a name="l01163"></a>01163   iter_unrecurse (iter);
<a name="l01164"></a>01164 
<a name="l01165"></a>01165   _dbus_assert (_DBUS_ALIGN_VALUE (byte_seq, 4) == (<span class="keywordtype">unsigned</span>) byte_seq);
<a name="l01166"></a>01166   <span class="keywordflow">if</span> (byte_seq &gt;= (<a class="code" href="group__DBusString.html#gaa5136e6fd2c5188f4b88de7863369c6d" title="Gets the length of a string (not including nul termination).">_dbus_string_get_length</a> (data) - 4))
<a name="l01167"></a>01167     {
<a name="l01168"></a>01168       <span class="comment">/* reset byte count */</span>
<a name="l01169"></a>01169       _dbus_assert (iter-&gt;depth == (base_depth + 1));
<a name="l01170"></a>01170       iter_recurse (iter);
<a name="l01171"></a>01171       _dbus_assert (iter-&gt;depth == (base_depth + 2));
<a name="l01172"></a>01172       iter_set_sequence (iter, 0);
<a name="l01173"></a>01173       iter_unrecurse (iter);
<a name="l01174"></a>01174       _dbus_assert (iter-&gt;depth == (base_depth + 1));
<a name="l01175"></a>01175       iter_next (iter);
<a name="l01176"></a>01176       <span class="keywordflow">goto</span> next_change;
<a name="l01177"></a>01177     }
<a name="l01178"></a>01178   
<a name="l01179"></a>01179   _dbus_assert (byte_seq &lt;= (<a class="code" href="group__DBusString.html#gaa5136e6fd2c5188f4b88de7863369c6d" title="Gets the length of a string (not including nul termination).">_dbus_string_get_length</a> (data) - 4));
<a name="l01180"></a>01180 
<a name="l01181"></a>01181   byte_order = <a class="code" href="group__DBusString.html#gac1cb7b207eac3c6527a5d42fbc5449b1" title="Gets the byte at the given position.">_dbus_string_get_byte</a> (data, <a class="code" href="group__DBusMarshal.html#gaa5b7e77f37761139698892e4b8aad029" title="Offset to byte order from start of header.">BYTE_ORDER_OFFSET</a>);
<a name="l01182"></a>01182   
<a name="l01183"></a>01183   v_UINT32 = <a class="code" href="group__DBusMarshal.html#ga6dd82a202c19758cbf76dbed2946615d" title="Convenience function to demarshal a 32 bit unsigned integer.">_dbus_marshal_read_uint32</a> (data, byte_seq, byte_order, <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>);
<a name="l01184"></a>01184 
<a name="l01185"></a>01185   change = &amp;uint32_changes[change_seq];
<a name="l01186"></a>01186 
<a name="l01187"></a>01187   <span class="keywordflow">if</span> (change-&gt;type == CHANGE_TYPE_ADJUST)
<a name="l01188"></a>01188     {
<a name="l01189"></a>01189       v_UINT32 += (int) change-&gt;value;
<a name="l01190"></a>01190     }
<a name="l01191"></a>01191   <span class="keywordflow">else</span>
<a name="l01192"></a>01192     {
<a name="l01193"></a>01193       v_UINT32 = change-&gt;value;
<a name="l01194"></a>01194     }
<a name="l01195"></a>01195 
<a name="l01196"></a>01196 <span class="preprocessor">#if 0</span>
<a name="l01197"></a>01197 <span class="preprocessor"></span>  printf (<span class="stringliteral">&quot;body %d change %d pos %d &quot;</span>,
<a name="l01198"></a>01198           body_seq, change_seq, byte_seq);
<a name="l01199"></a>01199 
<a name="l01200"></a>01200   <span class="keywordflow">if</span> (change-&gt;type == CHANGE_TYPE_ADJUST)
<a name="l01201"></a>01201     printf (<span class="stringliteral">&quot;adjust by %d&quot;</span>, (<span class="keywordtype">int</span>) change-&gt;value);
<a name="l01202"></a>01202   <span class="keywordflow">else</span>
<a name="l01203"></a>01203     printf (<span class="stringliteral">&quot;set to %u&quot;</span>, change-&gt;value);
<a name="l01204"></a>01204   
<a name="l01205"></a>01205   printf (<span class="stringliteral">&quot; \t%u -&gt; %u\n&quot;</span>,
<a name="l01206"></a>01206           <a class="code" href="group__DBusMarshal.html#ga6dd82a202c19758cbf76dbed2946615d" title="Convenience function to demarshal a 32 bit unsigned integer.">_dbus_marshal_read_uint32</a> (data, byte_seq, byte_order, <a class="code" href="group__DBusMacros.html#ga070d2ce7b6bb7e5c05602aa8c308d0c4" title="A null pointer, defined appropriately for C or C++.">NULL</a>),
<a name="l01207"></a>01207           v_UINT32);
<a name="l01208"></a>01208 <span class="preprocessor">#endif</span>
<a name="l01209"></a>01209 <span class="preprocessor"></span>  
<a name="l01210"></a>01210   <a class="code" href="group__DBusMarshal.html#ga4bcfb6a664c7e46c7ffc31f96d532a02" title="Sets the 4 bytes at the given offset to a marshaled unsigned integer, replacing anything found there ...">_dbus_marshal_set_uint32</a> (data, byte_seq, v_UINT32, byte_order);
<a name="l01211"></a>01211   *expected_validity = DBUS_VALIDITY_UNKNOWN;
<a name="l01212"></a>01212 
<a name="l01213"></a>01213   _dbus_assert (iter-&gt;depth == (base_depth + 1));
<a name="l01214"></a>01214   iter_unrecurse (iter);
<a name="l01215"></a>01215   _dbus_assert (iter-&gt;depth == (base_depth + 0));
<a name="l01216"></a>01216           
<a name="l01217"></a>01217   <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to &quot;1&quot;.">TRUE</a>;
<a name="l01218"></a>01218 }
<a name="l01219"></a>01219 
<a name="l01220"></a>01220 <span class="keyword">typedef</span> <span class="keyword">struct</span>
<a name="l01221"></a>01221 {
<a name="l01222"></a>01222   <span class="keyword">const</span> <span class="keywordtype">char</span> *name;
<a name="l01223"></a>01223   DBusMessageGeneratorFunc func;  
<a name="l01224"></a>01224 } DBusMessageGenerator;
<a name="l01225"></a>01225 
<a name="l01226"></a>01226 <span class="keyword">static</span> <span class="keyword">const</span> DBusMessageGenerator generators[] = {
<a name="l01227"></a>01227   { <span class="stringliteral">&quot;trivial example of each message type&quot;</span>, generate_trivial },
<a name="l01228"></a>01228   { <span class="stringliteral">&quot;assorted arguments&quot;</span>, generate_many_bodies },
<a name="l01229"></a>01229   { <span class="stringliteral">&quot;assorted special cases&quot;</span>, generate_special },
<a name="l01230"></a>01230   { <span class="stringliteral">&quot;each uint32 modified&quot;</span>, generate_uint32_changed },
<a name="l01231"></a>01231   { <span class="stringliteral">&quot;wrong body lengths&quot;</span>, generate_wrong_length },
<a name="l01232"></a>01232   { <span class="stringliteral">&quot;each byte modified&quot;</span>, generate_byte_changed },
<a name="l01233"></a>01233 <span class="preprocessor">#if 0</span>
<a name="l01234"></a>01234 <span class="preprocessor"></span>  <span class="comment">/* This is really expensive and doesn&#39;t add too much coverage */</span>
<a name="l01235"></a>01235   { <span class="stringliteral">&quot;change each typecode&quot;</span>, generate_typecode_changed }
<a name="l01236"></a>01236 <span class="preprocessor">#endif</span>
<a name="l01237"></a>01237 <span class="preprocessor"></span>};
<a name="l01238"></a>01238 
<a name="l01239"></a>01239 <span class="keywordtype">void</span>
<a name="l01240"></a>01240 _dbus_message_data_free (DBusMessageData *data)
<a name="l01241"></a>01241 {
<a name="l01242"></a>01242   <a class="code" href="group__DBusString.html#ga781ca91acda49a834dce7d0ed0eef212" title="Frees a string created by _dbus_string_init().">_dbus_string_free</a> (&amp;data-&gt;data);
<a name="l01243"></a>01243 }
<a name="l01244"></a>01244 
<a name="l01245"></a>01245 <span class="keywordtype">void</span>
<a name="l01246"></a>01246 _dbus_message_data_iter_init (DBusMessageDataIter *iter)
<a name="l01247"></a>01247 {
<a name="l01248"></a>01248   <span class="keywordtype">int</span> i;
<a name="l01249"></a>01249   
<a name="l01250"></a>01250   iter-&gt;depth = 0;
<a name="l01251"></a>01251   i = 0;
<a name="l01252"></a>01252   <span class="keywordflow">while</span> (i &lt; _DBUS_MESSAGE_DATA_MAX_NESTING)
<a name="l01253"></a>01253     {
<a name="l01254"></a>01254       iter-&gt;sequence_nos[i] = 0;
<a name="l01255"></a>01255       ++i;
<a name="l01256"></a>01256     }
<a name="l01257"></a>01257   iter-&gt;count = 0;
<a name="l01258"></a>01258 }
<a name="l01259"></a>01259 
<a name="l01260"></a>01260 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>
<a name="l01261"></a>01261 _dbus_message_data_iter_get_and_next (DBusMessageDataIter *iter,
<a name="l01262"></a>01262                                       DBusMessageData     *data)
<a name="l01263"></a>01263 {
<a name="l01264"></a>01264   DBusMessageGeneratorFunc func;
<a name="l01265"></a>01265   <span class="keywordtype">int</span> generator;
<a name="l01266"></a>01266 
<a name="l01267"></a>01267  restart:
<a name="l01268"></a>01268   generator = iter_get_sequence (iter);
<a name="l01269"></a>01269   
<a name="l01270"></a>01270   <span class="keywordflow">if</span> (generator == _DBUS_N_ELEMENTS (generators))
<a name="l01271"></a>01271     <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa93f0eb578d23995850d61f7d61c55c1" title="Expands to &quot;0&quot;.">FALSE</a>;
<a name="l01272"></a>01272 
<a name="l01273"></a>01273   iter_recurse (iter);
<a name="l01274"></a>01274   
<a name="l01275"></a>01275   <span class="keywordflow">if</span> (iter_first_in_series (iter))
<a name="l01276"></a>01276     {
<a name="l01277"></a>01277       printf (<span class="stringliteral">&quot; testing message loading: %s &quot;</span>, generators[generator].name);
<a name="l01278"></a>01278       fflush (stdout);
<a name="l01279"></a>01279     }
<a name="l01280"></a>01280   
<a name="l01281"></a>01281   func = generators[generator].func;
<a name="l01282"></a>01282 
<a name="l01283"></a>01283   <span class="keywordflow">if</span> (!<a class="code" href="group__DBusString.html#ga348252317f7bb8ac43529972945830ae" title="Initializes a string.">_dbus_string_init</a> (&amp;data-&gt;data))
<a name="l01284"></a>01284     _dbus_assert_not_reached (<span class="stringliteral">&quot;oom&quot;</span>);
<a name="l01285"></a>01285   
<a name="l01286"></a>01286   <span class="keywordflow">if</span> ((*func)(iter, &amp;data-&gt;data, &amp;data-&gt;expected_validity))
<a name="l01287"></a>01287     ;
<a name="l01288"></a>01288   <span class="keywordflow">else</span>
<a name="l01289"></a>01289     {
<a name="l01290"></a>01290       iter_set_sequence (iter, 0);
<a name="l01291"></a>01291       iter_unrecurse (iter);
<a name="l01292"></a>01292       iter_next (iter); <span class="comment">/* next generator */</span>
<a name="l01293"></a>01293       <a class="code" href="group__DBusString.html#ga781ca91acda49a834dce7d0ed0eef212" title="Frees a string created by _dbus_string_init().">_dbus_string_free</a> (&amp;data-&gt;data);
<a name="l01294"></a>01294       printf (<span class="stringliteral">&quot;%d test loads cumulative\n&quot;</span>, iter-&gt;count);
<a name="l01295"></a>01295       <span class="keywordflow">goto</span> restart;
<a name="l01296"></a>01296     }
<a name="l01297"></a>01297   iter_unrecurse (iter);
<a name="l01298"></a>01298 
<a name="l01299"></a>01299   iter-&gt;count += 1;
<a name="l01300"></a>01300   <span class="keywordflow">return</span> <a class="code" href="group__DBusMacros.html#gaa8cecfc5c5c054d2875c03e77b7be15d" title="Expands to &quot;1&quot;.">TRUE</a>;
<a name="l01301"></a>01301 }
<a name="l01302"></a>01302 
<a name="l01303"></a>01303 <span class="preprocessor">#endif </span><span class="comment">/* !DOXYGEN_SHOULD_SKIP_THIS */</span>
<a name="l01304"></a>01304 
<a name="l01305"></a>01305 <span class="preprocessor">#endif </span><span class="comment">/* DBUS_ENABLE_EMBEDDED_TESTS */</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 &#160;<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>