223 lines
22 KiB
Plaintext
223 lines
22 KiB
Plaintext
|
<!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=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"File/Internal"</span><span class=cF0>
|
||
|
<a name="l2"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>DirTreeSerializeSize</span><span class=cF0>(</span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde)
|
||
|
<a name="l3"></a>{
|
||
|
<a name="l4"></a> </span><span class=cF9>I64</span><span class=cF0> res=0;
|
||
|
<a name="l5"></a> </span><span class=cF1>while</span><span class=cF0> (tmpde) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l6"></a> res+=</span><span class=cF3>CDIR_SIZE</span><span class=cF0>+1;
|
||
|
<a name="l7"></a> </span><span class=cF1>if</span><span class=cF0> (tmpde->attr & </span><span class=cF3>RS_ATTR_DIR</span><span class=cF0>)
|
||
|
<a name="l8"></a> res+=</span><span class=cF5>DirTreeSerializeSize</span><span class=cF0>(tmpde->sub);
|
||
|
<a name="l9"></a> tmpde=tmpde->next;
|
||
|
<a name="l10"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l11"></a> </span><span class=cF1>return</span><span class=cF0> res+1;
|
||
|
<a name="l12"></a>}
|
||
|
<a name="l13"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>DirTreeSerializeFill</span><span class=cF0>(</span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde,</span><span class=cF1>U8</span><span class=cF0> *dst)
|
||
|
<a name="l14"></a>{
|
||
|
<a name="l15"></a> </span><span class=cF9>I64</span><span class=cF0> res=0,i;
|
||
|
<a name="l16"></a> </span><span class=cF1>while</span><span class=cF0> (tmpde) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l17"></a> *dst++=1;
|
||
|
<a name="l18"></a> res++;
|
||
|
<a name="l19"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(dst,&tmpde-></span><span class=cF1>start</span><span class=cF0>,</span><span class=cF3>CDIR_SIZE</span><span class=cF0>);
|
||
|
<a name="l20"></a> dst+=</span><span class=cF3>CDIR_SIZE</span><span class=cF0>;
|
||
|
<a name="l21"></a> res+=</span><span class=cF3>CDIR_SIZE</span><span class=cF0>;
|
||
|
<a name="l22"></a> </span><span class=cF1>if</span><span class=cF0> (tmpde->attr & </span><span class=cF3>RS_ATTR_DIR</span><span class=cF0>) {
|
||
|
<a name="l23"></a> i=</span><span class=cF5>DirTreeSerializeFill</span><span class=cF0>(tmpde->sub,dst);
|
||
|
<a name="l24"></a> dst+=i;
|
||
|
<a name="l25"></a> res+=i;
|
||
|
<a name="l26"></a> }
|
||
|
<a name="l27"></a> tmpde=tmpde->next;
|
||
|
<a name="l28"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l29"></a> *dst=0;
|
||
|
<a name="l30"></a> </span><span class=cF1>return</span><span class=cF0> res+1;
|
||
|
<a name="l31"></a>}
|
||
|
<a name="l32"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>DirTreeSerialize</span><span class=cF0>(</span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde,</span><span class=cF9>I64</span><span class=cF0> *_size=</span><span class=cF3>NULL</span><span class=cF0>)
|
||
|
<a name="l33"></a>{</span><span class=cF2>//Serialize tree returned from </span><a href="/Wb/Kernel/BlkDev/DskFind.HC.HTML#l27"><span class=cF4>FilesFind</span></a><span class=cF2>() into a one contiguous U8 array.</span><span class=cF0>
|
||
|
<a name="l34"></a> </span><span class=cF9>I64</span><span class=cF0> size=</span><span class=cF5>DirTreeSerializeSize</span><span class=cF0>(tmpde);
|
||
|
<a name="l35"></a> </span><span class=cF1>U8</span><span class=cF0> *buf=</span><span class=cF5>MAlloc</span><span class=cF0>(size);
|
||
|
<a name="l36"></a> </span><span class=cF5>DirTreeSerializeFill</span><span class=cF0>(tmpde,buf);
|
||
|
<a name="l37"></a> </span><span class=cF1>if</span><span class=cF0> (_size) *_size=size;
|
||
|
<a name="l38"></a> </span><span class=cF1>return</span><span class=cF0> buf;
|
||
|
<a name="l39"></a>}
|
||
|
<a name="l40"></a>
|
||
|
<a name="l41"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>DirTreeUnserialize2</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *src,</span><span class=cF9>CDirEntry</span><span class=cF0> **tmpde)
|
||
|
<a name="l42"></a>{
|
||
|
<a name="l43"></a> </span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde1;
|
||
|
<a name="l44"></a> </span><span class=cF1>if</span><span class=cF0> (*src++) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l45"></a> tmpde1=</span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CDirEntry</span><span class=cF7>)</span><span class=cF0>);
|
||
|
<a name="l46"></a> *tmpde=tmpde1;
|
||
|
<a name="l47"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(&tmpde1-></span><span class=cF1>start</span><span class=cF0>,src,</span><span class=cF3>CDIR_SIZE</span><span class=cF0>);
|
||
|
<a name="l48"></a> src+=</span><span class=cF3>CDIR_SIZE</span><span class=cF0>;
|
||
|
<a name="l49"></a> </span><span class=cF1>if</span><span class=cF0> (tmpde1->attr & </span><span class=cF3>RS_ATTR_DIR</span><span class=cF0>)
|
||
|
<a name="l50"></a> src=</span><span class=cF5>DirTreeUnserialize2</span><span class=cF0>(src,&tmpde1->sub);
|
||
|
<a name="l51"></a> src=</span><span class=cF5>DirTreeUnserialize2</span><span class=cF0>(src,&tmpde1->next);
|
||
|
<a name="l52"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l53"></a> *tmpde=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l54"></a> </span><span class=cF1>return</span><span class=cF0> src;
|
||
|
<a name="l55"></a>}
|
||
|
<a name="l56"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>CDirEntry</span><span class=cF0> *</span><span class=cF5>DirTreeUnserialize</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *src)
|
||
|
<a name="l57"></a>{</span><span class=cF2>//Unserialize tree to make it like a tree returned from </span><a href="/Wb/Kernel/BlkDev/DskFind.HC.HTML#l27"><span class=cF4>FilesFind</span></a><span class=cF2>().</span><span class=cF0>
|
||
|
<a name="l58"></a> </span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l59"></a> </span><span class=cF5>DirTreeUnserialize2</span><span class=cF0>(src,&tmpde);
|
||
|
<a name="l60"></a> </span><span class=cF1>return</span><span class=cF0> tmpde;
|
||
|
<a name="l61"></a>}
|
||
|
<a name="l62"></a>
|
||
|
<a name="l63"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"File/Program Routines"</span><span class=cF0>
|
||
|
<a name="l64"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>FOFlatten</span><span class=cF0>(</span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde,</span><span class=cF9>CDirEntry</span><span class=cF0> **a,</span><span class=cF9>I64</span><span class=cF0> *i)
|
||
|
<a name="l65"></a>{
|
||
|
<a name="l66"></a> </span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde1;
|
||
|
<a name="l67"></a> </span><span class=cF1>while</span><span class=cF0> (tmpde) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l68"></a> tmpde1=tmpde->next;
|
||
|
<a name="l69"></a> </span><span class=cF1>if</span><span class=cF0> (tmpde->attr&</span><span class=cF3>RS_ATTR_DIR</span><span class=cF0>) {
|
||
|
<a name="l70"></a> </span><span class=cF5>FOFlatten</span><span class=cF0>(tmpde->sub,a,i);
|
||
|
<a name="l71"></a> </span><span class=cF5>DirEntryDel</span><span class=cF0>(tmpde);
|
||
|
<a name="l72"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l73"></a> a[*i]=tmpde;
|
||
|
<a name="l74"></a> *i=*i+1;
|
||
|
<a name="l75"></a> }
|
||
|
<a name="l76"></a> tmpde=tmpde1;
|
||
|
<a name="l77"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l78"></a>}
|
||
|
<a name="l79"></a>
|
||
|
<a name="l80"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>Size1</span><span class=cF0>(</span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde,</span><span class=cF9>I64</span><span class=cF0> *_fuf_flags,</span><span class=cF9>I64</span><span class=cF0> round_to)
|
||
|
<a name="l81"></a>{
|
||
|
<a name="l82"></a> </span><span class=cF1>U8</span><span class=cF0> buf[</span><span class=cF3>BLK_SIZE</span><span class=cF0>];
|
||
|
<a name="l83"></a> </span><span class=cF9>I64</span><span class=cF0> res=0,i;
|
||
|
<a name="l84"></a> </span><span class=cF9>CDrv</span><span class=cF0> *dv;
|
||
|
<a name="l85"></a> </span><span class=cF1>while</span><span class=cF0> (tmpde) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l86"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>i=tmpde->size</span><span class=cF7>)</span><span class=cF0> && </span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>_fuf_flags,</span><span class=cF3>FUf_EXPAND</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l87"></a> !</span><span class=cF7>(</span><span class=cF0>tmpde->attr&</span><span class=cF3>RS_ATTR_DIR</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l88"></a> </span><span class=cF5>FileAttr</span><span class=cF7>(</span><span class=cF0>tmpde->name</span><span class=cF7>)</span><span class=cF0>&</span><span class=cF3>RS_ATTR_COMPRESSED</span><span class=cF0>) {
|
||
|
<a name="l89"></a> dv=</span><span class=cF5>Let2Drv</span><span class=cF0>(*tmpde->full_name);
|
||
|
<a name="l90"></a> </span><span class=cF5>BlkRead</span><span class=cF0>(dv,buf,</span><span class=cF5>Clus2Blk</span><span class=cF7>(</span><span class=cF0>dv,tmpde->clus</span><span class=cF7>)</span><span class=cF0>,1);
|
||
|
<a name="l91"></a> i=(&buf)(</span><span class=cF9>CArcCompress</span><span class=cF0> *)->expanded_size;
|
||
|
<a name="l92"></a> }
|
||
|
<a name="l93"></a> </span><span class=cF1>if</span><span class=cF0> (round_to)
|
||
|
<a name="l94"></a> i=</span><span class=cF5>CeilU64</span><span class=cF0>(tmpde->size,round_to);
|
||
|
<a name="l95"></a> </span><span class=cF1>if</span><span class=cF0> (tmpde->attr&</span><span class=cF3>RS_ATTR_DIR</span><span class=cF0>)
|
||
|
<a name="l96"></a> i+=</span><span class=cF5>Size1</span><span class=cF0>(tmpde->sub,_fuf_flags,round_to);
|
||
|
<a name="l97"></a> tmpde->user_data=i;
|
||
|
<a name="l98"></a> res+=i;
|
||
|
<a name="l99"></a> tmpde=tmpde->next;
|
||
|
<a name="l100"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l101"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
||
|
<a name="l102"></a>}
|
||
|
<a name="l103"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>Size</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *files_find_mask=</span><span class=cF6>"/*"</span><span class=cF0>,</span><span class=cF1>U8</span><span class=cF0> *fu_flags=</span><span class=cF3>NULL</span><span class=cF0>,</span><span class=cF9>I64</span><span class=cF0> round_to=0)
|
||
|
<a name="l104"></a>{</span><span class=cF2>//Total size of files in mask. "+x" for expanded size.</span><span class=cF0>
|
||
|
<a name="l105"></a></span><span class=cF2>//Does not include directory size of base directory, but</span><span class=cF0>
|
||
|
<a name="l106"></a> </span><span class=cF2>//does include size of sub directories.</span><span class=cF0>
|
||
|
<a name="l107"></a> </span><span class=cF9>I64</span><span class=cF0> fuf_flags=0,res=0;
|
||
|
<a name="l108"></a> </span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde1=</span><span class=cF3>NULL</span><span class=cF0>;
|
||
|
<a name="l109"></a> </span><span class=cF5>ScanFlags</span><span class=cF0>(&fuf_flags,</span><span class=cF5>Define</span><span class=cF7>(</span><span class=cF6>"ST_FILE_UTIL_FLAGS"</span><span class=cF7>)</span><span class=cF0>,</span><span class=cF6>"+r"</span><span class=cF0>);
|
||
|
<a name="l110"></a> </span><span class=cF5>ScanFlags</span><span class=cF0>(&fuf_flags,</span><span class=cF5>Define</span><span class=cF7>(</span><span class=cF6>"ST_FILE_UTIL_FLAGS"</span><span class=cF7>)</span><span class=cF0>,fu_flags);
|
||
|
<a name="l111"></a> </span><span class=cF1>if</span><span class=cF0> (tmpde1=</span><span class=cF5>FilesFind</span><span class=cF7>(</span><span class=cF0>files_find_mask,fuf_flags&</span><span class=cF3>FUG_FILES_FIND</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l112"></a> fuf_flags&=</span><span class=cF3>FUF_EXPAND</span><span class=cF0>;
|
||
|
<a name="l113"></a> res=</span><span class=cF5>Size1</span><span class=cF0>(tmpde1,&fuf_flags,round_to);
|
||
|
<a name="l114"></a> </span><span class=cF5>DirTreeDel</span><span class=cF0>(tmpde1);
|
||
|
<a name="l115"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l116"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
||
|
<a name="l117"></a>}
|
||
|
<a name="l118"></a>
|
||
|
<a name="l119"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>FileCnt</span><span class=cF0>(</span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde)
|
||
|
<a name="l120"></a>{</span><span class=cF2>//Cnt of files in </span><a href="/Wb/Kernel/KernelA.HH.HTML#l2520"><span class=cF4>CDirEntry</span></a><span class=cF2> tree.</span><span class=cF0>
|
||
|
<a name="l121"></a> </span><span class=cF9>I64</span><span class=cF0> cnt=0;
|
||
|
<a name="l122"></a> </span><span class=cF1>while</span><span class=cF0> (tmpde) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l123"></a> </span><span class=cF1>if</span><span class=cF0> (tmpde->attr&</span><span class=cF3>RS_ATTR_DIR</span><span class=cF0>)
|
||
|
<a name="l124"></a> cnt+=</span><span class=cF5>FileCnt</span><span class=cF0>(tmpde->sub);
|
||
|
<a name="l125"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l126"></a> cnt++;
|
||
|
<a name="l127"></a> tmpde=tmpde->next;
|
||
|
<a name="l128"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l129"></a> </span><span class=cF1>return</span><span class=cF0> cnt;
|
||
|
<a name="l130"></a>}
|
||
|
<a name="l131"></a>
|
||
|
<a name="l132"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"File/Cmd Line (Typically);Cmd Line (Typically)"</span><span class=cF0>
|
||
|
<a name="l133"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>FF</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *files_find_mask,</span><span class=cF1>U8</span><span class=cF0> *fu_flags=</span><span class=cF3>NULL</span><span class=cF0>)
|
||
|
<a name="l134"></a>{</span><span class=cF2>//Files find. List files matching mask.</span><span class=cF0>
|
||
|
<a name="l135"></a> </span><span class=cF9>I64</span><span class=cF0> cnt=0,fuf_flags=0;
|
||
|
<a name="l136"></a> </span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde,*tmpde1;
|
||
|
<a name="l137"></a> </span><span class=cF5>ScanFlags</span><span class=cF0>(&fuf_flags,</span><span class=cF5>Define</span><span class=cF7>(</span><span class=cF6>"ST_FILE_UTIL_FLAGS"</span><span class=cF7>)</span><span class=cF0>,</span><span class=cF6>"+r+f+F"</span><span class=cF0>);
|
||
|
<a name="l138"></a> </span><span class=cF5>ScanFlags</span><span class=cF0>(&fuf_flags,</span><span class=cF5>Define</span><span class=cF7>(</span><span class=cF6>"ST_FILE_UTIL_FLAGS"</span><span class=cF7>)</span><span class=cF0>,fu_flags);
|
||
|
<a name="l139"></a> tmpde=tmpde1=</span><span class=cF5>FilesFind</span><span class=cF0>(files_find_mask,fuf_flags);
|
||
|
<a name="l140"></a> </span><span class=cF1>while</span><span class=cF0> (tmpde) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l141"></a> </span><span class=cF5>PutFileLink</span><span class=cF0>(tmpde->full_name);
|
||
|
<a name="l142"></a> </span><span class=cF6>'\n'</span><span class=cF0>;
|
||
|
<a name="l143"></a> cnt++;
|
||
|
<a name="l144"></a> tmpde=tmpde->next;
|
||
|
<a name="l145"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l146"></a> </span><span class=cF5>DirTreeDel</span><span class=cF0>(tmpde1);
|
||
|
<a name="l147"></a> </span><span class=cF1>return</span><span class=cF0> cnt;
|
||
|
<a name="l148"></a>}
|
||
|
<a name="l149"></a>
|
||
|
<a name="l150"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>Zip</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *files_find_mask=</span><span class=cF6>"*"</span><span class=cF0>,</span><span class=cF1>U8</span><span class=cF0> *fu_flags=</span><span class=cF3>NULL</span><span class=cF0>)
|
||
|
<a name="l151"></a>{</span><span class=cF2>//Compress files by moving to .Z filename.</span><span class=cF0>
|
||
|
<a name="l152"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
|
||
|
<a name="l153"></a> </span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde,*tmpde1;
|
||
|
<a name="l154"></a> </span><span class=cF9>I64</span><span class=cF0> res=0,fuf_flags=0;
|
||
|
<a name="l155"></a> </span><span class=cF5>ScanFlags</span><span class=cF0>(&fuf_flags,</span><span class=cF5>Define</span><span class=cF7>(</span><span class=cF6>"ST_FILE_UTIL_FLAGS"</span><span class=cF7>)</span><span class=cF0>,</span><span class=cF6>"+r+f+F+O"</span><span class=cF0>);
|
||
|
<a name="l156"></a> </span><span class=cF5>ScanFlags</span><span class=cF0>(&fuf_flags,</span><span class=cF5>Define</span><span class=cF7>(</span><span class=cF6>"ST_FILE_UTIL_FLAGS"</span><span class=cF7>)</span><span class=cF0>,fu_flags);
|
||
|
<a name="l157"></a> tmpde=tmpde1=</span><span class=cF5>FilesFind</span><span class=cF0>(files_find_mask,fuf_flags);
|
||
|
<a name="l158"></a> </span><span class=cF1>while</span><span class=cF0> (tmpde) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l159"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>IsDotZ</span><span class=cF7>(</span><span class=cF0>tmpde->full_name</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l160"></a> st=</span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"%s.Z"</span><span class=cF0>,tmpde->full_name);
|
||
|
<a name="l161"></a> res+=</span><span class=cF5>Move</span><span class=cF0>(tmpde->full_name,st);
|
||
|
<a name="l162"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
||
|
<a name="l163"></a> }
|
||
|
<a name="l164"></a> tmpde=tmpde->next;
|
||
|
<a name="l165"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l166"></a> </span><span class=cF5>DirTreeDel</span><span class=cF0>(tmpde1);
|
||
|
<a name="l167"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
||
|
<a name="l168"></a>}
|
||
|
<a name="l169"></a>
|
||
|
<a name="l170"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>Unzip</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *files_find_mask=</span><span class=cF6>"*.Z"</span><span class=cF0>,</span><span class=cF1>U8</span><span class=cF0> *fu_flags=</span><span class=cF3>NULL</span><span class=cF0>)
|
||
|
<a name="l171"></a>{</span><span class=cF2>//Uncompress files by moving to not .Z filename.</span><span class=cF0>
|
||
|
<a name="l172"></a></span><span class=cF2>//You don't have to do this for normal operation.</span><span class=cF0>
|
||
|
<a name="l173"></a> </span><span class=cF2>//It automatically unzips ".Z" files.</span><span class=cF0>
|
||
|
<a name="l174"></a> </span><span class=cF1>U8</span><span class=cF0> *st;
|
||
|
<a name="l175"></a> </span><span class=cF9>CDirEntry</span><span class=cF0> *tmpde,*tmpde1;
|
||
|
<a name="l176"></a> </span><span class=cF9>I64</span><span class=cF0> res=0,fuf_flags=0;
|
||
|
<a name="l177"></a> </span><span class=cF5>ScanFlags</span><span class=cF0>(&fuf_flags,</span><span class=cF5>Define</span><span class=cF7>(</span><span class=cF6>"ST_FILE_UTIL_FLAGS"</span><span class=cF7>)</span><span class=cF0>,</span><span class=cF6>"+r+f+F+O"</span><span class=cF0>);
|
||
|
<a name="l178"></a> </span><span class=cF5>ScanFlags</span><span class=cF0>(&fuf_flags,</span><span class=cF5>Define</span><span class=cF7>(</span><span class=cF6>"ST_FILE_UTIL_FLAGS"</span><span class=cF7>)</span><span class=cF0>,fu_flags);
|
||
|
<a name="l179"></a> tmpde=tmpde1=</span><span class=cF5>FilesFind</span><span class=cF0>(files_find_mask,fuf_flags);
|
||
|
<a name="l180"></a> </span><span class=cF1>while</span><span class=cF0> (tmpde) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l181"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsDotZ</span><span class=cF7>(</span><span class=cF0>tmpde->full_name</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l182"></a> st=</span><span class=cF5>StrNew</span><span class=cF0>(tmpde->full_name);
|
||
|
<a name="l183"></a> </span><span class=cF5>StrLastRem</span><span class=cF0>(st,</span><span class=cF6>"."</span><span class=cF0>);
|
||
|
<a name="l184"></a> res+=</span><span class=cF5>Move</span><span class=cF0>(tmpde->full_name,st);
|
||
|
<a name="l185"></a> </span><span class=cF5>Free</span><span class=cF0>(st);
|
||
|
<a name="l186"></a> }
|
||
|
<a name="l187"></a> tmpde=tmpde->next;
|
||
|
<a name="l188"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l189"></a> </span><span class=cF5>DirTreeDel</span><span class=cF0>(tmpde1);
|
||
|
<a name="l190"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
||
|
<a name="l191"></a>}
|
||
|
</span></pre></body>
|
||
|
</html>
|