Current File : //usr/share/doc/dbus/api/dbus-marshal-header_8h_source.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>D-Bus: dbus-marshal-header.h 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-marshal-header.h</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-marshal-header.h  Managing marshaling/demarshaling of message headers</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Copyright (C) 2005  Red Hat, Inc.</span>
<a name="l00005"></a>00005 <span class="comment"> *</span>
<a name="l00006"></a>00006 <span class="comment"> * Licensed under the Academic Free License version 2.1</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> * This program is free software; you can redistribute it and/or modify</span>
<a name="l00009"></a>00009 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
<a name="l00010"></a>00010 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00011"></a>00011 <span class="comment"> * (at your option) any later version.</span>
<a name="l00012"></a>00012 <span class="comment"> *</span>
<a name="l00013"></a>00013 <span class="comment"> * This program is distributed in the hope that it will be useful,</span>
<a name="l00014"></a>00014 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00015"></a>00015 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00016"></a>00016 <span class="comment"> * GNU General Public License for more details.</span>
<a name="l00017"></a>00017 <span class="comment"> *</span>
<a name="l00018"></a>00018 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
<a name="l00019"></a>00019 <span class="comment"> * along with this program; if not, write to the Free Software</span>
<a name="l00020"></a>00020 <span class="comment"> * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA</span>
<a name="l00021"></a>00021 <span class="comment"> *</span>
<a name="l00022"></a>00022 <span class="comment"> */</span>
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 <span class="preprocessor">#ifndef DBUS_MARSHAL_HEADER_H</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define DBUS_MARSHAL_HEADER_H</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;dbus/dbus-marshal-basic.h&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;dbus/dbus-marshal-validate.h&gt;</span>
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>      <a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>;
<a name="l00031"></a>00031 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structDBusHeaderField.html" title="Cached information about a header field in the message.">DBusHeaderField</a> <a class="code" href="structDBusHeaderField.html" title="Cached information about a header field in the message.">DBusHeaderField</a>;
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="preprocessor">#define _DBUS_HEADER_FIELD_VALUE_UNKNOWN -1</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#define _DBUS_HEADER_FIELD_VALUE_NONEXISTENT -2</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span>
<a name="l00039"></a><a class="code" href="structDBusHeaderField.html">00039</a> <span class="keyword">struct </span><a class="code" href="structDBusHeaderField.html" title="Cached information about a header field in the message.">DBusHeaderField</a>
<a name="l00040"></a>00040 {
<a name="l00041"></a><a class="code" href="structDBusHeaderField.html#aa9616d127de7488f6d9dc18c4d0c2133">00041</a>   <span class="keywordtype">int</span>            <a class="code" href="structDBusHeaderField.html#aa9616d127de7488f6d9dc18c4d0c2133" title="Position of field value, or -1/-2.">value_pos</a>; 
<a name="l00042"></a>00042 };
<a name="l00043"></a>00043 
<a name="l00047"></a><a class="code" href="structDBusHeader.html">00047</a> <span class="keyword">struct </span><a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>
<a name="l00048"></a>00048 {
<a name="l00049"></a><a class="code" href="structDBusHeader.html#a67df8bff43c10e2d4f6ae36b56ee5814">00049</a>   <a class="code" href="structDBusString.html">DBusString</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 name="l00054"></a><a class="code" href="structDBusHeader.html#ac58a309593d0dc7e8d5a02f3b3442384">00054</a>   <a class="code" href="structDBusHeaderField.html" title="Cached information about a header field in the message.">DBusHeaderField</a> <a class="code" href="structDBusHeader.html#ac58a309593d0dc7e8d5a02f3b3442384" title="Track the location of each field in header.">fields</a>[<a class="code" href="group__DBusProtocol.html#ga94f09d2b35473c8ffa6d3190b5f97c5c" title="Value of the highest-numbered header field code, can be used to determine the size of an array indexe...">DBUS_HEADER_FIELD_LAST</a> + 1]; 
<a name="l00058"></a><a class="code" href="structDBusHeader.html#aa22a8d00f061310e12716f656b4d9b8f">00058</a>   <a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a> <a class="code" href="structDBusHeader.html#aa22a8d00f061310e12716f656b4d9b8f" title="bytes of alignment in header">padding</a> : 3;        
<a name="l00059"></a><a class="code" href="structDBusHeader.html#abb64abdf3c7f3fbf77c511ccf1f07aa1">00059</a>   <a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a> <a class="code" href="structDBusHeader.html#abb64abdf3c7f3fbf77c511ccf1f07aa1" title="byte order of header">byte_order</a> : 8;     
<a name="l00060"></a>00060 };
<a name="l00061"></a>00061 
<a name="l00062"></a>00062 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>   <a class="code" href="group__DBusMarshal.html#gabe1b78193d712976734a39d35842f033" title="Initializes a header, but doesn&#39;t prepare it for use; to make the header valid, you have to call _dbu...">_dbus_header_init</a>                   (<a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *header);
<a name="l00063"></a>00063 <span class="keywordtype">void</span>          <a class="code" href="group__DBusMarshal.html#gab90a814a27aeeace7e02c4ed130539cf" title="Frees a header.">_dbus_header_free</a>                   (<a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *header);
<a name="l00064"></a>00064 <span class="keywordtype">void</span>          <a class="code" href="group__DBusMarshal.html#ga6d41ad4de211c87f4b8a43340b6893e2" title="Re-initializes a header that was previously initialized and never freed.">_dbus_header_reinit</a>                 (<a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *header);
<a name="l00065"></a>00065 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>   <a class="code" href="group__DBusMarshal.html#gac7901e4196f10d4763df89b42d5db03e" title="Fills in the primary fields of the header, so the header is ready for use.">_dbus_header_create</a>                 (<a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *header,
<a name="l00066"></a>00066                                                    <span class="keywordtype">int</span>                byte_order,
<a name="l00067"></a>00067                                                    <span class="keywordtype">int</span>                type,
<a name="l00068"></a>00068                                                    <span class="keyword">const</span> <span class="keywordtype">char</span>        *destination,
<a name="l00069"></a>00069                                                    <span class="keyword">const</span> <span class="keywordtype">char</span>        *path,
<a name="l00070"></a>00070                                                    <span class="keyword">const</span> <span class="keywordtype">char</span>        *interface,
<a name="l00071"></a>00071                                                    <span class="keyword">const</span> <span class="keywordtype">char</span>        *member,
<a name="l00072"></a>00072                                                    <span class="keyword">const</span> <span class="keywordtype">char</span>        *error_name);
<a name="l00073"></a>00073 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>   <a class="code" href="group__DBusMarshal.html#ga0d5aad82f8bf5a314dcf3f70930e254b" title="Initializes dest with a copy of the given header.">_dbus_header_copy</a>                   (<span class="keyword">const</span> <a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>  *header,
<a name="l00074"></a>00074                                                    <a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *dest);
<a name="l00075"></a>00075 <span class="keywordtype">int</span>           <a class="code" href="group__DBusMarshal.html#ga4427247494fc5c988498c5a87d42092d" title="Gets the type of the message.">_dbus_header_get_message_type</a>       (<a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *header);
<a name="l00076"></a>00076 <span class="keywordtype">void</span>          <a class="code" href="group__DBusMarshal.html#gad92e0b1992cf96a4da642a4a54a5d26d" title="Sets the serial number of a header.">_dbus_header_set_serial</a>             (<a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *header,
<a name="l00077"></a>00077                                                    <a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a>      serial);
<a name="l00078"></a>00078 <a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a> <a class="code" href="group__DBusMarshal.html#ga7ec7222423db42935aae4a24499ee0fb" title="See dbus_message_get_serial()">_dbus_header_get_serial</a>             (<a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *header);
<a name="l00079"></a>00079 <span class="keywordtype">void</span>          <a class="code" href="group__DBusMarshal.html#ga0cff04252f97f6a25552c368199897f5" title="Fills in the correct body length.">_dbus_header_update_lengths</a>         (<a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *header,
<a name="l00080"></a>00080                                                    <span class="keywordtype">int</span>                body_len);
<a name="l00081"></a>00081 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>   <a class="code" href="group__DBusMarshal.html#ga4349de00b7754a337526e36fda133464" title="Sets the value of a field with basic type.">_dbus_header_set_field_basic</a>        (<a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *header,
<a name="l00082"></a>00082                                                    <span class="keywordtype">int</span>                field,
<a name="l00083"></a>00083                                                    <span class="keywordtype">int</span>                type,
<a name="l00084"></a>00084                                                    <span class="keyword">const</span> <span class="keywordtype">void</span>        *value);
<a name="l00085"></a>00085 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>   <a class="code" href="group__DBusMarshal.html#ga499973a18dcb17d854eaf14101a66736" title="Gets the value of a field with basic type.">_dbus_header_get_field_basic</a>        (<a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *header,
<a name="l00086"></a>00086                                                    <span class="keywordtype">int</span>                field,
<a name="l00087"></a>00087                                                    <span class="keywordtype">int</span>                type,
<a name="l00088"></a>00088                                                    <span class="keywordtype">void</span>              *value);
<a name="l00089"></a>00089 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>   <a class="code" href="group__DBusMarshal.html#gaf4661ba8e7067f349ba03c9f5776bbb0" title="Gets the raw marshaled data for a field.">_dbus_header_get_field_raw</a>          (<a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *header,
<a name="l00090"></a>00090                                                    <span class="keywordtype">int</span>                field,
<a name="l00091"></a>00091                                                    <span class="keyword">const</span> <a class="code" href="structDBusString.html">DBusString</a> **str,
<a name="l00092"></a>00092                                                    <span class="keywordtype">int</span>               *pos);
<a name="l00093"></a>00093 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>   <a class="code" href="group__DBusMarshal.html#ga7814248f4d74d109d29dc00487cd9b0c" title="Deletes a field, if it exists.">_dbus_header_delete_field</a>           (<a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *header,
<a name="l00094"></a>00094                                                    <span class="keywordtype">int</span>                field);
<a name="l00095"></a>00095 <span class="keywordtype">void</span>          <a class="code" href="group__DBusMarshal.html#gad2073f8f2f2ba3b710aa929dced34cc3" title="Toggles a message flag bit, turning on the bit if value = TRUE and flipping it off if value = FALSE...">_dbus_header_toggle_flag</a>            (<a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *header,
<a name="l00096"></a>00096                                                    <a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a>      flag,
<a name="l00097"></a>00097                                                    <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>        value);
<a name="l00098"></a>00098 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>   <a class="code" href="group__DBusMarshal.html#ga56619efed3088554b8760edd246b4157" title="Gets a message flag bit, returning TRUE if the bit is set.">_dbus_header_get_flag</a>               (<a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *header,
<a name="l00099"></a>00099                                                    <a class="code" href="group__DBusTypes.html#gaf513803b030613a669cc7ef199f90a8b" title="A 32-bit unsigned integer on all platforms.">dbus_uint32_t</a>      flag);
<a name="l00100"></a>00100 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>   _dbus_header_ensure_signature       (<a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *header,
<a name="l00101"></a>00101                                                    <a class="code" href="structDBusString.html">DBusString</a>       **type_str,
<a name="l00102"></a>00102                                                    <span class="keywordtype">int</span>               *type_pos);
<a name="l00103"></a>00103 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>   <a class="code" href="group__DBusMarshal.html#ga674d74081baf6e7531e0d4a286724210" title="Given data long enough to contain the length of the message body and the fields array, check whether the data is long enough to contain the entire message (assuming the claimed lengths are accurate).">_dbus_header_have_message_untrusted</a> (<span class="keywordtype">int</span>                max_message_length,
<a name="l00104"></a>00104                                                    <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>      *validity,
<a name="l00105"></a>00105                                                    <span class="keywordtype">int</span>               *byte_order,
<a name="l00106"></a>00106                                                    <span class="keywordtype">int</span>               *fields_array_len,
<a name="l00107"></a>00107                                                    <span class="keywordtype">int</span>               *header_len,
<a name="l00108"></a>00108                                                    <span class="keywordtype">int</span>               *body_len,
<a name="l00109"></a>00109                                                    <span class="keyword">const</span> <a class="code" href="structDBusString.html">DBusString</a>  *str,
<a name="l00110"></a>00110                                                    <span class="keywordtype">int</span>                start,
<a name="l00111"></a>00111                                                    <span class="keywordtype">int</span>                len);
<a name="l00112"></a>00112 <a class="code" href="group__DBusTypes.html#ga39c9cb0f3a2a8ad6f55cc4855d035349" title="A boolean, valid values are TRUE and FALSE.">dbus_bool_t</a>   <a class="code" href="group__DBusMarshal.html#ga0c3a3f95d9a53b91a0cd0b260196685b" title="Creates a message header from potentially-untrusted data.">_dbus_header_load</a>                   (<a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *header,
<a name="l00113"></a>00113                                                    <a class="code" href="group__DBusMarshal.html#gaf9dce059725fa793c44b219460cbbe6d" title="This is used rather than a bool for high visibility.">DBusValidationMode</a> mode,
<a name="l00114"></a>00114                                                    <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>      *validity,
<a name="l00115"></a>00115                                                    <span class="keywordtype">int</span>                byte_order,
<a name="l00116"></a>00116                                                    <span class="keywordtype">int</span>                fields_array_len,
<a name="l00117"></a>00117                                                    <span class="keywordtype">int</span>                header_len,
<a name="l00118"></a>00118                                                    <span class="keywordtype">int</span>                body_len,
<a name="l00119"></a>00119                                                    <span class="keyword">const</span> <a class="code" href="structDBusString.html">DBusString</a>  *str,
<a name="l00120"></a>00120                                                    <span class="keywordtype">int</span>                start,
<a name="l00121"></a>00121                                                    <span class="keywordtype">int</span>                len);
<a name="l00122"></a>00122 <span class="keywordtype">void</span>          <a class="code" href="group__DBusMarshal.html#gae5277c7b7bfb7b85e421baceac0398c8" title="Swaps the header into the given order if required.">_dbus_header_byteswap</a>               (<a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>        *header,
<a name="l00123"></a>00123                                                    <span class="keywordtype">int</span>                new_order);
<a name="l00124"></a>00124 <span class="keywordtype">char</span>          <a class="code" href="group__DBusMarshal.html#ga65c023673b837c27e8ccda5c2528d806" title="Returns the header&#39;s byte order.">_dbus_header_get_byte_order</a>         (<span class="keyword">const</span> <a class="code" href="structDBusHeader.html" title="Message header data and some cached details of it.">DBusHeader</a>  *header);
<a name="l00125"></a>00125 
<a name="l00126"></a>00126 
<a name="l00127"></a>00127 
<a name="l00128"></a>00128 <span class="preprocessor">#endif </span><span class="comment">/* DBUS_MARSHAL_HEADER_H */</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>