Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > f2ccf6b0630b8c81810a0107f1c7ff67 > files > 41

eet-devel-1.3.2-1.fc14.i686.rpm

<html>
<head>
    <title>Eet: Eet Data Serialization using A Ciphers</title>
    <meta http-equiv="content-type" content="text/html;charset=UTF-8">
    <meta name="author" content="Andres Blanc" >
    
    <link rel="icon" href="img/favicon.png" type="image/x-icon">
    <link rel="shortcut icon" href="img/favicon.png" type="image/x-icon">
    <link rel="icon" href="img/favicon.png" type="image/ico">
    <link rel="shortcut icon" href="img/favicon.png" type="image/ico">

    <link rel="stylesheet" type="text/css" media="screen" href="e.css">
    <link rel="stylesheet" type="text/css" media="screen" href="edoxy.css">
</head>

<body>

<div id="container">

<div id="header">
<div class="layout">
    
    <h1><span>Enlightenment</span></h1>
    <h2><span>Beauty at your fingertips</span></h2>

    <div class="menu-container">
        <div class="menu">
            <ul>
	        <li class="current"><a href="http://web.enlightenment.org/p.php?p=docs">Docs</a></li>
                <li><a href="http://trac.enlightenment.org/e">Tracker</a></li>
                <li><a href="http://www.enlightenment.org/p.php?p=contact">Contact</a></li>
                <li><a href="http://www.enlightenment.org/p.php?p=contribute">Contribute</a></li>
                <li><a href="http://www.enlightenment.org/p.php?p=support">Support</a></li>
                <li><a href="http://www.enlightenment.org/p.php?p=download">Download</a></li>
                <li><a href="http://www.enlightenment.org/p.php?p=about">About</a></li>
                <li><a href="http://www.enlightenment.org/p.php?p=news">News</a></li>
                <li><a href="http://www.enlightenment.org/">Home</a></li>
            </ul>
        </div>
    </div>

    <div class="doxytitle">
        Eet Documentation <small>at 2 Jul 2010</small>
    </div>

    <div class="menu-container">
        <div class="submenu">
            <ul class="current">
                <li><a href="Examples.html">Examples</a></li>
                <li><a href="files.html">Files</a></li>
                <li><a href="modules.html">Modules</a></li>
                <li><a href="globals.html">Globals</a></li>
                <li><a href="pages.html">Related Pages</a></li>
	        <li class="current"><a href="index.html">Main Page</a></li>
            </ul>
        </div>
    </div>


    <div class="clear"></div>
</div>
</div>

