templeos-info/public/Wb/Kernel/BlkDev/DskStrB.HC.HTML

121 lines
9.6 KiB
HTML
Executable File

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="generator" content="TempleOS V5.03">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="/style/templeos.css">
<script src="/script/templeos.js"></script>
<style type="text/css">
.cF0{color:#000000;background-color:#ffffff;}
.cF1{color:#0000aa;background-color:#ffffff;}
.cF2{color:#00aa00;background-color:#ffffff;}
.cF3{color:#00aaaa;background-color:#ffffff;}
.cF4{color:#aa0000;background-color:#ffffff;}
.cF5{color:#aa00aa;background-color:#ffffff;}
.cF6{color:#aa5500;background-color:#ffffff;}
.cF7{color:#aaaaaa;background-color:#ffffff;}
.cF8{color:#555555;background-color:#ffffff;}
.cF9{color:#5555ff;background-color:#ffffff;}
.cFA{color:#55ff55;background-color:#ffffff;}
.cFB{color:#55ffff;background-color:#ffffff;}
.cFC{color:#ff5555;background-color:#ffffff;}
.cFD{color:#ff55ff;background-color:#ffffff;}
.cFE{color:#ffff55;background-color:#ffffff;}
.cFF{color:#ffffff;background-color:#ffffff;}
</style>
</head>
<body>
<pre id="content">
<a name="l1"></a><span class=cF1>Bool</span><span class=cF0> </span><span class=cFD>CFileNameTo</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *dst,</span><span class=cF1>U8</span><span class=cF0> *src)
<a name="l2"></a>{
<a name="l3"></a> </span><span class=cF5>MemSet</span><span class=cF0>(dst,0,</span><span class=cF3>CDIR_FILENAME_LEN</span><span class=cF0>);
<a name="l4"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>FileNameChk</span><span class=cF7>(</span><span class=cF0>src</span><span class=cF7>)</span><span class=cF0>)
<a name="l5"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
<a name="l6"></a> </span><span class=cF5>StrCpy</span><span class=cF0>(dst,src);
<a name="l7"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
<a name="l8"></a>}
<a name="l9"></a>
<a name="l10"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>Name2DirClus</span><span class=cF0>(</span><span class=cF9>CDrv</span><span class=cF0> *dv,</span><span class=cF1>U8</span><span class=cF0> *dirname)
<a name="l11"></a>{
<a name="l12"></a> </span><span class=cF1>Bool</span><span class=cF0> cont=</span><span class=cF3>TRUE</span><span class=cF0>,unlock;
<a name="l13"></a> </span><span class=cF9>I64</span><span class=cF0> cur_dir_clus;
<a name="l14"></a> </span><span class=cF9>CDirEntry</span><span class=cF0> de;
<a name="l15"></a> </span><span class=cF1>U8</span><span class=cF0> *buf=</span><span class=cF5>StrNew</span><span class=cF0>(dirname),*buf2=</span><span class=cF5>StrNew</span><span class=cF0>(dirname);
<a name="l16"></a> </span><span class=cF5>DrvChk</span><span class=cF0>(dv);
<a name="l17"></a> </span><span class=cF1>try</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l18"></a> unlock=</span><span class=cF5>DrvLock</span><span class=cF0>(dv);
<a name="l19"></a> cur_dir_clus=dv-&gt;root_clus;
<a name="l20"></a> </span><span class=cF1>while</span><span class=cF0> (*buf &amp;&amp; cont) {
<a name="l21"></a> </span><span class=cF5>StrFirstRem</span><span class=cF0>(buf,</span><span class=cF6>&quot;/&quot;</span><span class=cF0>,buf2);
<a name="l22"></a> </span><span class=cF1>if</span><span class=cF0> (*buf2) </span><span class=cF7>{</span><span class=cF0>
<a name="l23"></a> </span><span class=cF1>switch</span><span class=cF0> (dv-&gt;fs_type) {
<a name="l24"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>FSt_REDSEA</span><span class=cF0>:
<a name="l25"></a> cont=</span><span class=cFD>RedSeaFileFind</span><span class=cF0>(dv,cur_dir_clus,buf2,&amp;de,</span><span class=cF3>FUF_JUST_DIRS</span><span class=cF0>);
<a name="l26"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l27"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>FSt_FAT32</span><span class=cF0>:
<a name="l28"></a> cont=</span><span class=cFD>FAT32FileFind</span><span class=cF0>(dv,cur_dir_clus,buf2,&amp;de,</span><span class=cF3>FUF_JUST_DIRS</span><span class=cF0>);
<a name="l29"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l30"></a> </span><span class=cF1>default</span><span class=cF0>:
<a name="l31"></a> </span><span class=cF5>throw</span><span class=cF0>(</span><span class=cF6>'Drv'</span><span class=cF0>);
<a name="l32"></a> }
<a name="l33"></a> cur_dir_clus=de.clus;
<a name="l34"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l35"></a> }
<a name="l36"></a> </span><span class=cF1>if</span><span class=cF0> (!cont) {
<a name="l37"></a> </span><span class=cF5>PrintErr</span><span class=cF0>(</span><span class=cF6>&quot;File not found: \&quot;%s\&quot;.\n&quot;</span><span class=cF0>,dirname);
<a name="l38"></a> cur_dir_clus=0;
<a name="l39"></a> }
<a name="l40"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
<a name="l41"></a> </span><span class=cF5>DrvUnlock</span><span class=cF0>(dv);
<a name="l42"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>catch</span><span class=cF0>
<a name="l43"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
<a name="l44"></a> </span><span class=cF5>DrvUnlock</span><span class=cF0>(dv);
<a name="l45"></a> </span><span class=cF5>Free</span><span class=cF0>(buf);
<a name="l46"></a> </span><span class=cF5>Free</span><span class=cF0>(buf2);
<a name="l47"></a> </span><span class=cF1>return</span><span class=cF0> cur_dir_clus;
<a name="l48"></a>}
<a name="l49"></a>
<a name="l50"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>Name2ParentDirClus</span><span class=cF0>(</span><span class=cF9>CDrv</span><span class=cF0> *dv,</span><span class=cF1>U8</span><span class=cF0> *dirname)
<a name="l51"></a>{
<a name="l52"></a> </span><span class=cF1>Bool</span><span class=cF0> cont=</span><span class=cF3>TRUE</span><span class=cF0>,unlock;
<a name="l53"></a> </span><span class=cF9>I64</span><span class=cF0> cur_dir_clus,cur_dir_clus2;
<a name="l54"></a> </span><span class=cF9>CDirEntry</span><span class=cF0> de;
<a name="l55"></a> </span><span class=cF1>U8</span><span class=cF0> *buf=</span><span class=cF5>StrNew</span><span class=cF0>(dirname),*buf2=</span><span class=cF5>StrNew</span><span class=cF0>(dirname);
<a name="l56"></a> </span><span class=cF5>DrvChk</span><span class=cF0>(dv);
<a name="l57"></a> </span><span class=cF1>try</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
<a name="l58"></a> unlock=</span><span class=cF5>DrvLock</span><span class=cF0>(dv);
<a name="l59"></a> cur_dir_clus=cur_dir_clus2=dv-&gt;root_clus;
<a name="l60"></a> </span><span class=cF1>while</span><span class=cF0> (*buf &amp;&amp; cont) {
<a name="l61"></a> cur_dir_clus2=cur_dir_clus;
<a name="l62"></a> </span><span class=cF5>StrFirstRem</span><span class=cF0>(buf,</span><span class=cF6>&quot;/&quot;</span><span class=cF0>,buf2);
<a name="l63"></a> </span><span class=cF1>if</span><span class=cF0> (*buf2) </span><span class=cF7>{</span><span class=cF0>
<a name="l64"></a> </span><span class=cF1>switch</span><span class=cF0> (dv-&gt;fs_type) {
<a name="l65"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>FSt_REDSEA</span><span class=cF0>:
<a name="l66"></a> cont=</span><span class=cFD>RedSeaFileFind</span><span class=cF0>(dv,cur_dir_clus,buf2,&amp;de,</span><span class=cF3>FUF_JUST_DIRS</span><span class=cF0>);
<a name="l67"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l68"></a> </span><span class=cF1>case</span><span class=cF0> </span><span class=cF3>FSt_FAT32</span><span class=cF0>:
<a name="l69"></a> cont=</span><span class=cFD>FAT32FileFind</span><span class=cF0>(dv,cur_dir_clus,buf2,&amp;de,</span><span class=cF3>FUF_JUST_DIRS</span><span class=cF0>);
<a name="l70"></a> </span><span class=cF1>break</span><span class=cF0>;
<a name="l71"></a> </span><span class=cF1>default</span><span class=cF0>:
<a name="l72"></a> </span><span class=cF5>throw</span><span class=cF0>(</span><span class=cF6>'Drv'</span><span class=cF0>);
<a name="l73"></a> }
<a name="l74"></a> cur_dir_clus=de.clus;
<a name="l75"></a> </span><span class=cF7>}</span><span class=cF0>
<a name="l76"></a> }
<a name="l77"></a> </span><span class=cF1>if</span><span class=cF0> (!cont) {
<a name="l78"></a> </span><span class=cF5>PrintErr</span><span class=cF0>(</span><span class=cF6>&quot;File not found: \&quot;%s\&quot;.\n&quot;</span><span class=cF0>,dirname);
<a name="l79"></a> cur_dir_clus2=0;
<a name="l80"></a> }
<a name="l81"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
<a name="l82"></a> </span><span class=cF5>DrvUnlock</span><span class=cF0>(dv);
<a name="l83"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>catch</span><span class=cF0>
<a name="l84"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
<a name="l85"></a> </span><span class=cF5>DrvUnlock</span><span class=cF0>(dv);
<a name="l86"></a> </span><span class=cF5>Free</span><span class=cF0>(buf);
<a name="l87"></a> </span><span class=cF5>Free</span><span class=cF0>(buf2);
<a name="l88"></a> </span><span class=cF1>return</span><span class=cF0> cur_dir_clus2;
<a name="l89"></a>}
</span></pre></body>
</html>