<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<doxygen xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="compound.xsd" version="1.8.16">
  <compounddef id="main_8cpp" kind="file" language="C++">
    <compoundname>main.cpp</compoundname>
    <briefdescription>
    </briefdescription>
    <detaileddescription>
    </detaileddescription>
    <programlisting>
<codeline lineno="1"><highlight class="comment">/*</highlight></codeline>
<codeline lineno="2"><highlight class="comment"><sp/>#include<sp/>&lt;iostream&gt;</highlight></codeline>
<codeline lineno="3"><highlight class="comment">#include<sp/>&lt;vector&gt;</highlight></codeline>
<codeline lineno="4"><highlight class="comment">#include<sp/>&lt;stdlib.h&gt;</highlight></codeline>
<codeline lineno="5"><highlight class="comment">#include<sp/>&quot;vfs.h&quot;</highlight></codeline>
<codeline lineno="6"><highlight class="comment">#include<sp/>&quot;btree.h&quot;</highlight></codeline>
<codeline lineno="7"><highlight class="comment">#include<sp/>&quot;ubixfs.h&quot;</highlight></codeline>
<codeline lineno="8"><highlight class="comment">#include<sp/>&quot;device.h&quot;</highlight></codeline>
<codeline lineno="9"><highlight class="comment">#include<sp/>&quot;ramdrive.h&quot;</highlight></codeline>
<codeline lineno="10"><highlight class="comment">using<sp/>namespace<sp/>std;</highlight></codeline>
<codeline lineno="11"><highlight class="comment"></highlight></codeline>
<codeline lineno="12"><highlight class="comment">int</highlight></codeline>
<codeline lineno="13"><highlight class="comment">main(void)<sp/>{</highlight></codeline>
<codeline lineno="14"><highlight class="comment"></highlight></codeline>
<codeline lineno="15"><highlight class="comment"><sp/><sp/>device_t<sp/>*<sp/>ramDrive<sp/>=<sp/>dev_ramDrive();</highlight></codeline>
<codeline lineno="16"><highlight class="comment"><sp/><sp/>UbixFS<sp/>*<sp/>fs<sp/>=<sp/>new<sp/>UbixFS(ramDrive);</highlight></codeline>
<codeline lineno="17"><highlight class="comment"><sp/><sp/>fs-&gt;vfs_format(ramDrive);</highlight></codeline>
<codeline lineno="18"><highlight class="comment"><sp/><sp/>fs-&gt;vfs_init();<sp/></highlight></codeline>
<codeline lineno="19"><highlight class="comment"><sp/><sp/>fs-&gt;vfs_mkdir(&quot;/testdir&quot;,<sp/>0);</highlight></codeline>
<codeline lineno="20"><highlight class="comment"><sp/><sp/>fs-&gt;vfs_stop();</highlight></codeline>
<codeline lineno="21"><highlight class="comment"><sp/><sp/>dev_ramDestroy();</highlight></codeline>
<codeline lineno="22"><highlight class="comment"></highlight></codeline>
<codeline lineno="23"><highlight class="comment">#if<sp/>0</highlight></codeline>
<codeline lineno="24"><highlight class="comment"><sp/><sp/>int<sp/>i<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="25"><highlight class="comment"><sp/><sp/>ubixfsInode<sp/>*<sp/>inode<sp/>=<sp/>(ubixfsInode<sp/>*)malloc(sizeof(ubixfsInode));</highlight></codeline>
<codeline lineno="26"><highlight class="comment"><sp/><sp/>memset(inode,<sp/>0,<sp/>sizeof(ubixfsInode));</highlight></codeline>
<codeline lineno="27"><highlight class="comment"><sp/><sp/>strcpy(inode<sp/>-&gt;<sp/>name,<sp/>&quot;50&quot;);</highlight></codeline>
<codeline lineno="28"><highlight class="comment"><sp/><sp/>bTree<sp/>*<sp/>tree<sp/>=<sp/>new<sp/>bTree(&quot;.&quot;,<sp/>inode);</highlight></codeline>
<codeline lineno="29"><highlight class="comment"></highlight></codeline>
<codeline lineno="30"><highlight class="comment"><sp/><sp/>for<sp/>(i<sp/>=<sp/>0;<sp/>i<sp/>&lt;<sp/>100;<sp/>i++)<sp/>{</highlight></codeline>
<codeline lineno="31"><highlight class="comment">//<sp/><sp/>while<sp/>(tree-&gt;Verify())<sp/>{</highlight></codeline>
<codeline lineno="32"><highlight class="comment">//<sp/><sp/><sp/><sp/>if<sp/>(i%1000<sp/>==<sp/>0)<sp/>cout<sp/>&lt;&lt;<sp/>&quot;-_-<sp/>i<sp/>=<sp/>&quot;&lt;&lt;i&lt;&lt;&quot;<sp/>-_-&quot;<sp/>&lt;&lt;<sp/>endl;</highlight></codeline>
<codeline lineno="33"><highlight class="comment"><sp/><sp/><sp/><sp/>inode<sp/>=<sp/>(ubixfsInode<sp/>*)malloc(sizeof(ubixfsInode));</highlight></codeline>
<codeline lineno="34"><highlight class="comment"><sp/><sp/><sp/><sp/>if<sp/>(inode<sp/>==<sp/>NULL)<sp/>break;</highlight></codeline>
<codeline lineno="35"><highlight class="comment"><sp/><sp/><sp/><sp/>memset(inode,<sp/>0,<sp/>sizeof(ubixfsInode));</highlight></codeline>
<codeline lineno="36"><highlight class="comment"><sp/><sp/><sp/><sp/>for<sp/>(int<sp/>k<sp/>=<sp/>0;<sp/>k<sp/>&lt;<sp/>(random()<sp/>%<sp/>100)+5;<sp/>k++)<sp/>{</highlight></codeline>
<codeline lineno="37"><highlight class="comment">//<sp/><sp/><sp/><sp/>for<sp/>(int<sp/>k<sp/>=<sp/>0;<sp/>k<sp/>&lt;<sp/>100;<sp/>k++)<sp/>{</highlight></codeline>
<codeline lineno="38"><highlight class="comment"><sp/><sp/><sp/><sp/><sp/><sp/>inode-&gt;name[k]<sp/>=<sp/>(char)((random()<sp/>%<sp/>26)+&apos;a&apos;);</highlight></codeline>
<codeline lineno="39"><highlight class="comment"><sp/><sp/><sp/><sp/>}<sp/>//<sp/>for<sp/>k</highlight></codeline>
<codeline lineno="40"><highlight class="comment">//<sp/><sp/><sp/><sp/><sp/>tree-&gt;Insert(inode);</highlight></codeline>
<codeline lineno="41"><highlight class="comment"><sp/><sp/><sp/><sp/>if<sp/>(!tree-&gt;Insert(inode-&gt;name,<sp/>inode))<sp/>cout<sp/>&lt;&lt;<sp/>&quot;Insert(&quot;<sp/>&lt;&lt;<sp/>inode-&gt;name<sp/>&lt;&lt;<sp/>&quot;)<sp/>failed&quot;<sp/>&lt;&lt;<sp/>endl;</highlight></codeline>
<codeline lineno="42"><highlight class="comment">//<sp/><sp/><sp/><sp/>++i;</highlight></codeline>
<codeline lineno="43"><highlight class="comment"><sp/><sp/>}<sp/>//<sp/>for<sp/>i</highlight></codeline>
<codeline lineno="44"><highlight class="comment">//<sp/><sp/>cout<sp/>&lt;&lt;<sp/>&quot;i<sp/>made<sp/>it<sp/>to:<sp/>&quot;<sp/>&lt;&lt;<sp/>i<sp/>&lt;&lt;<sp/>endl;</highlight></codeline>
<codeline lineno="45"><highlight class="comment"></highlight></codeline>
<codeline lineno="46"><highlight class="comment"><sp/><sp/>i<sp/>=<sp/>0;</highlight></codeline>
<codeline lineno="47"><highlight class="comment"><sp/><sp/>ubixfsInode<sp/>*<sp/>tmpInode<sp/>=<sp/>tmpInode<sp/>=<sp/>tree-&gt;GetFirstNode();</highlight></codeline>
<codeline lineno="48"><highlight class="comment"><sp/><sp/>if<sp/>(tmpInode<sp/>==<sp/>NULL)<sp/>cout<sp/>&lt;&lt;<sp/>&quot;GetFirstNode()<sp/>returns<sp/>null&quot;<sp/>&lt;&lt;<sp/>endl;</highlight></codeline>
<codeline lineno="49"><highlight class="comment"><sp/><sp/>while<sp/>(tmpInode<sp/>!=<sp/>NULL)<sp/>{</highlight></codeline>
<codeline lineno="50"><highlight class="comment"><sp/><sp/><sp/><sp/>//cout<sp/>&lt;&lt;<sp/>&quot;node[&quot;<sp/>&lt;&lt;<sp/>i++<sp/>&lt;&lt;<sp/>&quot;]:<sp/>&quot;<sp/>&lt;&lt;<sp/>tmpInode-&gt;name<sp/>&lt;&lt;<sp/>endl;</highlight></codeline>
<codeline lineno="51"><highlight class="comment"><sp/><sp/><sp/><sp/>cout<sp/>&lt;&lt;<sp/>tmpInode-&gt;name<sp/>&lt;&lt;<sp/>endl;</highlight></codeline>
<codeline lineno="52"><highlight class="comment"><sp/><sp/><sp/><sp/>tmpInode<sp/>=<sp/>tmpInode-&gt;next.iPtr;</highlight></codeline>
<codeline lineno="53"><highlight class="comment"><sp/><sp/>}<sp/>//<sp/>while</highlight></codeline>
<codeline lineno="54"><highlight class="comment"></highlight></codeline>
<codeline lineno="55"><highlight class="comment"></highlight></codeline>
<codeline lineno="56"><highlight class="comment">//<sp/><sp/>tree-&gt;Info();</highlight></codeline>
<codeline lineno="57"><highlight class="comment"><sp/><sp/>tree-&gt;Save(&quot;tree.dat&quot;);</highlight></codeline>
<codeline lineno="58"><highlight class="comment"><sp/><sp/>free(inode);</highlight></codeline>
<codeline lineno="59"><highlight class="comment"><sp/><sp/>delete<sp/>tree;</highlight></codeline>
<codeline lineno="60"><highlight class="comment">#endif</highlight></codeline>
<codeline lineno="61"><highlight class="comment"><sp/><sp/>cout<sp/>&lt;&lt;<sp/>&quot;sizeof(bNode):<sp/>&quot;<sp/>&lt;&lt;<sp/>sizeof(struct<sp/>bNode)<sp/>&lt;&lt;<sp/>endl;</highlight></codeline>
<codeline lineno="62"><highlight class="comment"><sp/><sp/>cout<sp/>&lt;&lt;<sp/>&quot;sizeof(ubixfsInode):<sp/>&quot;<sp/>&lt;&lt;<sp/>sizeof(struct<sp/>ubixfsInode)<sp/>&lt;&lt;<sp/>endl;</highlight></codeline>
<codeline lineno="63"><highlight class="comment"><sp/><sp/>cout<sp/>&lt;&lt;<sp/>&quot;sizeof(diskSuperBlock):<sp/>&quot;<sp/>&lt;&lt;<sp/>sizeof(struct<sp/>diskSuperBlock)<sp/>&lt;&lt;<sp/>endl;</highlight></codeline>
<codeline lineno="64"><highlight class="comment"><sp/><sp/>cout<sp/>&lt;&lt;<sp/>&quot;sizeof(bTreeHeader):<sp/>&quot;<sp/>&lt;&lt;<sp/>sizeof(struct<sp/>bTreeHeader)<sp/>&lt;&lt;<sp/>endl;</highlight></codeline>
<codeline lineno="65"><highlight class="comment"><sp/><sp/>return<sp/>0;</highlight></codeline>
<codeline lineno="66"><highlight class="comment">}</highlight></codeline>
<codeline lineno="67"><highlight class="comment">*/</highlight><highlight class="normal"></highlight></codeline>
    </programlisting>
    <location file="C:/Dev/git/UbixOS/sys/fs/ubixfsv2/main.cpp"/>
  </compounddef>
</doxygen>