<div id="content">
<div class="layout">
<!-- Generated by Doxygen 1.6.2-20100208 -->
<div class="contents">
<h1>Eet Data Serialization using A Ciphers<br/>
<small>
[<a class="el" href="group__Eet__Data__Group.html">Eet Data Serialization</a>]</small>
</h1>
<p>Most of the <a class="el" href="group__Eet__Data__Group.html">Eet Data Serialization</a> have alternative versions that accounts for ciphers to protect their content.  
<a href="#_details">More...</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">EAPI void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Eet__Data__Cipher__Group.html#ga418b7f00fc7f2e0cc94b33787eddbe08">eet_data_read_cipher</a> (<a class="el" href="group__Eet__File__Group.html#ga8d9779184a9870c1a225f1f40c76e8a7">Eet_File</a> *ef, <a class="el" href="group__Eet__Data__Group.html#ga4baec0e840012480a0958c5c3bca276d">Eet_Data_Descriptor</a> *edd, const char *name, const char *cipher_key)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Read a data structure from an eet file and decodes it using a cipher.  <a href="#ga418b7f00fc7f2e0cc94b33787eddbe08"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">EAPI int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Eet__Data__Cipher__Group.html#ga9e46230c55006296f141ed9a5807c759">eet_data_write_cipher</a> (<a class="el" href="group__Eet__File__Group.html#ga8d9779184a9870c1a225f1f40c76e8a7">Eet_File</a> *ef, <a class="el" href="group__Eet__Data__Group.html#ga4baec0e840012480a0958c5c3bca276d">Eet_Data_Descriptor</a> *edd, const char *name, const char *cipher_key, const void *data, int compress)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Write a data structure from memory and store in an eet file using a cipher.  <a href="#ga9e46230c55006296f141ed9a5807c759"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">EAPI int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Eet__Data__Cipher__Group.html#gaa55cc17257b9b8be41d27eac87c8ad9c">eet_data_text_dump_cipher</a> (const void *data_in, const char *cipher_key, int size_in, void(*dumpfunc)(void *data, const char *str), void *dumpdata)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Dump an eet encoded data structure into ascii text using a cipher.  <a href="#gaa55cc17257b9b8be41d27eac87c8ad9c"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">EAPI void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Eet__Data__Cipher__Group.html#ga99e8a3acd6c3fbe552b0f9d474ae4f0d">eet_data_text_undump_cipher</a> (const char *text, const char *cipher_key, int textlen, int *size_ret)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Take an ascii encoding from <a class="el" href="group__Eet__Data__Group.html#ga73eea56513db9eeb5a0f30514471fa75" title="Dump an eet encoded data structure into ascii text.">eet_data_text_dump()</a> and re-encode in binary using a cipher.  <a href="#ga99e8a3acd6c3fbe552b0f9d474ae4f0d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">EAPI int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Eet__Data__Cipher__Group.html#ga74af6c94c8de90b547c4620946413d6b">eet_data_dump_cipher</a> (<a class="el" href="group__Eet__File__Group.html#ga8d9779184a9870c1a225f1f40c76e8a7">Eet_File</a> *ef, const char *name, const char *cipher_key, void(*dumpfunc)(void *data, const char *str), void *dumpdata)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Dump an eet encoded data structure from an eet file into ascii text using a cipher.  <a href="#ga74af6c94c8de90b547c4620946413d6b"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">EAPI int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Eet__Data__Cipher__Group.html#ga58060eca71513b8634a32e076dc8dd85">eet_data_undump_cipher</a> (<a class="el" href="group__Eet__File__Group.html#ga8d9779184a9870c1a225f1f40c76e8a7">Eet_File</a> *ef, const char *name, const char *cipher_key, const char *text, int textlen, int compress)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Take an ascii encoding from <a class="el" href="group__Eet__Data__Group.html#gae4ead9639aa9d6ce0db2354b5636f56d" title="Dump an eet encoded data structure from an eet file into ascii text.">eet_data_dump()</a> and re-encode in binary using a cipher.  <a href="#ga58060eca71513b8634a32e076dc8dd85"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">EAPI void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Eet__Data__Cipher__Group.html#ga139dd65b6d66537da27f3e9dd620a631">eet_data_descriptor_decode_cipher</a> (<a class="el" href="group__Eet__Data__Group.html#ga4baec0e840012480a0958c5c3bca276d">Eet_Data_Descriptor</a> *edd, const void *data_in, const char *cipher_key, int size_in)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Decode a data structure from an arbitary location in memory using a cipher.  <a href="#ga139dd65b6d66537da27f3e9dd620a631"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">EAPI void *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__Eet__Data__Cipher__Group.html#gab765474a660b0dfe5f00d99a960206db">eet_data_descriptor_encode_cipher</a> (<a class="el" href="group__Eet__Data__Group.html#ga4baec0e840012480a0958c5c3bca276d">Eet_Data_Descriptor</a> *edd, const void *data_in, const char *cipher_key, int *size_ret)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Encode a data struct to memory and return that encoded data using a cipher.  <a href="#gab765474a660b0dfe5f00d99a960206db"></a><br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Most of the <a class="el" href="group__Eet__Data__Group.html">Eet Data Serialization</a> have alternative versions that accounts for ciphers to protect their content. </p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__Eet__Cipher__Group.html">Cipher, Identity and Protection Mechanisms</a> </dd></dl>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga139dd65b6d66537da27f3e9dd620a631"></a><!-- doxytag: member="Eet.h::eet_data_descriptor_decode_cipher" ref="ga139dd65b6d66537da27f3e9dd620a631" args="(Eet_Data_Descriptor *edd, const void *data_in, const char *cipher_key, int size_in)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">EAPI void* eet_data_descriptor_decode_cipher </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__Eet__Data__Group.html#ga4baec0e840012480a0958c5c3bca276d">Eet_Data_Descriptor</a> *&nbsp;</td>
          <td class="paramname"> <em>edd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&nbsp;</td>
          <td class="paramname"> <em>data_in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>cipher_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size_in</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Decode a data structure from an arbitary location in memory using a cipher. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>edd</em>&nbsp;</td><td>The data descriptor to use when decoding. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>data_in</em>&nbsp;</td><td>The pointer to the data to decode into a struct. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>cipher_key</em>&nbsp;</td><td>The key to use as cipher. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size_in</em>&nbsp;</td><td>The size of the data pointed to in bytes. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>NULL on failure, or a valid decoded struct pointer on success.</dd></dl>
