<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> <title>DBusString implementation details</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.2.15 --> <center> <a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="modules.html">Modules</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> <a class="qindex" href="pages.html">Related Pages</a> </center> <hr><h1>DBusString implementation details<br> <small> [<a class="el" href="group__DBusInternals.html">D-BUS internal implementation details</a>]</small> </h1><a class="el" href="structDBusString.html">DBusString</a> implementation details. <a href="#_details">More...</a><table border=0 cellpadding=0 cellspacing=0> <tr><td colspan=2><br><h2>Defines</h2></td></tr> <tr><td nowrap align=right valign=top><a name="a1" doxytag="DBusStringInternals::ALLOCATION_PADDING"></a> #define </td><td valign=bottom><a class="el" href="group__DBusStringInternals.html#a1">ALLOCATION_PADDING</a> 8</td></tr> <tr><td> </td><td><font size=-1><em>We allocate 1 byte for nul termination, plus 7 bytes for possible align_offset, so we always need 8 bytes on top of the string's length to be in the allocated block.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top><a name="a2" doxytag="DBusStringInternals::MAX_MAX_LENGTH"></a> #define </td><td valign=bottom><a class="el" href="group__DBusStringInternals.html#a2">MAX_MAX_LENGTH</a> (_DBUS_INT_MAX - ALLOCATION_PADDING)</td></tr> <tr><td> </td><td><font size=-1><em>This is the maximum max length (and thus also the maximum length) of a <a class="el" href="structDBusString.html">DBusString</a>.</em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="group__DBusStringInternals.html#a3">DBUS_GENERIC_STRING_PREAMBLE</a>(real) _dbus_assert ((real) != NULL); _dbus_assert (!(real)->invalid); _dbus_assert ((real)->len >= 0); _dbus_assert ((real)->allocated >= 0); _dbus_assert ((real)->max_length >= 0); _dbus_assert ((real)->len <= ((real)->allocated - ALLOCATION_PADDING)); _dbus_assert ((real)->len <= (real)->max_length)</td></tr> <tr><td> </td><td><font size=-1><em>Checks a bunch of assertions about a string object.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="group__DBusStringInternals.html#a4">DBUS_STRING_PREAMBLE</a>(str)</td></tr> <tr><td> </td><td><font size=-1><em>Checks assertions about a string object that needs to be modifiable - may not be locked or const.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="group__DBusStringInternals.html#a5">DBUS_LOCKED_STRING_PREAMBLE</a>(str)</td></tr> <tr><td> </td><td><font size=-1><em>Checks assertions about a string object that may be locked but can't be const.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr> <tr><td nowrap align=right valign=top>#define </td><td valign=bottom><a class="el" href="group__DBusStringInternals.html#a6">DBUS_CONST_STRING_PREAMBLE</a>(str)</td></tr> <tr><td> </td><td><font size=-1><em>Checks assertions about a string that may be const or locked.</em> <a href="#a6">More...</a><em></em></font><br><br></td></tr> <tr><td colspan=2><br><h2>Functions</h2></td></tr> <tr><td nowrap align=right valign=top><a class="el" href="group__DBusTypes.html#a2">dbus_bool_t</a> </td><td valign=bottom><a class="el" href="group__DBusStringInternals.html#a0">_dbus_string_test</a> (void)</td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> <a class="el" href="structDBusString.html">DBusString</a> implementation details. <p> <p> The guts of <a class="el" href="structDBusString.html">DBusString</a>. <hr><h2>Define Documentation</h2> <a name="a6" doxytag="dbus-string.c::DBUS_CONST_STRING_PREAMBLE"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define DBUS_CONST_STRING_PREAMBLE</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">str </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <b>Value:</b><div class="fragment"><pre><font class="keyword">const</font> <a class="code" href="structDBusRealString.html">DBusRealString</a> *real = (<a class="code" href="structDBusRealString.html">DBusRealString</a>*) str; \ DBUS_GENERIC_STRING_PREAMBLE (real)</pre></div>Checks assertions about a string that may be const or locked. <p> Also declares the "real" variable pointing to <a class="el" href="structDBusRealString.html">DBusRealString</a>. <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>str</em> </td><td> the string. </td></tr> </table> </dl> <p> Definition at line <a class="el" href="dbus-string_8c-source.html#l00121">121</a> of file <a class="el" href="dbus-string_8c-source.html">dbus-string.c</a>. </td> </tr> </table> <a name="a3" doxytag="dbus-string.c::DBUS_GENERIC_STRING_PREAMBLE"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define DBUS_GENERIC_STRING_PREAMBLE</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">real </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> _dbus_assert ((real) != NULL); _dbus_assert (!(real)->invalid); _dbus_assert ((real)->len >= 0); _dbus_assert ((real)->allocated >= 0); _dbus_assert ((real)->max_length >= 0); _dbus_assert ((real)->len <= ((real)->allocated - ALLOCATION_PADDING)); _dbus_assert ((real)->len <= (real)->max_length) </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Checks a bunch of assertions about a string object. <p> <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>real</em> </td><td> the <a class="el" href="structDBusRealString.html">DBusRealString</a> </td></tr> </table> </dl> <p> Definition at line <a class="el" href="dbus-string_8c-source.html#l00092">92</a> of file <a class="el" href="dbus-string_8c-source.html">dbus-string.c</a>. </td> </tr> </table> <a name="a5" doxytag="dbus-string.c::DBUS_LOCKED_STRING_PREAMBLE"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define DBUS_LOCKED_STRING_PREAMBLE</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">str </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <b>Value:</b><div class="fragment"><pre><a class="code" href="structDBusRealString.html">DBusRealString</a> *real = (<a class="code" href="structDBusRealString.html">DBusRealString</a>*) str; \ DBUS_GENERIC_STRING_PREAMBLE (real); \ _dbus_assert (!(real)->constant)</pre></div>Checks assertions about a string object that may be locked but can't be const. <p> i.e. a string object that we can free. Also declares the "real" variable pointing to <a class="el" href="structDBusRealString.html">DBusRealString</a>.<dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>str</em> </td><td> the string </td></tr> </table> </dl> <p> Definition at line <a class="el" href="dbus-string_8c-source.html#l00112">112</a> of file <a class="el" href="dbus-string_8c-source.html">dbus-string.c</a>. </td> </tr> </table> <a name="a4" doxytag="dbus-string.c::DBUS_STRING_PREAMBLE"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> #define DBUS_STRING_PREAMBLE</td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">str </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> <b>Value:</b><div class="fragment"><pre><a class="code" href="structDBusRealString.html">DBusRealString</a> *real = (<a class="code" href="structDBusRealString.html">DBusRealString</a>*) str; \ DBUS_GENERIC_STRING_PREAMBLE (real); \ _dbus_assert (!(real)->constant); \ _dbus_assert (!(real)->locked)</pre></div>Checks assertions about a string object that needs to be modifiable - may not be locked or const. <p> Also declares the "real" variable pointing to <a class="el" href="structDBusRealString.html">DBusRealString</a>. <dl compact><dt><b> Parameters: </b><dd> <table border=0 cellspacing=2 cellpadding=0> <tr><td valign=top><em>str</em> </td><td> the string </td></tr> </table> </dl> <p> Definition at line <a class="el" href="dbus-string_8c-source.html#l00100">100</a> of file <a class="el" href="dbus-string_8c-source.html">dbus-string.c</a>. </td> </tr> </table> <hr><h2>Function Documentation</h2> <a name="a0" doxytag="dbus-string.c::_dbus_string_test"></a><p> <table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="group__DBusTypes.html#a2">dbus_bool_t</a> _dbus_string_test </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr> </table> <table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td> <p> Unit test for <a class="el" href="structDBusString.html">DBusString</a>. <p> <p> <dl compact><dt><b> <a class="el" href="todo.html#_todo000062">Todo: </a></b><dd> Need to write tests for <a class="el" href="group__DBusString.html#a42">_dbus_string_copy</a>() and <a class="el" href="group__DBusString.html#a41">_dbus_string_move</a>() moving to/from each of start/middle/end of a string. Also need tests for _dbus_string_move_len ()</dl> <p> <dl compact><dt><b> Returns: </b><dd> <a class="el" href="group__DBusMacros.html#a2">TRUE</a> on success. </dl> <p> Definition at line <a class="el" href="dbus-string_8c-source.html#l03059">3059</a> of file <a class="el" href="dbus-string_8c-source.html">dbus-string.c</a>. </td> </tr> </table> <hr><address align="right"><small>Generated on Wed Jun 9 05:01:28 2004 for D-BUS by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.2.15 </small></address> </body> </html>