235 lines
26 KiB
HTML
Executable File
235 lines
26 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=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"Registry"</span><span class=cF0>
|
|
<a name="l2"></a>#</span><span class=cF1>define</span><span class=cF0> </span><span class=cF3>REGISTRY_FILENAME</span><span class=cF0> </span><span class=cF6>"~/Registry.HC.Z"</span><span class=cF0>
|
|
<a name="l3"></a></span><span class=cF9>CDoc</span><span class=cF0> *</span><span class=cFB>sys_registry_doc</span><span class=cF0>=</span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l4"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cFB>sys_msg_flags</span><span class=cF0>[1]={0};
|
|
<a name="l5"></a></span><span class=cF1>F64</span><span class=cF0> </span><span class=cFB>registry_version</span><span class=cF0>;
|
|
<a name="l6"></a>
|
|
<a name="l7"></a></span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>RegCache</span><span class=cF0>()
|
|
<a name="l8"></a>{
|
|
<a name="l9"></a> </span><span class=cF1>Bool</span><span class=cF0> old_silent;
|
|
<a name="l10"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cFB>sys_registry_doc</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l11"></a> old_silent=</span><span class=cF5>Silent</span><span class=cF0>;
|
|
<a name="l12"></a> </span><span class=cFB>sys_registry_doc</span><span class=cF0>=</span><span class=cF5>DocRead</span><span class=cF0>(</span><span class=cF3>REGISTRY_FILENAME</span><span class=cF0>);
|
|
<a name="l13"></a> </span><span class=cF5>Silent</span><span class=cF0>(old_silent);
|
|
<a name="l14"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l15"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l16"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l17"></a>}
|
|
<a name="l18"></a>
|
|
<a name="l19"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>RegDft</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *path,</span><span class=cF1>U8</span><span class=cF0> *val,</span><span class=cF1>Bool</span><span class=cF0> is_adam_entry=</span><span class=cF3>FALSE</span><span class=cF0>)
|
|
<a name="l20"></a>{</span><span class=cF2>//Add code doc tree branch to registry.</span><span class=cF0>
|
|
<a name="l21"></a> </span><span class=cF1>Bool</span><span class=cF0> res,unlock_doc;
|
|
<a name="l22"></a> </span><span class=cF5>RegCache</span><span class=cF0>;
|
|
<a name="l23"></a> unlock_doc=</span><span class=cF5>DocLock</span><span class=cF0>(</span><span class=cFB>sys_registry_doc</span><span class=cF0>);
|
|
<a name="l24"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>DocTreeFind</span><span class=cF7>(</span><span class=cFB>sys_registry_doc</span><span class=cF0>,path</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l25"></a> </span><span class=cF5>DocTreeMake</span><span class=cF0>(</span><span class=cFB>sys_registry_doc</span><span class=cF0>,path);
|
|
<a name="l26"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(</span><span class=cFB>sys_registry_doc</span><span class=cF0>,</span><span class=cF6>"%s"</span><span class=cF0>,val);
|
|
<a name="l27"></a> </span><span class=cF1>if</span><span class=cF0> (is_adam_entry) {
|
|
<a name="l28"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Fs</span><span class=cF0>==</span><span class=cFB>adam_task</span><span class=cF0>)
|
|
<a name="l29"></a> </span><span class=cF5>ExePrint</span><span class=cF0>(</span><span class=cF6>"%s"</span><span class=cF0>,val);
|
|
<a name="l30"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l31"></a> </span><span class=cF5>Adam</span><span class=cF0>(</span><span class=cF6>"%s"</span><span class=cF0>,val);
|
|
<a name="l32"></a> }
|
|
<a name="l33"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DrvIsWritable</span><span class=cF7>(</span><span class=cF0>*</span><span class=cFB>sys_registry_doc</span><span class=cF0>->filename.name</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l34"></a> </span><span class=cF5>DocWrite</span><span class=cF0>(</span><span class=cFB>sys_registry_doc</span><span class=cF0>);
|
|
<a name="l35"></a> res=</span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l36"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l37"></a> res=</span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l38"></a> </span><span class=cF1>if</span><span class=cF0> (unlock_doc)
|
|
<a name="l39"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(</span><span class=cFB>sys_registry_doc</span><span class=cF0>);
|
|
<a name="l40"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l41"></a>}
|
|
<a name="l42"></a>
|
|
<a name="l43"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>RegExe</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *path)
|
|
<a name="l44"></a>{</span><span class=cF2>//Execute doc tree branch in registry.</span><span class=cF0>
|
|
<a name="l45"></a> </span><span class=cF5>RegCache</span><span class=cF0>;
|
|
<a name="l46"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>DocTreeExe</span><span class=cF0>(</span><span class=cFB>sys_registry_doc</span><span class=cF0>,path);
|
|
<a name="l47"></a>}
|
|
<a name="l48"></a>
|
|
<a name="l49"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>RegWrite</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *path,</span><span class=cF1>U8</span><span class=cF0> *fmt,...)
|
|
<a name="l50"></a>{</span><span class=cF2>//Rewrite doc tree branch in registry.</span><span class=cF0>
|
|
<a name="l51"></a> </span><span class=cF1>Bool</span><span class=cF0> res;
|
|
<a name="l52"></a> </span><span class=cF5>RegCache</span><span class=cF0>;
|
|
<a name="l53"></a> res=</span><span class=cF5>DocTreeWriteJoin</span><span class=cF0>(</span><span class=cFB>sys_registry_doc</span><span class=cF0>,path,</span><span class=cF3>TRUE</span><span class=cF0>,fmt,argc,argv);
|
|
<a name="l54"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l55"></a>}
|
|
<a name="l56"></a>
|
|
<a name="l57"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>RegCnt</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *path)
|
|
<a name="l58"></a>{</span><span class=cF2>//Tree branch cnt in registry.</span><span class=cF0>
|
|
<a name="l59"></a> </span><span class=cF9>I64</span><span class=cF0> res=0;
|
|
<a name="l60"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *tree_branch,*start_indent,*end_indent;
|
|
<a name="l61"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock_doc=</span><span class=cF5>DocLock</span><span class=cF0>(</span><span class=cFB>sys_registry_doc</span><span class=cF0>);
|
|
<a name="l62"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>DocTreeFind</span><span class=cF7>(</span><span class=cFB>sys_registry_doc</span><span class=cF0>,path,
|
|
<a name="l63"></a> &tree_branch,&start_indent,&end_indent</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l64"></a> end_indent=end_indent->next;
|
|
<a name="l65"></a> </span><span class=cF1>while</span><span class=cF0> (start_indent!=end_indent) {
|
|
<a name="l66"></a> res++;
|
|
<a name="l67"></a> start_indent=start_indent->next;
|
|
<a name="l68"></a> }
|
|
<a name="l69"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l70"></a> </span><span class=cF1>if</span><span class=cF0> (unlock_doc)
|
|
<a name="l71"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(</span><span class=cFB>sys_registry_doc</span><span class=cF0>);
|
|
<a name="l72"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l73"></a>}
|
|
<a name="l74"></a>
|
|
<a name="l75"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>RegAppend</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *path,</span><span class=cF1>U8</span><span class=cF0> *fmt,...)
|
|
<a name="l76"></a>{</span><span class=cF2>//Append to doc tree branch in registry.</span><span class=cF0>
|
|
<a name="l77"></a> </span><span class=cF1>Bool</span><span class=cF0> res;
|
|
<a name="l78"></a> </span><span class=cF5>RegCache</span><span class=cF0>;
|
|
<a name="l79"></a> res=</span><span class=cF5>DocTreeAppendJoin</span><span class=cF0>(</span><span class=cFB>sys_registry_doc</span><span class=cF0>,path,</span><span class=cF3>TRUE</span><span class=cF0>,fmt,argc,argv);
|
|
<a name="l80"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l81"></a>}
|
|
<a name="l82"></a>
|
|
<a name="l83"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>Bool</span><span class=cF0> </span><span class=cF5>OneTimePopUp</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *_flags,</span><span class=cF9>I64</span><span class=cF0> flag_num,</span><span class=cF1>U8</span><span class=cF0> *msg)
|
|
<a name="l84"></a>{</span><span class=cF2>//See </span><a href="/Wb/Apps/X-Caliber/X-Caliber.HC.HTML#l1"><span class=cF4>::/Apps/X-Caliber/X-Caliber.HC</span></a><span class=cF2>.</span><span class=cF0>
|
|
<a name="l85"></a> </span><span class=cF1>Bool</span><span class=cF0> res=</span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l86"></a> </span><span class=cF9>CDoc</span><span class=cF0> *doc=</span><span class=cF5>DocNew</span><span class=cF0>;
|
|
<a name="l87"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_e;
|
|
<a name="l88"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>_flags,flag_num</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l89"></a> </span><span class=cF1>if</span><span class=cF0> (msg) </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%s"</span><span class=cF0>,msg);
|
|
<a name="l90"></a> doc_e=</span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"\n$CB,\"Do not show this msg again.\",LE=1$"</span><span class=cF0>);
|
|
<a name="l91"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"$CM+CX,0,4$$BT,\"OKAY\",LE=1$\n"</span><span class=cF0>);
|
|
<a name="l92"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>PopUpMenu</span><span class=cF7>(</span><span class=cF0>doc</span><span class=cF7>)</span><span class=cF0>==1 && doc_e->de_flags&</span><span class=cF3>DOCEF_CHECKED_COLLAPSED</span><span class=cF0>) {
|
|
<a name="l93"></a> </span><span class=cF5>LBts</span><span class=cF0>(_flags,flag_num);
|
|
<a name="l94"></a> res=</span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l95"></a> }
|
|
<a name="l96"></a> </span><span class=cF5>DocDel</span><span class=cF0>(doc);
|
|
<a name="l97"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l98"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l99"></a>}
|
|
<a name="l100"></a>
|
|
<a name="l101"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>RegOneTimePopUp</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> flag_num,</span><span class=cF1>U8</span><span class=cF0> *msg)
|
|
<a name="l102"></a>{</span><span class=cF2>//You're not supposed to make system pop-up flags, only me.</span><span class=cF0>
|
|
<a name="l103"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>OneTimePopUp</span><span class=cF7>(</span><span class=cFB>sys_msg_flags</span><span class=cF0>,flag_num,msg</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l104"></a> </span><span class=cF5>RegWrite</span><span class=cF0>(</span><span class=cF6>"Adam/SysMsgFlags"</span><span class=cF0>,</span><span class=cF6>"sys_msg_flags[0]=0x%X;\n"</span><span class=cF0>,
|
|
<a name="l105"></a> </span><span class=cFB>sys_msg_flags</span><span class=cF0>[0]);
|
|
<a name="l106"></a>}
|
|
<a name="l107"></a>
|
|
<a name="l108"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>RegInit</span><span class=cF0>()
|
|
<a name="l109"></a>{
|
|
<a name="l110"></a> </span><span class=cF1>U8</span><span class=cF0> buf[</span><span class=cF3>STR_LEN</span><span class=cF0>];
|
|
<a name="l111"></a> </span><span class=cF1>Bool</span><span class=cF0> version_present;
|
|
<a name="l112"></a> </span><span class=cF5>RegDft</span><span class=cF0>(</span><span class=cF6>"Adam/SysMsgFlags"</span><span class=cF0>,</span><span class=cF6>"sys_msg_flags[0]=0;\n"</span><span class=cF0>,</span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<a name="l113"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(buf,</span><span class=cF6>"registry_version=%4.3f;\n"</span><span class=cF0>,</span><span class=cFB>sys_os_version</span><span class=cF0>);
|
|
<a name="l114"></a> version_present=</span><span class=cF5>RegDft</span><span class=cF0>(</span><span class=cF6>"Adam/SysRegVer"</span><span class=cF0>,buf,</span><span class=cF3>TRUE</span><span class=cF0>);
|
|
<a name="l115"></a> </span><span class=cF5>RegExe</span><span class=cF0>(</span><span class=cF6>"Adam"</span><span class=cF0>);
|
|
<a name="l116"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFB>registry_version</span><span class=cF0>!=</span><span class=cFB>sys_os_version</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l117"></a> </span><span class=cF5>RegWrite</span><span class=cF0>(</span><span class=cF6>"Adam/SysRegVer"</span><span class=cF0>,buf);
|
|
<a name="l118"></a> </span><span class=cF5>RegExe</span><span class=cF0>(</span><span class=cF6>"Adam"</span><span class=cF0>);
|
|
<a name="l119"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l120"></a>}
|
|
<a name="l121"></a>
|
|
<a name="l122"></a>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"Boot/Once;Registry/Once"</span><span class=cF0>
|
|
<a name="l123"></a>#</span><span class=cF1>help_file</span><span class=cF0> </span><span class=cF6>"::/Doc/Once"</span><span class=cF0>
|
|
<a name="l124"></a>
|
|
<a name="l125"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>AOnceFlush</span><span class=cF0>()
|
|
<a name="l126"></a>{</span><span class=cF2>//Flush AOnce() buf.</span><span class=cF0>
|
|
<a name="l127"></a> </span><span class=cF5>RegWrite</span><span class=cF0>(</span><span class=cF6>"Once/Adam"</span><span class=cF0>,</span><span class=cF6>""</span><span class=cF0>);
|
|
<a name="l128"></a>}
|
|
<a name="l129"></a>
|
|
<a name="l130"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>OnceFlush</span><span class=cF0>()
|
|
<a name="l131"></a>{</span><span class=cF2>//Flush Once() buf.</span><span class=cF0>
|
|
<a name="l132"></a> </span><span class=cF5>RegWrite</span><span class=cF0>(</span><span class=cF6>"Once/User"</span><span class=cF0>,</span><span class=cF6>""</span><span class=cF0>);
|
|
<a name="l133"></a>}
|
|
<a name="l134"></a>
|
|
<a name="l135"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>AOnce</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *fmt,...)
|
|
<a name="l136"></a>{</span><span class=cF2>//Add Adam code to </span><a href="/Wb/Home/Registry.HC.HTML#l1"><span class=cF4>~/Registry.HC</span></a><span class=cF2>, executed next boot.</span><span class=cF0>
|
|
<a name="l137"></a> </span><span class=cF1>U8</span><span class=cF0> *buf=</span><span class=cF5>StrPrintJoin</span><span class=cF0>(</span><span class=cF3>NULL</span><span class=cF0>,fmt,argc,argv);
|
|
<a name="l138"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&</span><span class=cFB>sys_run_level</span><span class=cF0>,</span><span class=cF3>RLf_ONCE_ADAM</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l139"></a> </span><span class=cF5>AOnceFlush</span><span class=cF0>;
|
|
<a name="l140"></a> </span><span class=cF5>RegAppend</span><span class=cF0>(</span><span class=cF6>"Once/Adam"</span><span class=cF0>,</span><span class=cF6>"%s\n"</span><span class=cF0>,buf);
|
|
<a name="l141"></a> </span><span class=cF5>Free</span><span class=cF0>(buf);
|
|
<a name="l142"></a>}
|
|
<a name="l143"></a>
|
|
<a name="l144"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>Once</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *fmt,...)
|
|
<a name="l145"></a>{</span><span class=cF2>//Add User code to </span><a href="/Wb/Home/Registry.HC.HTML#l1"><span class=cF4>~/Registry.HC</span></a><span class=cF2>, executed next boot.</span><span class=cF0>
|
|
<a name="l146"></a> </span><span class=cF1>U8</span><span class=cF0> *buf=</span><span class=cF5>StrPrintJoin</span><span class=cF0>(</span><span class=cF3>NULL</span><span class=cF0>,fmt,argc,argv);
|
|
<a name="l147"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&</span><span class=cFB>sys_run_level</span><span class=cF0>,</span><span class=cF3>RLf_ONCE_USER</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l148"></a> </span><span class=cF5>OnceFlush</span><span class=cF0>;
|
|
<a name="l149"></a> </span><span class=cF5>RegAppend</span><span class=cF0>(</span><span class=cF6>"Once/User"</span><span class=cF0>,</span><span class=cF6>"%s\n"</span><span class=cF0>,buf);
|
|
<a name="l150"></a> </span><span class=cF5>Free</span><span class=cF0>(buf);
|
|
<a name="l151"></a>}
|
|
<a name="l152"></a>
|
|
<a name="l153"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>AOnceDrv</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> drv_let=0,</span><span class=cF1>U8</span><span class=cF0> *fmt,...)
|
|
<a name="l154"></a>{</span><span class=cF2>//Add Adam code to drv </span><a href="/Wb/Home/Registry.HC.HTML#l1"><span class=cF4>~/Registry.HC</span></a><span class=cF2>, executed next boot.</span><span class=cF0>
|
|
<a name="l155"></a> </span><span class=cF1>U8</span><span class=cF0> *buf=</span><span class=cF5>StrPrintJoin</span><span class=cF0>(</span><span class=cF3>NULL</span><span class=cF0>,fmt,argc,argv);
|
|
<a name="l156"></a> </span><span class=cF9>I64</span><span class=cF0> old_drv_let=*</span><span class=cFB>sys_registry_doc</span><span class=cF0>->filename.name;
|
|
<a name="l157"></a> </span><span class=cF1>if</span><span class=cF0> (drv_let)
|
|
<a name="l158"></a> *</span><span class=cFB>sys_registry_doc</span><span class=cF0>->filename.name=drv_let;
|
|
<a name="l159"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&</span><span class=cFB>sys_run_level</span><span class=cF0>,</span><span class=cF3>RLf_ONCE_ADAM</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l160"></a> </span><span class=cF5>AOnceFlush</span><span class=cF0>;
|
|
<a name="l161"></a> </span><span class=cF5>RegAppend</span><span class=cF0>(</span><span class=cF6>"Once/Adam"</span><span class=cF0>,</span><span class=cF6>"%s\n"</span><span class=cF0>,buf);
|
|
<a name="l162"></a> </span><span class=cF5>Free</span><span class=cF0>(buf);
|
|
<a name="l163"></a> *</span><span class=cFB>sys_registry_doc</span><span class=cF0>->filename.name=old_drv_let;
|
|
<a name="l164"></a>}
|
|
<a name="l165"></a>
|
|
<a name="l166"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>OnceDrv</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> drv_let=0,</span><span class=cF1>U8</span><span class=cF0> *fmt,...)
|
|
<a name="l167"></a>{</span><span class=cF2>//Add User code to drv </span><a href="/Wb/Home/Registry.HC.HTML#l1"><span class=cF4>~/Registry.HC</span></a><span class=cF2>, executed next boot.</span><span class=cF0>
|
|
<a name="l168"></a> </span><span class=cF1>U8</span><span class=cF0> *buf=</span><span class=cF5>StrPrintJoin</span><span class=cF0>(</span><span class=cF3>NULL</span><span class=cF0>,fmt,argc,argv);
|
|
<a name="l169"></a> </span><span class=cF9>I64</span><span class=cF0> old_drv_let=*</span><span class=cFB>sys_registry_doc</span><span class=cF0>->filename.name;
|
|
<a name="l170"></a> </span><span class=cF1>if</span><span class=cF0> (drv_let)
|
|
<a name="l171"></a> *</span><span class=cFB>sys_registry_doc</span><span class=cF0>->filename.name=drv_let;
|
|
<a name="l172"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cF0>&</span><span class=cFB>sys_run_level</span><span class=cF0>,</span><span class=cF3>RLf_ONCE_USER</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l173"></a> </span><span class=cF5>OnceFlush</span><span class=cF0>;
|
|
<a name="l174"></a> </span><span class=cF5>RegAppend</span><span class=cF0>(</span><span class=cF6>"Once/User"</span><span class=cF0>,</span><span class=cF6>"%s\n"</span><span class=cF0>,buf);
|
|
<a name="l175"></a> </span><span class=cF5>Free</span><span class=cF0>(buf);
|
|
<a name="l176"></a> *</span><span class=cFB>sys_registry_doc</span><span class=cF0>->filename.name=old_drv_let;
|
|
<a name="l177"></a>}
|
|
<a name="l178"></a>
|
|
<a name="l179"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>OnceExe</span><span class=cF0>()
|
|
<a name="l180"></a>{</span><span class=cF2>//Execute Once code. Call goes in </span><a href="/Wb/Home/Once..HTML#l1"><span class=cF4>~/Once.HC</span></a><span class=cF2>.</span><span class=cF0>
|
|
<a name="l181"></a> </span><span class=cF1>try</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l182"></a>
|
|
<a name="l183"></a> </span><span class=cF5>RegDft</span><span class=cF0>(</span><span class=cF6>"Once/Adam"</span><span class=cF0>,</span><span class=cF6>""</span><span class=cF0>);
|
|
<a name="l184"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>RegCnt</span><span class=cF7>(</span><span class=cF6>"Once/Adam"</span><span class=cF7>)</span><span class=cF0>>2) {
|
|
<a name="l185"></a> </span><span class=cF5>Adam</span><span class=cF0>(</span><span class=cF6>"RegExe(\"Once/Adam\");"</span><span class=cF0>);
|
|
<a name="l186"></a> </span><span class=cF5>AOnceFlush</span><span class=cF0>;
|
|
<a name="l187"></a> }
|
|
<a name="l188"></a> </span><span class=cF5>LBts</span><span class=cF0>(&</span><span class=cFB>sys_run_level</span><span class=cF0>,</span><span class=cF3>RLf_ONCE_ADAM</span><span class=cF0>);
|
|
<a name="l189"></a>
|
|
<a name="l190"></a> </span><span class=cF5>RegDft</span><span class=cF0>(</span><span class=cF6>"Once/User"</span><span class=cF0>,</span><span class=cF6>""</span><span class=cF0>);
|
|
<a name="l191"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>RegCnt</span><span class=cF7>(</span><span class=cF6>"Once/User"</span><span class=cF7>)</span><span class=cF0>>2) {
|
|
<a name="l192"></a> </span><span class=cF5>RegExe</span><span class=cF0>(</span><span class=cF6>"Once/User"</span><span class=cF0>);
|
|
<a name="l193"></a> </span><span class=cF5>OnceFlush</span><span class=cF0>;
|
|
<a name="l194"></a> }
|
|
<a name="l195"></a> </span><span class=cF5>LBts</span><span class=cF0>(&</span><span class=cFB>sys_run_level</span><span class=cF0>,</span><span class=cF3>RLf_ONCE_USER</span><span class=cF0>);
|
|
<a name="l196"></a>
|
|
<a name="l197"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>catch</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l198"></a> </span><span class=cF5>AOnceFlush</span><span class=cF0>;
|
|
<a name="l199"></a> </span><span class=cF5>LBts</span><span class=cF0>(&</span><span class=cFB>sys_run_level</span><span class=cF0>,</span><span class=cF3>RLf_ONCE_ADAM</span><span class=cF0>);
|
|
<a name="l200"></a> </span><span class=cF5>OnceFlush</span><span class=cF0>;
|
|
<a name="l201"></a> </span><span class=cF5>LBts</span><span class=cF0>(&</span><span class=cFB>sys_run_level</span><span class=cF0>,</span><span class=cF3>RLf_ONCE_USER</span><span class=cF0>);
|
|
<a name="l202"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l203"></a>}
|
|
</span></pre></body>
|
|
</html>
|