<p>This function will decode a data structure that has been encoded using <a class="el" href="group__Eet__Data__Group.html#gaa7c3b3a8cbeffc34c21dbbb1decc3c2d" title="Encode a dsata struct to memory and return that encoded data.">eet_data_descriptor_encode()</a>, and return a data structure with all its elements filled out, if successful, or NULL on failure.</p>
<p>The data to be decoded is stored at the memory pointed to by <code>data_in</code>, and is described by the descriptor pointed to by <code>edd</code>. The data size is passed in as the value to <code>size_in</code>, ande must be greater than 0 to succeed.</p>
<p>This function is useful for decoding data structures delivered to the application by means other than an eet file, such as an IPC or socket connection, raw files, shared memory etc.</p>
<p>Please see <a class="el" href="group__Eet__Data__Group.html#ga4d1807cbbc448304f22a8808318a3429" title="Read a data structure from an eet file and decodes it.">eet_data_read()</a> for more information.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__Eet__Data__Group.html#gaad95530fdaec27047c41a5ceace5c231" title="Decode a data structure from an arbitary location in memory.">eet_data_descriptor_decode()</a></dd></dl>
<dl class="since"><dt><b>Since:</b></dt><dd>1.0.0 </dd></dl>

<p>Referenced by <a class="el" href="eet__data_8c_source.html#l03680">eet_data_descriptor_decode()</a>.</p>

</div>
</div>
<a class="anchor" id="gab765474a660b0dfe5f00d99a960206db"></a><!-- doxytag: member="Eet.h::eet_data_descriptor_encode_cipher" ref="gab765474a660b0dfe5f00d99a960206db" args="(Eet_Data_Descriptor *edd, const void *data_in, const char *cipher_key, int *size_ret)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">EAPI void* eet_data_descriptor_encode_cipher </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__Eet__Data__Group.html#ga4baec0e840012480a0958c5c3bca276d">Eet_Data_Descriptor</a> *&nbsp;</td>
          <td class="paramname"> <em>edd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&nbsp;</td>
          <td class="paramname"> <em>data_in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>cipher_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&nbsp;</td>
          <td class="paramname"> <em>size_ret</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Encode a data struct to memory and return that encoded data using a cipher. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>edd</em>&nbsp;</td><td>The data descriptor to use when encoding. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>data_in</em>&nbsp;</td><td>The pointer to the struct to encode into data. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>cipher_key</em>&nbsp;</td><td>The key to use as cipher. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size_ret</em>&nbsp;</td><td>pointer to the an int to be filled with the decoded size. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>NULL on failure, or a valid encoded data chunk on success.</dd></dl>
<p>This function takes a data structutre in memory and encodes it into a serialised chunk of data that can be decoded again by <a class="el" href="group__Eet__Data__Group.html#gaad95530fdaec27047c41a5ceace5c231" title="Decode a data structure from an arbitary location in memory.">eet_data_descriptor_decode()</a>. This is useful for being able to transmit data structures across sockets, pipes, IPC or shared file mechanisms, without having to worry about memory space, machine type, endianess etc.</p>
<p>The parameter <code>edd</code> must point to a valid data descriptor, and <code>data_in</code> must point to the right data structure to encode. If not, the encoding may fail.</p>
<p>On success a non NULL valid pointer is returned and what <code>size_ret</code> points to is set to the size of this decoded data, in bytes. When the encoded data is no longer needed, call free() on it. On failure NULL is returned and what <code>size_ret</code> points to is set to 0.</p>
<p>Please see <a class="el" href="group__Eet__Data__Group.html#gac66d1c49e3490bc5d803982d833ff8aa" title="Write a data structure from memory and store in an eet file.">eet_data_write()</a> for more information.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__Eet__Data__Group.html#gaa7c3b3a8cbeffc34c21dbbb1decc3c2d" title="Encode a dsata struct to memory and return that encoded data.">eet_data_descriptor_encode()</a></dd></dl>
<dl class="since"><dt><b>Since:</b></dt><dd>1.0.0 </dd></dl>

