Newer
Older
ubixos-old / doc / doxygen / html / ubixfs_8h-source.html
@CloudNine CloudNine on 8 May 2004 18 KB no message
<!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>Ubixos: ubixfs.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.3 -->
<h1>ubixfs.h</h1><a href="ubixfs_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/**************************************************************************************</span>
00002 <span class="comment"> Copyright (c) 2002 The UbixOS Project</span>
00003 <span class="comment"> All rights reserved.</span>
00004 <span class="comment"></span>
00005 <span class="comment">Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</span>
00006 <span class="comment"></span>
00007 <span class="comment">Redistributions of source code must retain the above copyright notice, this list of conditions, the following disclaimer and the list of authors.</span>
00008 <span class="comment">Redistributions in binary form must reproduce the above copyright notice, this list of conditions, the following disclaimer and the list of authors</span>
00009 <span class="comment">in the documentation and/or other materials provided with the distribution. Neither the name of the UbixOS Project nor the names of its</span>
00010 <span class="comment">contributors may be used to endorse or promote products derived from this software without specific prior written permission.</span>
00011 <span class="comment"></span>
00012 <span class="comment">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span>
00013 <span class="comment">WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR</span>
00014 <span class="comment">PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,</span>
00015 <span class="comment">INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE</span>
00016 <span class="comment">GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY</span>
00017 <span class="comment">OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY</span>
00018 <span class="comment">OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
00019 <span class="comment"></span>
00020 <span class="comment"> $Id$</span>
00021 <span class="comment"></span>
00022 <span class="comment">**************************************************************************************/</span>
00023 
00024 <span class="preprocessor">#ifndef _UBIXFS_H</span>
00025 <span class="preprocessor"></span><span class="preprocessor">#define _UBIXFS_H</span>
00026 <span class="preprocessor"></span>
00027 <span class="preprocessor">#include &lt;<a class="code" href="types_8h.html">ubixos/types.h</a>&gt;</span>
00028 <span class="preprocessor">#include &lt;<a class="code" href="device_8h.html">sys/device.h</a>&gt;</span>
00029 <span class="preprocessor">#include &lt;<a class="code" href="file_8h.html">vfs/file.h</a>&gt;</span>
00030 
<a name="l00031"></a><a class="code" href="ubixfs_8h.html#a0">00031</a> <span class="preprocessor">#define UBIXDISKMAGIC     ((uInt32)0x45) </span>
<a name="l00032"></a><a class="code" href="ubixfs_8h.html#a1">00032</a> <span class="preprocessor">#define MAXPARTITIONS     4</span>
<a name="l00033"></a><a class="code" href="ubixfs_8h.html#a2">00033</a> <span class="preprocessor"></span><span class="preprocessor">#define blockSize         8</span>
<a name="l00034"></a><a class="code" href="ubixfs_8h.html#a3">00034</a> <span class="preprocessor"></span><span class="preprocessor">#define blockByteSize     blockSize*512</span>
00035 <span class="preprocessor"></span>
<a name="l00036"></a><a class="code" href="ubixfs_8h.html#a4">00036</a> <span class="preprocessor">#define EOBC              -1</span>
00037 <span class="preprocessor"></span>
00038 
<a name="l00039"></a><a class="code" href="ubixfs_8h.html#a5">00039</a> <span class="preprocessor">#define typeFile      1</span>
<a name="l00040"></a><a class="code" href="ubixfs_8h.html#a6">00040</a> <span class="preprocessor"></span><span class="preprocessor">#define typeContainer 2</span>
<a name="l00041"></a><a class="code" href="ubixfs_8h.html#a7">00041</a> <span class="preprocessor"></span><span class="preprocessor">#define typeDirectory 4</span>
<a name="l00042"></a><a class="code" href="ubixfs_8h.html#a8">00042</a> <span class="preprocessor"></span><span class="preprocessor">#define typeDeleted   8</span>
00043 <span class="preprocessor"></span>
<a name="l00045"></a><a class="code" href="structubix_disk_label.html">00045</a> <span class="keyword">struct </span><a class="code" href="structubix_disk_label.html">ubixDiskLabel</a> {
<a name="l00046"></a><a class="code" href="structubix_disk_label.html#o0">00046</a>   <a class="code" href="types_8h.html#a3">uInt32</a> <a class="code" href="structubix_disk_label.html#o0">magicNum</a>; 
<a name="l00049"></a><a class="code" href="structubix_disk_label.html#o1">00049</a>   <a class="code" href="types_8h.html#a2">uInt16</a> <a class="code" href="structubix_disk_label.html#o1">numPartitions</a>; 
<a name="l00051"></a><a class="code" href="structubix_disk_label_1_1drive_partitions.html">00051</a>   <span class="keyword">struct  </span><a class="code" href="structubix_disk_label_1_1drive_partitions.html">drivePartitions</a> {
<a name="l00052"></a><a class="code" href="structubix_disk_label_1_1drive_partitions.html#o0">00052</a>     <a class="code" href="types_8h.html#a3">uInt32</a> <a class="code" href="structubix_disk_label_1_1drive_partitions.html#o0">pSize</a>; 
<a name="l00053"></a><a class="code" href="structubix_disk_label_1_1drive_partitions.html#o1">00053</a>     <a class="code" href="types_8h.html#a3">uInt32</a> <a class="code" href="structubix_disk_label_1_1drive_partitions.html#o1">pOffset</a>; 
<a name="l00054"></a><a class="code" href="structubix_disk_label_1_1drive_partitions.html#o2">00054</a>     <a class="code" href="types_8h.html#a3">uInt32</a> <a class="code" href="structubix_disk_label_1_1drive_partitions.html#o2">pFsSize</a>; 
<a name="l00055"></a><a class="code" href="structubix_disk_label_1_1drive_partitions.html#o3">00055</a>     <a class="code" href="types_8h.html#a3">uInt32</a> <a class="code" href="structubix_disk_label_1_1drive_partitions.html#o3">pBatSize</a>; 
<a name="l00056"></a><a class="code" href="structubix_disk_label_1_1drive_partitions.html#o4">00056</a>     <a class="code" href="types_8h.html#a1">uInt8</a>  <a class="code" href="structubix_disk_label_1_1drive_partitions.html#o4">pFsType</a>; 
<a name="l00057"></a><a class="code" href="structubix_disk_label_1_1drive_partitions.html#o5">00057</a>     <a class="code" href="types_8h.html#a1">uInt8</a> <a class="code" href="structubix_disk_label_1_1drive_partitions.html#o5">pFrag</a>; 
00058     } <a class="code" href="structubix_disk_label.html#o2">partitions</a>[<a class="code" href="ubixfs_8h.html#a1">MAXPARTITIONS</a>];
00059   };
00060 
<a name="l00061"></a><a class="code" href="structpartition_information.html">00061</a> <span class="keyword">struct </span><a class="code" href="structpartition_information.html">partitionInformation</a> {
<a name="l00062"></a><a class="code" href="structpartition_information.html#o0">00062</a>   <a class="code" href="types_8h.html#a3">uInt32</a> <a class="code" href="structpartition_information.html#o0">size</a>;                 
<a name="l00063"></a><a class="code" href="structpartition_information.html#o1">00063</a>   <a class="code" href="types_8h.html#a3">uInt32</a> <a class="code" href="structpartition_information.html#o1">startSector</a>;          
<a name="l00064"></a><a class="code" href="structpartition_information.html#o2">00064</a>   <a class="code" href="types_8h.html#a3">uInt32</a> <a class="code" href="structpartition_information.html#o2">blockAllocationTable</a>; 
<a name="l00065"></a><a class="code" href="structpartition_information.html#o3">00065</a>   <a class="code" href="types_8h.html#a3">uInt32</a> <a class="code" href="structpartition_information.html#o3">rootDirectory</a>;        
00066   };
00067 
<a name="l00069"></a><a class="code" href="structblock_allocation_table_entry.html">00069</a> <span class="keyword">struct </span><a class="code" href="structblock_allocation_table_entry.html">blockAllocationTableEntry</a> {
<a name="l00070"></a><a class="code" href="structblock_allocation_table_entry.html#o0">00070</a>   <span class="keywordtype">long</span> <a class="code" href="structblock_allocation_table_entry.html#o0">attributes</a>; 
<a name="l00071"></a><a class="code" href="structblock_allocation_table_entry.html#o1">00071</a>   <span class="keywordtype">long</span> <a class="code" href="structblock_allocation_table_entry.html#o1">realSector</a>; 
<a name="l00072"></a><a class="code" href="structblock_allocation_table_entry.html#o2">00072</a>   <span class="keywordtype">long</span> <a class="code" href="structblock_allocation_table_entry.html#o2">nextBlock</a>;  
<a name="l00073"></a><a class="code" href="structblock_allocation_table_entry.html#o3">00073</a>   <span class="keywordtype">long</span> <a class="code" href="structblock_allocation_table_entry.html#o3">reserved</a>;   
00074   };
00075 
<a name="l00077"></a><a class="code" href="structdirectory_entry.html">00077</a> <span class="keyword">struct </span><a class="code" href="structdirectory_entry.html">directoryEntry</a> {
<a name="l00078"></a><a class="code" href="structdirectory_entry.html#o0">00078</a>   <a class="code" href="types_8h.html#a3">uInt32</a>  <a class="code" href="structdirectory_entry.html#o0">startCluster</a>;   
<a name="l00079"></a><a class="code" href="structdirectory_entry.html#o1">00079</a>   <a class="code" href="types_8h.html#a3">uInt32</a>  <a class="code" href="structdirectory_entry.html#o1">size</a>;           
<a name="l00080"></a><a class="code" href="structdirectory_entry.html#o2">00080</a>   <a class="code" href="types_8h.html#a3">uInt32</a>  <a class="code" href="structdirectory_entry.html#o2">creationDate</a>;  
<a name="l00081"></a><a class="code" href="structdirectory_entry.html#o3">00081</a>   <a class="code" href="types_8h.html#a3">uInt32</a>  <a class="code" href="structdirectory_entry.html#o3">lastModified</a>;  
<a name="l00082"></a><a class="code" href="structdirectory_entry.html#o4">00082</a>   <a class="code" href="types_8h.html#a3">uInt32</a>  <a class="code" href="structdirectory_entry.html#o4">uid</a>;           
<a name="l00083"></a><a class="code" href="structdirectory_entry.html#o5">00083</a>   <a class="code" href="types_8h.html#a3">uInt32</a>  <a class="code" href="structdirectory_entry.html#o5">gid</a>;           
<a name="l00084"></a><a class="code" href="structdirectory_entry.html#o6">00084</a>   <a class="code" href="types_8h.html#a2">uInt16</a> <a class="code" href="structdirectory_entry.html#o6">attributes</a>;    
<a name="l00085"></a><a class="code" href="structdirectory_entry.html#o7">00085</a>   <a class="code" href="types_8h.html#a2">uInt16</a> <a class="code" href="structdirectory_entry.html#o7">permissions</a>;   
<a name="l00086"></a><a class="code" href="structdirectory_entry.html#o8">00086</a>   <span class="keywordtype">char</span>   <a class="code" href="structdirectory_entry.html#o8">fileName</a>[256]; 
00087 };
00088 
<a name="l00090"></a><a class="code" href="structboot_sect.html">00090</a> <span class="keyword">struct </span><a class="code" href="structboot_sect.html">bootSect</a> {
<a name="l00091"></a><a class="code" href="structboot_sect.html#o0">00091</a>   <a class="code" href="types_8h.html#a1">uInt8</a> <a class="code" href="structboot_sect.html#o0">jmp</a>[4]; 
<a name="l00092"></a><a class="code" href="structboot_sect.html#o1">00092</a>   <a class="code" href="types_8h.html#a1">uInt8</a> <a class="code" href="structboot_sect.html#o1">id</a>[6]; 
<a name="l00093"></a><a class="code" href="structboot_sect.html#o2">00093</a>   <a class="code" href="types_8h.html#a2">uInt16</a> <a class="code" href="structboot_sect.html#o2">version</a>; 
<a name="l00094"></a><a class="code" href="structboot_sect.html#o3">00094</a>   <a class="code" href="types_8h.html#a2">uInt16</a> <a class="code" href="structboot_sect.html#o3">tmp</a>;
<a name="l00095"></a><a class="code" href="structboot_sect.html#o4">00095</a>   <a class="code" href="types_8h.html#a2">uInt16</a> <a class="code" href="structboot_sect.html#o4">fsStart</a>; 
<a name="l00096"></a><a class="code" href="structboot_sect.html#o5">00096</a>   <a class="code" href="types_8h.html#a2">uInt16</a> <a class="code" href="structboot_sect.html#o5">tmp2</a>;
<a name="l00097"></a><a class="code" href="structboot_sect.html#o6">00097</a>   <a class="code" href="types_8h.html#a3">uInt32</a> <a class="code" href="structboot_sect.html#o6">krnl_start</a>; 
<a name="l00098"></a><a class="code" href="structboot_sect.html#o7">00098</a>   <a class="code" href="types_8h.html#a4">uInt</a> <a class="code" href="structboot_sect.html#o7">BytesPerSector</a>;
<a name="l00099"></a><a class="code" href="structboot_sect.html#o8">00099</a>   <a class="code" href="types_8h.html#a4">uInt</a> <a class="code" href="structboot_sect.html#o8">SectersPerTrack</a>;
<a name="l00100"></a><a class="code" href="structboot_sect.html#o9">00100</a>   <a class="code" href="types_8h.html#a4">uInt</a> <a class="code" href="structboot_sect.html#o9">TotalHeads</a>;
<a name="l00101"></a><a class="code" href="structboot_sect.html#o10">00101</a>   <a class="code" href="types_8h.html#a3">uInt32</a> <a class="code" href="structboot_sect.html#o10">TotalSectors</a>;
<a name="l00102"></a><a class="code" href="structboot_sect.html#o11">00102</a>   <a class="code" href="types_8h.html#a1">uInt8</a> <a class="code" href="structboot_sect.html#o11">code</a>[479]; 
00103   };  
00104 
<a name="l00106"></a><a class="code" href="structubix_fs_info.html">00106</a> <span class="keyword">struct </span><a class="code" href="structubix_fs_info.html">ubixFsInfo</a> {
<a name="l00107"></a><a class="code" href="structubix_fs_info.html#o0">00107</a>   <span class="keyword">struct </span><a class="code" href="structblock_allocation_table_entry.html">blockAllocationTableEntry</a> *<a class="code" href="structubix_fs_info.html#o0">blockAllocationTable</a>; 
<a name="l00108"></a><a class="code" href="structubix_fs_info.html#o1">00108</a>   <a class="code" href="types_8h.html#a3">uInt32</a> <a class="code" href="structubix_fs_info.html#o1">batEntries</a>; 
00109   };
00110 
00111 <span class="keywordtype">int</span> <a class="code" href="ubixfs_8h.html#a9">readFile</a>(<span class="keywordtype">char</span> *file);
00112 <span class="keywordtype">int</span> <a class="code" href="ubixfs_8h.html#a10">writeFileByte</a>(<span class="keywordtype">int</span> ch,<a class="code" href="structfile_descriptor_struct.html">fileDescriptor</a> *fd,<span class="keywordtype">long</span> offset);
00116 <span class="keywordtype">int</span> <a class="code" href="ubixfs_8h.html#a11">openFileUbixFS</a>(<span class="keywordtype">char</span> *file,<a class="code" href="structfile_descriptor_struct.html">fileDescriptor</a> *fd);
00118 <span class="keywordtype">int</span> <a class="code" href="ubixfs_8h.html#a12">mkDirUbixFS</a>(<span class="keywordtype">char</span> *dir,<a class="code" href="structfile_descriptor_struct.html">fileDescriptor</a> *fd);
00119 <span class="keywordtype">int</span> <a class="code" href="ubixfs_8h.html#a13">getFreeBlocks</a>(<span class="keywordtype">int</span> count,<a class="code" href="structfile_descriptor_struct.html">fileDescriptor</a> *fd);
00120 
00121 <span class="comment">//Good Functions</span>
00124 <span class="comment"></span><span class="keywordtype">int</span> <a class="code" href="ubixfs_8h.html#a14">enableUbixFS</a>();
00127 <span class="keywordtype">void</span> <a class="code" href="ubixfs_8h.html#a15">initUbixFS</a>(<span class="keyword">struct</span> <a class="code" href="structmount_points.html">mountPoints</a> *mp);
00130 <span class="keywordtype">int</span> <a class="code" href="ubixfs_8h.html#a16">readUbixFS</a>(<a class="code" href="structfile_descriptor_struct.html">fileDescriptor</a> *fd,<span class="keywordtype">char</span> *data,<span class="keywordtype">long</span> offset,<span class="keywordtype">long</span> size);
00133 <span class="keywordtype">int</span> <a class="code" href="ubixfs_8h.html#a17">writeUbixFS</a>(<a class="code" href="structfile_descriptor_struct.html">fileDescriptor</a> *fd,<span class="keywordtype">char</span> *data,<span class="keywordtype">long</span> offset,<span class="keywordtype">long</span> size);
00134 <span class="keywordtype">void</span> <a class="code" href="ubixfs_8h.html#a18">syncBat</a>(<span class="keyword">struct</span> <a class="code" href="structmount_points.html">mountPoints</a> *mp);
00135 <span class="keywordtype">int</span> <a class="code" href="ubixfs_8h.html#a19">freeBlocks</a>(<span class="keywordtype">int</span> block,<a class="code" href="structfile_descriptor_struct.html">fileDescriptor</a> *fd);
00136 <span class="comment">/* Adds a file to a directory. Returns 0 */</span>
00137 <span class="keywordtype">int</span> <a class="code" href="ubixfs_8h.html#a20">addDirEntry</a>(<span class="keyword">struct</span> <a class="code" href="structdirectory_entry.html">directoryEntry</a> *dir,<a class="code" href="structfile_descriptor_struct.html">fileDescriptor</a> *fd);
00139 <span class="keywordtype">void</span> <a class="code" href="ubixfs_8h.html#a21">ubixFSUnlink</a>(<span class="keywordtype">char</span> *path,<span class="keyword">struct</span> <a class="code" href="structmount_points.html">mountPoints</a> *mp);
00140 
00141 <span class="preprocessor">#endif</span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Sat May 8 09:28:18 2004 for Ubixos by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
</a>1.3.3 </small></address>
</body>
</html>