<p>Referenced by <a class="el" href="eet__connection_8c_source.html#l00189">eet_connection_send()</a>, and <a class="el" href="eet__data_8c_source.html#l03842">eet_data_descriptor_encode()</a>.</p>

</div>
</div>
<a class="anchor" id="ga74af6c94c8de90b547c4620946413d6b"></a><!-- doxytag: member="Eet.h::eet_data_dump_cipher" ref="ga74af6c94c8de90b547c4620946413d6b" args="(Eet_File *ef, const char *name, const char *cipher_key, void(*dumpfunc)(void *data, const char *str), void *dumpdata)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">EAPI int eet_data_dump_cipher </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__Eet__File__Group.html#ga8d9779184a9870c1a225f1f40c76e8a7">Eet_File</a> *&nbsp;</td>
          <td class="paramname"> <em>ef</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>cipher_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void(*)(void *data, const char *str)&nbsp;</td>
          <td class="paramname"> <em>dumpfunc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>dumpdata</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Dump an eet encoded data structure from an eet file into ascii text using a cipher. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ef</em>&nbsp;</td><td>A valid eet file handle. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>Name of the entry. eg: "/base/file_i_want". </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>cipher_key</em>&nbsp;</td><td>The key to use as cipher. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>dumpfunc</em>&nbsp;</td><td>The function to call passed a string when new data is converted to text </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>dumpdata</em>&nbsp;</td><td>The data to pass to the <code>dumpfunc</code> callback. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>1 on success, 0 on failure</dd></dl>
<p>This function will take an open and valid eet file from <a class="el" href="group__Eet__File__Group.html#ga5f55956b860aa2c77af9b1a880c4c256" title="Open an eet file on disk, and returns a handle to it.">eet_open()</a> request the data encoded by <a class="el" href="group__Eet__Data__Group.html#gaa7c3b3a8cbeffc34c21dbbb1decc3c2d" title="Encode a dsata struct to memory and return that encoded data.">eet_data_descriptor_encode()</a> corresponding to the key <code>name</code> and convert it into human readable ascii text. It does this by calling the <code>dumpfunc</code> callback for all new text that is generated. This callback should append to any existing text buffer and will be passed the pointer <code>dumpdata</code> as a parameter as well as a string with new text to be appended.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__Eet__Data__Group.html#gae4ead9639aa9d6ce0db2354b5636f56d" title="Dump an eet encoded data structure from an eet file into ascii text.">eet_data_dump()</a></dd></dl>
<dl class="since"><dt><b>Since:</b></dt><dd>1.0.0 </dd></dl>

<p>References <a class="el" href="eet__lib_8c_source.html#l01984">eet_dictionary_get()</a>, <a class="el" href="eet__node_8c_source.html#l00307">eet_node_del()</a>, <a class="el" href="eet__node_8c_source.html#l00508">eet_node_dump()</a>, <a class="el" href="eet__lib_8c_source.html#l01571">eet_read_cipher()</a>, and <a class="el" href="eet__lib_8c_source.html#l01701">eet_read_direct()</a>.</p>

<p>Referenced by <a class="el" href="eet__data_8c_source.html#l03524">eet_data_dump()</a>.</p>

</div>
</div>
<a class="anchor" id="ga418b7f00fc7f2e0cc94b33787eddbe08"></a><!-- doxytag: member="Eet.h::eet_data_read_cipher" ref="ga418b7f00fc7f2e0cc94b33787eddbe08" args="(Eet_File *ef, Eet_Data_Descriptor *edd, const char *name, const char *cipher_key)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">EAPI void* eet_data_read_cipher </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__Eet__File__Group.html#ga8d9779184a9870c1a225f1f40c76e8a7">Eet_File</a> *&nbsp;</td>
          <td class="paramname"> <em>ef</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__Eet__Data__Group.html#ga4baec0e840012480a0958c5c3bca276d">Eet_Data_Descriptor</a> *&nbsp;</td>
          <td class="paramname"> <em>edd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>cipher_key</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read a data structure from an eet file and decodes it using a cipher. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ef</em>&nbsp;</td><td>The eet file handle to read from. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>edd</em>&nbsp;</td><td>The data descriptor handle to use when decoding. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>The key the data is stored under in the eet file. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>cipher_key</em>&nbsp;</td><td>The key to use as cipher. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A pointer to the decoded data structure.</dd></dl>
<p>This function decodes a data structure stored in an eet file, returning a pointer to it if it decoded successfully, or NULL on failure. This can save a programmer dozens of hours of work in writing configuration file parsing and writing code, as eet does all that work for the program and presents a program-friendly data structure, just as the programmer likes. Eet can handle members being added or deleted from the data in storage and safely zero-fills unfilled members if they were not found in the data. It checks sizes and headers whenever it reads data, allowing the programmer to not worry about corrupt data.</p>
<p>Once a data structure has been described by the programmer with the fields they wish to save or load, storing or retrieving a data structure from an eet file, or from a chunk of memory is as simple as a single function call.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__Eet__Data__Group.html#ga4d1807cbbc448304f22a8808318a3429" title="Read a data structure from an eet file and decodes it.">eet_data_read()</a></dd></dl>
<dl class="since"><dt><b>Since:</b></dt><dd>1.0.0 </dd></dl>

<p>References <a class="el" href="eet__lib_8c_source.html#l01984">eet_dictionary_get()</a>, <a class="el" href="eet__lib_8c_source.html#l01571">eet_read_cipher()</a>, and <a class="el" href="eet__lib_8c_source.html#l01701">eet_read_direct()</a>.</p>

<p>Referenced by <a class="el" href="eet__data_8c_source.html#l01599">eet_data_read()</a>.</p>

</div>
</div>
<a class="anchor" id="gaa55cc17257b9b8be41d27eac87c8ad9c"></a><!-- doxytag: member="Eet.h::eet_data_text_dump_cipher" ref="gaa55cc17257b9b8be41d27eac87c8ad9c" args="(const void *data_in, const char *cipher_key, int size_in, void(*dumpfunc)(void *data, const char *str), void *dumpdata)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">EAPI int eet_data_text_dump_cipher </td>
          <td>(</td>
          <td class="paramtype">const void *&nbsp;</td>
          <td class="paramname"> <em>data_in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>cipher_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>size_in</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void(*)(void *data, const char *str)&nbsp;</td>
          <td class="paramname"> <em>dumpfunc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>dumpdata</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Dump an eet encoded data structure into ascii text using a cipher. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>data_in</em>&nbsp;</td><td>The pointer to the data to decode into a struct. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>cipher_key</em>&nbsp;</td><td>The key to use as cipher. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size_in</em>&nbsp;</td><td>The size of the data pointed to in bytes. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>dumpfunc</em>&nbsp;</td><td>The function to call passed a string when new data is converted to text </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>dumpdata</em>&nbsp;</td><td>The data to pass to the <code>dumpfunc</code> callback. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>1 on success, 0 on failure</dd></dl>
<p>This function will take a chunk of data encoded by <a class="el" href="group__Eet__Data__Group.html#gaa7c3b3a8cbeffc34c21dbbb1decc3c2d" title="Encode a dsata struct to memory and return that encoded data.">eet_data_descriptor_encode()</a> and convert it into human readable ascii text. It does this by calling the <code>dumpfunc</code> callback for all new text that is generated. This callback should append to any existing text buffer and will be passed the pointer <code>dumpdata</code> as a parameter as well as a string with new text to be appended.</p>
<p>Example:</p>
<div class="fragment"><pre class="fragment"> <span class="keywordtype">void</span> output(<span class="keywordtype">void</span> *data, <span class="keyword">const</span> <span class="keywordtype">char</span> *<span class="keywordtype">string</span>)
 {
   printf(<span class="stringliteral">&quot;%s&quot;</span>, <span class="keywordtype">string</span>);
 }

 <span class="keywordtype">void</span> dump(<span class="keyword">const</span> <span class="keywordtype">char</span> *file)
 {
   FILE *f;
   <span class="keywordtype">int</span> len;
   <span class="keywordtype">void</span> *data;

   f = fopen(file, <span class="stringliteral">&quot;r&quot;</span>);
   fseek(f, 0, SEEK_END);
   len = ftell(f);
   rewind(f);
   data = malloc(len);
   fread(data, len, 1, f);
   fclose(f);
   <a class="code" href="group__Eet__Data__Cipher__Group.html#gaa55cc17257b9b8be41d27eac87c8ad9c" title="Dump an eet encoded data structure into ascii text using a cipher.">eet_data_text_dump_cipher</a>(data, cipher_key, len, output, NULL);
 }
</pre></div><dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__Eet__Data__Group.html#ga73eea56513db9eeb5a0f30514471fa75" title="Dump an eet encoded data structure into ascii text.">eet_data_text_dump()</a></dd></dl>
<dl class="since"><dt><b>Since:</b></dt><dd>1.0.0 </dd></dl>

<p>References <a class="el" href="eet__node_8c_source.html#l00307">eet_node_del()</a>, and <a class="el" href="eet__node_8c_source.html#l00508">eet_node_dump()</a>.</p>

<p>Referenced by <a class="el" href="eet__data_8c_source.html#l03573">eet_data_text_dump()</a>.</p>

</div>
</div>
<a class="anchor" id="ga99e8a3acd6c3fbe552b0f9d474ae4f0d"></a><!-- doxytag: member="Eet.h::eet_data_text_undump_cipher" ref="ga99e8a3acd6c3fbe552b0f9d474ae4f0d" args="(const char *text, const char *cipher_key, int textlen, int *size_ret)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">EAPI void* eet_data_text_undump_cipher </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>cipher_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>textlen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&nbsp;</td>
          <td class="paramname"> <em>size_ret</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Take an ascii encoding from <a class="el" href="group__Eet__Data__Group.html#ga73eea56513db9eeb5a0f30514471fa75" title="Dump an eet encoded data structure into ascii text.">eet_data_text_dump()</a> and re-encode in binary using a cipher. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>text</em>&nbsp;</td><td>The pointer to the string data to parse and encode. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>cipher_key</em>&nbsp;</td><td>The key to use as cipher. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>textlen</em>&nbsp;</td><td>The size of the string in bytes (not including 0 byte terminator). </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>size_ret</em>&nbsp;</td><td>This gets filled in with the encoded data blob size in bytes. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The encoded data on success, NULL on failure.</dd></dl>
<p>This function will parse the string pointed to by <code>text</code> and return an encoded data lump the same way <a class="el" href="group__Eet__Data__Group.html#gaa7c3b3a8cbeffc34c21dbbb1decc3c2d" title="Encode a dsata struct to memory and return that encoded data.">eet_data_descriptor_encode()</a> takes an in-memory data struct and encodes into a binary blob. <code>text</code> is a normal C string.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__Eet__Data__Group.html#ga7ec4079e08e657a80bee05bd12e1b972" title="Take an ascii encoding from eet_data_text_dump() and re-encode in binary.">eet_data_text_undump()</a></dd></dl>
<dl class="since"><dt><b>Since:</b></dt><dd>1.0.0 </dd></dl>

<p>Referenced by <a class="el" href="eet__data_8c_source.html#l03611">eet_data_text_undump()</a>.</p>

</div>
</div>
<a class="anchor" id="ga58060eca71513b8634a32e076dc8dd85"></a><!-- doxytag: member="Eet.h::eet_data_undump_cipher" ref="ga58060eca71513b8634a32e076dc8dd85" args="(Eet_File *ef, const char *name, const char *cipher_key, const char *text, int textlen, int compress)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">EAPI int eet_data_undump_cipher </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__Eet__File__Group.html#ga8d9779184a9870c1a225f1f40c76e8a7">Eet_File</a> *&nbsp;</td>
          <td class="paramname"> <em>ef</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>cipher_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>text</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>textlen</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>compress</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Take an ascii encoding from <a class="el" href="group__Eet__Data__Group.html#gae4ead9639aa9d6ce0db2354b5636f56d" title="Dump an eet encoded data structure from an eet file into ascii text.">eet_data_dump()</a> and re-encode in binary using a cipher. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ef</em>&nbsp;</td><td>A valid eet file handle. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>Name of the entry. eg: "/base/file_i_want". </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>cipher_key</em>&nbsp;</td><td>The key to use as cipher. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>text</em>&nbsp;</td><td>The pointer to the string data to parse and encode. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>textlen</em>&nbsp;</td><td>The size of the string in bytes (not including 0 byte terminator). </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>compress</em>&nbsp;</td><td>Compression flags (1 == compress, 0 = don't compress). </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>1 on success, 0 on failure</dd></dl>
<p>This function will parse the string pointed to by <code>text</code>, encode it the same way <a class="el" href="group__Eet__Data__Group.html#gaa7c3b3a8cbeffc34c21dbbb1decc3c2d" title="Encode a dsata struct to memory and return that encoded data.">eet_data_descriptor_encode()</a> takes an in-memory data struct and encodes into a binary blob.</p>
<p>The data (optionally compressed) will be in ram, pending a flush to disk (it will stay in ram till the eet file handle is closed though).</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__Eet__Data__Group.html#gafb1d3207c31e349ed184645e21aa838d" title="Take an ascii encoding from eet_data_dump() and re-encode in binary.">eet_data_undump()</a></dd></dl>
<dl class="since"><dt><b>Since:</b></dt><dd>1.0.0 </dd></dl>

<p>References <a class="el" href="eet__lib_8c_source.html#l01984">eet_dictionary_get()</a>, and <a class="el" href="eet__lib_8c_source.html#l01757">eet_write_cipher()</a>.</p>

<p>Referenced by <a class="el" href="eet__data_8c_source.html#l03641">eet_data_undump()</a>.</p>

</div>
</div>
<a class="anchor" id="ga9e46230c55006296f141ed9a5807c759"></a><!-- doxytag: member="Eet.h::eet_data_write_cipher" ref="ga9e46230c55006296f141ed9a5807c759" args="(Eet_File *ef, Eet_Data_Descriptor *edd, const char *name, const char *cipher_key, const void *data, int compress)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">EAPI int eet_data_write_cipher </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__Eet__File__Group.html#ga8d9779184a9870c1a225f1f40c76e8a7">Eet_File</a> *&nbsp;</td>
          <td class="paramname"> <em>ef</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__Eet__Data__Group.html#ga4baec0e840012480a0958c5c3bca276d">Eet_Data_Descriptor</a> *&nbsp;</td>
          <td class="paramname"> <em>edd</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>cipher_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&nbsp;</td>
          <td class="paramname"> <em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>compress</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Write a data structure from memory and store in an eet file using a cipher. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>ef</em>&nbsp;</td><td>The eet file handle to write to. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>edd</em>&nbsp;</td><td>The data descriptor to use when encoding. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>name</em>&nbsp;</td><td>The key to store the data under in the eet file. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>cipher_key</em>&nbsp;</td><td>The key to use as cipher. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>A pointer to the data structure to ssave and encode. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>compress</em>&nbsp;</td><td>Compression flags for storage. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>bytes written on successful write, 0 on failure.</dd></dl>
<p>This function is the reverse of <a class="el" href="group__Eet__Data__Group.html#ga4d1807cbbc448304f22a8808318a3429" title="Read a data structure from an eet file and decodes it.">eet_data_read()</a>, saving a data structure to an eet file.</p>
<dl class="see"><dt><b>See also:</b></dt><dd><a class="el" href="group__Eet__Data__Cipher__Group.html#ga9e46230c55006296f141ed9a5807c759" title="Write a data structure from memory and store in an eet file using a cipher.">eet_data_write_cipher()</a></dd></dl>
<dl class="since"><dt><b>Since:</b></dt><dd>1.0.0 </dd></dl>

<p>References <a class="el" href="eet__lib_8c_source.html#l01984">eet_dictionary_get()</a>, and <a class="el" href="eet__lib_8c_source.html#l01757">eet_write_cipher()</a>.</p>

<p>Referenced by <a class="el" href="eet__data_8c_source.html#l01622">eet_data_write()</a>.</p>

</div>
</div>
</div>
 
 <div id="push"></div>
 </div> <!-- #content -->
  </div> <!-- .layout -->
 
 </div> <!-- #container -->
 
 
  <div id="footer">
    <table><tr>
      <td class="poweredby"><img src="doxygen.png"></td>
      <td class="copyright">Copyright &copy;2010 Enlightenment</td>
      <td class="generated">Docs generated Fri Jul 2 11:41:28 2010</td>
    </tr></table>
  </div>


</body>
</html>