mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-30 17:26:31 +00:00
411 lines
48 KiB
HTML
Executable file
411 lines
48 KiB
HTML
Executable file
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
|
|
<meta name="generator" content="ZealOS V0.05">
|
|
<style type="text/css">
|
|
body {background-color:#000000;}
|
|
.cF0{color:#ffffff;background-color:#000000;}
|
|
.cF1{color:#3465a4;background-color:#000000;}
|
|
.cF2{color:#4e9a06;background-color:#000000;}
|
|
.cF3{color:#06989a;background-color:#000000;}
|
|
.cF4{color:#a24444;background-color:#000000;}
|
|
.cF5{color:#75507b;background-color:#000000;}
|
|
.cF6{color:#ce982f;background-color:#000000;}
|
|
.cF7{color:#bcc0b9;background-color:#000000;}
|
|
.cF8{color:#555753;background-color:#000000;}
|
|
.cF9{color:#729fcf;background-color:#000000;}
|
|
.cFA{color:#82bc49;background-color:#000000;}
|
|
.cFB{color:#34e2e2;background-color:#000000;}
|
|
.cFC{color:#ac3535;background-color:#000000;}
|
|
.cFD{color:#ad7fa8;background-color:#000000;}
|
|
.cFE{color:#fce94f;background-color:#000000;}
|
|
.cFF{color:#000000;background-color:#000000;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<pre style="font-family:courier;font-size:10pt">
|
|
<a name="l1"></a><span class=cF9>CHashDefineStr</span><span class=cF0> *</span><span class=cF5>DefineLoad</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *dname, </span><span class=cF1>U8</span><span class=cF0> *st)
|
|
<a name="l2"></a>{</span><span class=cF2>//Create DEFINE hash entry with string.</span><span class=cF0>
|
|
<a name="l3"></a> </span><span class=cF9>CHashDefineStr</span><span class=cF0> *tmph = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CHashDefineStr</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l4"></a>
|
|
<a name="l5"></a> tmph->type = </span><span class=cF3>HTT_DEFINE_STR</span><span class=cF0>;
|
|
<a name="l6"></a> tmph->str = </span><span class=cF5>StrNew</span><span class=cF0>(dname);
|
|
<a name="l7"></a> tmph->data = </span><span class=cF5>StrNew</span><span class=cF0>(st);
|
|
<a name="l8"></a> tmph->count = -</span><span class=cFE>1</span><span class=cF0>;
|
|
<a name="l9"></a> tmph->src_link = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"AD:0x%X"</span><span class=cF0>, </span><span class=cF5>Caller</span><span class=cF0>);
|
|
<a name="l10"></a>
|
|
<a name="l11"></a> </span><span class=cF5>HashAdd</span><span class=cF0>(tmph, </span><span class=cF5>Fs</span><span class=cF0>->hash_table);
|
|
<a name="l12"></a>
|
|
<a name="l13"></a> </span><span class=cF1>return</span><span class=cF0> tmph;
|
|
<a name="l14"></a>}
|
|
<a name="l15"></a>
|
|
<a name="l16"></a></span><span class=cF9>CHashDefineStr</span><span class=cF0> *</span><span class=cF5>DefineListLoad</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *dname, </span><span class=cF1>U8</span><span class=cF0> *list)
|
|
<a name="l17"></a>{</span><span class=cF2>//Create DEFINE list. Not efficient, but handy.</span><span class=cF0>
|
|
<a name="l18"></a> </span><span class=cF9>I64</span><span class=cF0> count = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l19"></a> </span><span class=cF1>U8</span><span class=cF0> *ptr, **idx;
|
|
<a name="l20"></a> </span><span class=cF9>CHashDefineStr</span><span class=cF0> *tmph = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF9>CHashDefineStr</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l21"></a>
|
|
<a name="l22"></a> tmph->type = </span><span class=cF3>HTT_DEFINE_STR</span><span class=cF0>;
|
|
<a name="l23"></a> tmph->str = </span><span class=cF5>StrNew</span><span class=cF0>(dname);
|
|
<a name="l24"></a> tmph->src_link = </span><span class=cF5>MStrPrint</span><span class=cF0>(</span><span class=cF6>"AD:0x%X"</span><span class=cF0>, </span><span class=cF5>Caller</span><span class=cF0>);
|
|
<a name="l25"></a>
|
|
<a name="l26"></a> ptr = list;
|
|
<a name="l27"></a> </span><span class=cF1>while</span><span class=cF0> (*ptr)
|
|
<a name="l28"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l29"></a> </span><span class=cF1>if</span><span class=cF0> (*ptr != </span><span class=cF6>'@'</span><span class=cF0>)
|
|
<a name="l30"></a> count++;
|
|
<a name="l31"></a> </span><span class=cF1>while</span><span class=cF0> (*ptr++);
|
|
<a name="l32"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l33"></a> tmph->data = </span><span class=cF5>MAlloc</span><span class=cF0>(ptr + </span><span class=cFE>1</span><span class=cF0> - list);
|
|
<a name="l34"></a> </span><span class=cF5>MemCopy</span><span class=cF0>(tmph->data, list, ptr + </span><span class=cFE>1</span><span class=cF0> - list);
|
|
<a name="l35"></a> tmph->count = count;
|
|
<a name="l36"></a>
|
|
<a name="l37"></a> idx = tmph->sub_idx = </span><span class=cF5>MAlloc</span><span class=cF0>(count * </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l38"></a> ptr = list;
|
|
<a name="l39"></a> </span><span class=cF1>while</span><span class=cF0> (*ptr)
|
|
<a name="l40"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l41"></a> </span><span class=cF1>if</span><span class=cF0> (*ptr != </span><span class=cF6>'@'</span><span class=cF0>)
|
|
<a name="l42"></a> *idx++ = ptr;
|
|
<a name="l43"></a> </span><span class=cF1>while</span><span class=cF0> (*ptr++);
|
|
<a name="l44"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l45"></a>
|
|
<a name="l46"></a> </span><span class=cF5>HashAdd</span><span class=cF0>(tmph, </span><span class=cF5>Fs</span><span class=cF0>->hash_table);
|
|
<a name="l47"></a>
|
|
<a name="l48"></a> </span><span class=cF1>return</span><span class=cF0> tmph;
|
|
<a name="l49"></a>}
|
|
<a name="l50"></a>
|
|
<a name="l51"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>UndefinedDefine</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *dname)
|
|
<a name="l52"></a>{
|
|
<a name="l53"></a> </span><span class=cF3>ST_ERR_ST</span><span class=cF0> </span><span class=cF6>"Undefined Define: '%s'.\n"</span><span class=cF0>, dname;
|
|
<a name="l54"></a> </span><span class=cF5>throw</span><span class=cF0>(</span><span class=cF6>'UndefDef'</span><span class=cF0>);
|
|
<a name="l55"></a>}
|
|
<a name="l56"></a>
|
|
<a name="l57"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>Define</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *dname)
|
|
<a name="l58"></a>{</span><span class=cF2>//Look for DEFINE named in hash table, return ptr string.</span><span class=cF0>
|
|
<a name="l59"></a> </span><span class=cF9>CHashDefineStr</span><span class=cF0> *tmph;
|
|
<a name="l60"></a>
|
|
<a name="l61"></a> </span><span class=cF1>if</span><span class=cF0> (tmph = </span><span class=cF5>HashFind</span><span class=cF7>(</span><span class=cF0>dname, </span><span class=cF5>Fs</span><span class=cF0>->hash_table, </span><span class=cF3>HTT_DEFINE_STR</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l62"></a> </span><span class=cF1>return</span><span class=cF0> tmph->data;
|
|
<a name="l63"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (dname)
|
|
<a name="l64"></a> </span><span class=cFD>UndefinedDefine</span><span class=cF0>(dname);
|
|
<a name="l65"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l66"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l67"></a>}
|
|
<a name="l68"></a>
|
|
<a name="l69"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>DefineSub</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> sub, </span><span class=cF1>U8</span><span class=cF0> *dname)
|
|
<a name="l70"></a>{</span><span class=cF2>//Return DEFINE list entry indexed by number.</span><span class=cF0>
|
|
<a name="l71"></a> </span><span class=cF9>CHashDefineStr</span><span class=cF0> *tmph;
|
|
<a name="l72"></a>
|
|
<a name="l73"></a> </span><span class=cF1>if</span><span class=cF0> (tmph = </span><span class=cF5>HashFind</span><span class=cF7>(</span><span class=cF0>dname, </span><span class=cF5>Fs</span><span class=cF0>->hash_table, </span><span class=cF3>HTT_DEFINE_STR</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l74"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l75"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFE>0</span><span class=cF0> <= sub < tmph->count)
|
|
<a name="l76"></a> </span><span class=cF1>return</span><span class=cF0> tmph->sub_idx[sub];
|
|
<a name="l77"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l78"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l79"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l80"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (dname)
|
|
<a name="l81"></a> </span><span class=cFD>UndefinedDefine</span><span class=cF0>(dname);
|
|
<a name="l82"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l83"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l84"></a>}
|
|
<a name="l85"></a>
|
|
<a name="l86"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>DefineCount</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *dname)
|
|
<a name="l87"></a>{</span><span class=cF2>//Return count of entries in define list.</span><span class=cF0>
|
|
<a name="l88"></a> </span><span class=cF9>CHashDefineStr</span><span class=cF0> *tmph;
|
|
<a name="l89"></a>
|
|
<a name="l90"></a> </span><span class=cF1>if</span><span class=cF0> (tmph = </span><span class=cF5>HashFind</span><span class=cF7>(</span><span class=cF0>dname, </span><span class=cF5>Fs</span><span class=cF0>->hash_table, </span><span class=cF3>HTT_DEFINE_STR</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l91"></a> </span><span class=cF1>return</span><span class=cF0> tmph->count;
|
|
<a name="l92"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (dname)
|
|
<a name="l93"></a> </span><span class=cFD>UndefinedDefine</span><span class=cF0>(dname);
|
|
<a name="l94"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l95"></a> </span><span class=cF1>return</span><span class=cF0> -</span><span class=cFE>1</span><span class=cF0>;
|
|
<a name="l96"></a>}
|
|
<a name="l97"></a>
|
|
<a name="l98"></a></span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>DefineMatch</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *needle, </span><span class=cF1>U8</span><span class=cF0> *haystack_list_dname, </span><span class=cF9>I64</span><span class=cF0> flags=</span><span class=cFE>0</span><span class=cF0>)
|
|
<a name="l99"></a>{</span><span class=cF2>//Find match for string in define list.</span><span class=cF0>
|
|
<a name="l100"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF5>ListMatch</span><span class=cF0>(needle, </span><span class=cF5>Define</span><span class=cF7>(</span><span class=cF0>haystack_list_dname</span><span class=cF7>)</span><span class=cF0>, flags);
|
|
<a name="l101"></a>}
|
|
<a name="l102"></a>
|
|
<a name="l103"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>DefinePrint</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *dname, </span><span class=cF1>U8</span><span class=cF0> *src, ...)
|
|
<a name="l104"></a>{</span><span class=cF2>//Create DEFINE entry with </span><a href="https://tomawezome.github.io/ZealOS/Doc/Print.html#l1"><span class=cF4>Print</span></a><span class=cF2>()ed string.</span><span class=cF0>
|
|
<a name="l105"></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>, src, argc, argv);
|
|
<a name="l106"></a>
|
|
<a name="l107"></a> </span><span class=cF5>DefineLoad</span><span class=cF0>(dname, buf);
|
|
<a name="l108"></a> </span><span class=cF5>Free</span><span class=cF0>(buf);
|
|
<a name="l109"></a>}
|
|
<a name="l110"></a>
|
|
<a name="l111"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cFD>SysDefinesLoad</span><span class=cF0>()
|
|
<a name="l112"></a>{
|
|
<a name="l113"></a> </span><span class=cF5>DefineListLoad</span><span class=cF0>(</span><span class=cF6>"ST_OFF_ON"</span><span class=cF0>,
|
|
<a name="l114"></a> </span><span class=cF6>"Off\0"</span><span class=cF0>
|
|
<a name="l115"></a> </span><span class=cF6>"On"</span><span class=cF0>);
|
|
<a name="l116"></a>
|
|
<a name="l117"></a> </span><span class=cF5>DefineListLoad</span><span class=cF0>(</span><span class=cF6>"ST_FALSE_TRUE"</span><span class=cF0>,
|
|
<a name="l118"></a> </span><span class=cF6>"False\0"</span><span class=cF0>
|
|
<a name="l119"></a> </span><span class=cF6>"True"</span><span class=cF0>);
|
|
<a name="l120"></a>
|
|
<a name="l121"></a> </span><span class=cF5>DefineListLoad</span><span class=cF0>(</span><span class=cF6>"ST_HTT_TYPES"</span><span class=cF0>,
|
|
<a name="l122"></a> </span><span class=cF6>"ExportSysSym\0"</span><span class=cF0>
|
|
<a name="l123"></a> </span><span class=cF6>"ImportSysSym\0"</span><span class=cF0>
|
|
<a name="l124"></a> </span><span class=cF6>"DefineStr\0"</span><span class=cF0>
|
|
<a name="l125"></a> </span><span class=cF6>"GlbVar\0"</span><span class=cF0>
|
|
<a name="l126"></a> </span><span class=cF6>"Class\0"</span><span class=cF0>
|
|
<a name="l127"></a> </span><span class=cF6>"IntType\0"</span><span class=cF0>
|
|
<a name="l128"></a> </span><span class=cF6>"Funct\0"</span><span class=cF0>
|
|
<a name="l129"></a> </span><span class=cF6>"Word\0"</span><span class=cF0>
|
|
<a name="l130"></a> </span><span class=cF6>"DictWord\0"</span><span class=cF0>
|
|
<a name="l131"></a> </span><span class=cF6>"KeyWord\0"</span><span class=cF0>
|
|
<a name="l132"></a> </span><span class=cF6>"AsmKeyWord\0"</span><span class=cF0>
|
|
<a name="l133"></a> </span><span class=cF6>"OpCode\0"</span><span class=cF0>
|
|
<a name="l134"></a> </span><span class=cF6>"Reg\0"</span><span class=cF0>
|
|
<a name="l135"></a> </span><span class=cF6>"File\0"</span><span class=cF0>
|
|
<a name="l136"></a> </span><span class=cF6>"Module\0"</span><span class=cF0>
|
|
<a name="l137"></a> </span><span class=cF6>"HelpFile\0"</span><span class=cF0>
|
|
<a name="l138"></a> </span><span class=cF6>"Frame Ptr\0"</span><span class=cF0>
|
|
<a name="l139"></a> </span><span class=cF6>" \0 \0 \0 \0 \0 \0"</span><span class=cF0>
|
|
<a name="l140"></a> </span><span class=cF6>"Private\0"</span><span class=cF0>
|
|
<a name="l141"></a> </span><span class=cF6>"Public\0"</span><span class=cF0>
|
|
<a name="l142"></a> </span><span class=cF6>"Export\0"</span><span class=cF0>
|
|
<a name="l143"></a> </span><span class=cF6>"Import\0"</span><span class=cF0>
|
|
<a name="l144"></a> </span><span class=cF6>"Imm\0"</span><span class=cF0>
|
|
<a name="l145"></a> </span><span class=cF6>"Goto\0"</span><span class=cF0>
|
|
<a name="l146"></a> </span><span class=cF6>"Res\0"</span><span class=cF0>
|
|
<a name="l147"></a> </span><span class=cF6>"Unres\0"</span><span class=cF0>
|
|
<a name="l148"></a> </span><span class=cF6>"Local\0"</span><span class=cF0>);
|
|
<a name="l149"></a>
|
|
<a name="l150"></a> </span><span class=cF5>DefineListLoad</span><span class=cF0>(</span><span class=cF6>"ST_DAYS_OF_WEEK"</span><span class=cF0>,
|
|
<a name="l151"></a> </span><span class=cF6>"Sunday\0"</span><span class=cF0>
|
|
<a name="l152"></a> </span><span class=cF6>"Monday\0"</span><span class=cF0>
|
|
<a name="l153"></a> </span><span class=cF6>"Tuesday\0"</span><span class=cF0>
|
|
<a name="l154"></a> </span><span class=cF6>"Wednesday\0"</span><span class=cF0>
|
|
<a name="l155"></a> </span><span class=cF6>"Thursday\0"</span><span class=cF0>
|
|
<a name="l156"></a> </span><span class=cF6>"Friday\0"</span><span class=cF0>
|
|
<a name="l157"></a> </span><span class=cF6>"Saturday\0"</span><span class=cF0>);
|
|
<a name="l158"></a>
|
|
<a name="l159"></a> </span><span class=cF5>DefineListLoad</span><span class=cF0>(</span><span class=cF6>"ST_MONTHS"</span><span class=cF0>,
|
|
<a name="l160"></a> </span><span class=cF6>"January\0"</span><span class=cF0>
|
|
<a name="l161"></a> </span><span class=cF6>"February\0"</span><span class=cF0>
|
|
<a name="l162"></a> </span><span class=cF6>"March\0"</span><span class=cF0>
|
|
<a name="l163"></a> </span><span class=cF6>"April\0"</span><span class=cF0>
|
|
<a name="l164"></a> </span><span class=cF6>"May\0"</span><span class=cF0>
|
|
<a name="l165"></a> </span><span class=cF6>"June\0"</span><span class=cF0>
|
|
<a name="l166"></a> </span><span class=cF6>"July\0"</span><span class=cF0>
|
|
<a name="l167"></a> </span><span class=cF6>"August\0"</span><span class=cF0>
|
|
<a name="l168"></a> </span><span class=cF6>"September\0"</span><span class=cF0>
|
|
<a name="l169"></a> </span><span class=cF6>"October\0"</span><span class=cF0>
|
|
<a name="l170"></a> </span><span class=cF6>"November\0"</span><span class=cF0>
|
|
<a name="l171"></a> </span><span class=cF6>"December\0"</span><span class=cF0>);
|
|
<a name="l172"></a>
|
|
<a name="l173"></a> </span><span class=cF5>DefineListLoad</span><span class=cF0>(</span><span class=cF6>"ST_FILE_ATTRS"</span><span class=cF0>,
|
|
<a name="l174"></a> </span><span class=cF6>"R\0"</span><span class=cF0>
|
|
<a name="l175"></a> </span><span class=cF6>"H\0"</span><span class=cF0>
|
|
<a name="l176"></a> </span><span class=cF6>"S\0"</span><span class=cF0>
|
|
<a name="l177"></a> </span><span class=cF6>"V\0"</span><span class=cF0>
|
|
<a name="l178"></a> </span><span class=cF6>"D\0"</span><span class=cF0>
|
|
<a name="l179"></a> </span><span class=cF6>"A\0"</span><span class=cF0>
|
|
<a name="l180"></a> </span><span class=cF6>" \0"</span><span class=cF0>
|
|
<a name="l181"></a> </span><span class=cF6>" \0"</span><span class=cF0>
|
|
<a name="l182"></a> </span><span class=cF6>"X\0"</span><span class=cF0>
|
|
<a name="l183"></a> </span><span class=cF6>"T\0"</span><span class=cF0>
|
|
<a name="l184"></a> </span><span class=cF6>"C\0"</span><span class=cF0>
|
|
<a name="l185"></a> </span><span class=cF6>"F\0"</span><span class=cF0>);
|
|
<a name="l186"></a>
|
|
<a name="l187"></a> </span><span class=cF5>DefineListLoad</span><span class=cF0>(</span><span class=cF6>"ST_FILE_UTIL_FLAGS"</span><span class=cF0>,
|
|
<a name="l188"></a> </span><span class=cF6>"r\0"</span><span class=cF0>
|
|
<a name="l189"></a> </span><span class=cF6>"d\0"</span><span class=cF0>
|
|
<a name="l190"></a> </span><span class=cF6>"i\0"</span><span class=cF0>
|
|
<a name="l191"></a> </span><span class=cF6>"a\0"</span><span class=cF0>
|
|
<a name="l192"></a> </span><span class=cF6>"c\0"</span><span class=cF0>
|
|
<a name="l193"></a> </span><span class=cF6>"R\0"</span><span class=cF0>
|
|
<a name="l194"></a> </span><span class=cF6>"p\0"</span><span class=cF0>
|
|
<a name="l195"></a> </span><span class=cF6>"m\0"</span><span class=cF0>
|
|
<a name="l196"></a> </span><span class=cF6>"s\0"</span><span class=cF0>
|
|
<a name="l197"></a> </span><span class=cF6>"D\0"</span><span class=cF0>
|
|
<a name="l198"></a> </span><span class=cF6>"F\0"</span><span class=cF0>
|
|
<a name="l199"></a> </span><span class=cF6>"T\0"</span><span class=cF0>
|
|
<a name="l200"></a> </span><span class=cF6>"$\0"</span><span class=cF0>
|
|
<a name="l201"></a> </span><span class=cF6>"S\0"</span><span class=cF0>
|
|
<a name="l202"></a> </span><span class=cF6>"A\0"</span><span class=cF0>
|
|
<a name="l203"></a> </span><span class=cF6>"J\0"</span><span class=cF0>
|
|
<a name="l204"></a> </span><span class=cF6>"G\0"</span><span class=cF0>
|
|
<a name="l205"></a> </span><span class=cF6>"O\0"</span><span class=cF0>
|
|
<a name="l206"></a> </span><span class=cF6>"P\0"</span><span class=cF0>
|
|
<a name="l207"></a> </span><span class=cF6>"f\0"</span><span class=cF0>
|
|
<a name="l208"></a> </span><span class=cF6>"l\0"</span><span class=cF0>
|
|
<a name="l209"></a> </span><span class=cF6>"lb\0"</span><span class=cF0>
|
|
<a name="l210"></a> </span><span class=cF6>"la\0"</span><span class=cF0>);
|
|
<a name="l211"></a>
|
|
<a name="l212"></a> </span><span class=cF5>DefineListLoad</span><span class=cF0>(</span><span class=cF6>"ST_BLKDEV_TYPES"</span><span class=cF0>,
|
|
<a name="l213"></a> </span><span class=cF6>"NULL\0"</span><span class=cF0>
|
|
<a name="l214"></a> </span><span class=cF6>"RAM\0"</span><span class=cF0>
|
|
<a name="l215"></a> </span><span class=cF6>"ATA\0"</span><span class=cF0>
|
|
<a name="l216"></a> </span><span class=cF6>"FILE_READ\0"</span><span class=cF0>
|
|
<a name="l217"></a> </span><span class=cF6>"FILE_WRITE\0"</span><span class=cF0>
|
|
<a name="l218"></a> </span><span class=cF6>"ATAPI\0"</span><span class=cF0>);
|
|
<a name="l219"></a>
|
|
<a name="l220"></a> </span><span class=cF5>DefineListLoad</span><span class=cF0>(</span><span class=cF6>"ST_DRIVE_TYPES"</span><span class=cF0>,
|
|
<a name="l221"></a> </span><span class=cF6>"NULL\0"</span><span class=cF0>
|
|
<a name="l222"></a> </span><span class=cF6>"REDSEA\0"</span><span class=cF0>
|
|
<a name="l223"></a> </span><span class=cF6>"FAT32\0"</span><span class=cF0>
|
|
<a name="l224"></a> </span><span class=cF6>"ISO9660\0"</span><span class=cF0>
|
|
<a name="l225"></a> </span><span class=cF6>"NTFS\0"</span><span class=cF0>
|
|
<a name="l226"></a> </span><span class=cF6>"UNKNOWN\0"</span><span class=cF0>);
|
|
<a name="l227"></a>
|
|
<a name="l228"></a> </span><span class=cF5>DefineListLoad</span><span class=cF0>(</span><span class=cF6>"ST_COLORS"</span><span class=cF0>,
|
|
<a name="l229"></a> </span><span class=cF6>"BLACK\0"</span><span class=cF0>
|
|
<a name="l230"></a> </span><span class=cF6>"BLUE\0"</span><span class=cF0>
|
|
<a name="l231"></a> </span><span class=cF6>"GREEN\0"</span><span class=cF0>
|
|
<a name="l232"></a> </span><span class=cF6>"CYAN\0"</span><span class=cF0>
|
|
<a name="l233"></a> </span><span class=cF6>"RED\0"</span><span class=cF0>
|
|
<a name="l234"></a> </span><span class=cF6>"PURPLE\0"</span><span class=cF0>
|
|
<a name="l235"></a> </span><span class=cF6>"BROWN\0"</span><span class=cF0>
|
|
<a name="l236"></a> </span><span class=cF6>"LTGRAY\0"</span><span class=cF0>
|
|
<a name="l237"></a> </span><span class=cF6>"DKGRAY\0"</span><span class=cF0>
|
|
<a name="l238"></a> </span><span class=cF6>"LTBLUE\0"</span><span class=cF0>
|
|
<a name="l239"></a> </span><span class=cF6>"LTGREEN\0"</span><span class=cF0>
|
|
<a name="l240"></a> </span><span class=cF6>"LTCYAN\0"</span><span class=cF0>
|
|
<a name="l241"></a> </span><span class=cF6>"LTRED\0"</span><span class=cF0>
|
|
<a name="l242"></a> </span><span class=cF6>"LTPURPLE\0"</span><span class=cF0>
|
|
<a name="l243"></a> </span><span class=cF6>"YELLOW\0"</span><span class=cF0>
|
|
<a name="l244"></a> </span><span class=cF6>"WHITE\0"</span><span class=cF0>);
|
|
<a name="l245"></a>
|
|
<a name="l246"></a> </span><span class=cF5>DefineListLoad</span><span class=cF0>(</span><span class=cF6>"ST_INT_NAMES"</span><span class=cF0>,
|
|
<a name="l247"></a> </span><span class=cF6>"Divide Error\0"</span><span class=cF0>
|
|
<a name="l248"></a> </span><span class=cF6>"SingleStep\0"</span><span class=cF0>
|
|
<a name="l249"></a> </span><span class=cF6>"NMI\0"</span><span class=cF0>
|
|
<a name="l250"></a> </span><span class=cF6>"Breakpoint\0"</span><span class=cF0>
|
|
<a name="l251"></a> </span><span class=cF6>"Overflow\0"</span><span class=cF0>
|
|
<a name="l252"></a> </span><span class=cF6>"BOUND Range Exceeded\0"</span><span class=cF0>
|
|
<a name="l253"></a> </span><span class=cF6>"Invalid Opcode\0"</span><span class=cF0>
|
|
<a name="l254"></a> </span><span class=cF6>"No Math Coprocessor\0"</span><span class=cF0>
|
|
<a name="l255"></a> </span><span class=cF6>"Double Fault\0"</span><span class=cF0>
|
|
<a name="l256"></a> </span><span class=cF6>"Coprocessor Segment Fault\0"</span><span class=cF0>
|
|
<a name="l257"></a> </span><span class=cF6>"Invalid TASK\0"</span><span class=cF0>
|
|
<a name="l258"></a> </span><span class=cF6>"Segment Not Present\0"</span><span class=cF0>
|
|
<a name="l259"></a> </span><span class=cF6>"Stack Segment Fault\0"</span><span class=cF0>
|
|
<a name="l260"></a> </span><span class=cF6>"General Protection\0"</span><span class=cF0>
|
|
<a name="l261"></a> </span><span class=cF6>"Page Fault\0"</span><span class=cF0>
|
|
<a name="l262"></a> </span><span class=cF6>" \0"</span><span class=cF0>
|
|
<a name="l263"></a> </span><span class=cF6>"Math Fault\0"</span><span class=cF0>
|
|
<a name="l264"></a> </span><span class=cF6>"Alignment Check\0"</span><span class=cF0>
|
|
<a name="l265"></a> </span><span class=cF6>"Machine Check\0"</span><span class=cF0>
|
|
<a name="l266"></a> </span><span class=cF6>"SIMD Exception\0"</span><span class=cF0>
|
|
<a name="l267"></a> </span><span class=cF6>" \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0"</span><span class=cF0>
|
|
<a name="l268"></a> </span><span class=cF6>" \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0"</span><span class=cF0>
|
|
<a name="l269"></a> </span><span class=cF6>"MP Crash\0"</span><span class=cF0>
|
|
<a name="l270"></a> </span><span class=cF6>"Wake\0"</span><span class=cF0>
|
|
<a name="l271"></a> </span><span class=cF6>"Debug\0"</span><span class=cF0>);
|
|
<a name="l272"></a>}
|
|
<a name="l273"></a>
|
|
<a name="l274"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cF5>Color2Str</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *buf, </span><span class=cF9>CColorROPU32</span><span class=cF0> c)
|
|
<a name="l275"></a>{</span><span class=cF2>//</span><a href="https://tomawezome.github.io/ZealOS/Kernel/KernelA.html#l3603"><span class=cF4>CColorROPU32</span></a><span class=cF2> with flags to </span><a href="https://tomawezome.github.io/ZealOS/System/Gr/GrDC.html#l62"><span class=cF4>DCLighting</span></a><span class=cF2> str.</span><span class=cF0>
|
|
<a name="l276"></a> *buf = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l277"></a> </span><span class=cF1>if</span><span class=cF0> (c.c0.rop & </span><span class=cF3>ROPBF_TWO_SIDED</span><span class=cF0>)
|
|
<a name="l278"></a> </span><span class=cF5>CatPrint</span><span class=cF0>(buf, </span><span class=cF6>"TWO|"</span><span class=cF0>);
|
|
<a name="l279"></a> </span><span class=cF1>if</span><span class=cF0> (c.c0.rop & </span><span class=cF3>ROPBF_HALF_RANGE_COLOR</span><span class=cF0>)
|
|
<a name="l280"></a> </span><span class=cF5>CatPrint</span><span class=cF0>(buf, </span><span class=cF6>"HALF|"</span><span class=cF0>);
|
|
<a name="l281"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFE>0</span><span class=cF0> <= c.c0.color < </span><span class=cFE>16</span><span class=cF0>)
|
|
<a name="l282"></a> </span><span class=cF5>CatPrint</span><span class=cF0>(buf, </span><span class=cF5>DefineSub</span><span class=cF7>(</span><span class=cF0>c.c0.color, </span><span class=cF6>"ST_COLORS"</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l283"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (c.c0.color == </span><span class=cF3>TRANSPARENT</span><span class=cF0>)
|
|
<a name="l284"></a> </span><span class=cF5>CatPrint</span><span class=cF0>(buf, </span><span class=cF6>"TRANSPARENT"</span><span class=cF0>);
|
|
<a name="l285"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l286"></a> </span><span class=cF5>CatPrint</span><span class=cF0>(buf, </span><span class=cF6>"INVALID"</span><span class=cF0>);
|
|
<a name="l287"></a> </span><span class=cF1>if</span><span class=cF0> (c & </span><span class=cF3>ROPF_DITHER</span><span class=cF0>)
|
|
<a name="l288"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l289"></a> </span><span class=cF5>CatPrint</span><span class=cF0>(buf, </span><span class=cF6>"/"</span><span class=cF0>);
|
|
<a name="l290"></a> </span><span class=cF1>if</span><span class=cF0> (c.c1.rop & </span><span class=cF3>ROPBF_TWO_SIDED</span><span class=cF0>)
|
|
<a name="l291"></a> </span><span class=cF5>CatPrint</span><span class=cF0>(buf, </span><span class=cF6>"TWO|"</span><span class=cF0>);
|
|
<a name="l292"></a> </span><span class=cF1>if</span><span class=cF0> (c.c1.rop & </span><span class=cF3>ROPBF_HALF_RANGE_COLOR</span><span class=cF0>)
|
|
<a name="l293"></a> </span><span class=cF5>CatPrint</span><span class=cF0>(buf, </span><span class=cF6>"HALF|"</span><span class=cF0>);
|
|
<a name="l294"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFE>0</span><span class=cF0> <= c.c1.color < </span><span class=cFE>16</span><span class=cF0>)
|
|
<a name="l295"></a> </span><span class=cF5>CatPrint</span><span class=cF0>(buf, </span><span class=cF5>DefineSub</span><span class=cF7>(</span><span class=cF0>c.c1.color, </span><span class=cF6>"ST_COLORS"</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l296"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (c.c1.color == </span><span class=cF3>TRANSPARENT</span><span class=cF0>)
|
|
<a name="l297"></a> </span><span class=cF5>CatPrint</span><span class=cF0>(buf, </span><span class=cF6>"TRANSPARENT"</span><span class=cF0>);
|
|
<a name="l298"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l299"></a> </span><span class=cF5>CatPrint</span><span class=cF0>(buf, </span><span class=cF6>"INVALID"</span><span class=cF0>);
|
|
<a name="l300"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l301"></a>
|
|
<a name="l302"></a> </span><span class=cF1>return</span><span class=cF0> buf;
|
|
<a name="l303"></a>}
|
|
<a name="l304"></a>
|
|
<a name="l305"></a></span><span class=cF1>U8</span><span class=cF0> *</span><span class=cFD>str2color_list</span><span class=cF0> = </span><span class=cF6>"/,)}>"</span><span class=cF0>;
|
|
<a name="l306"></a>
|
|
<a name="l307"></a></span><span class=cF9>CColorROPU16</span><span class=cF0> </span><span class=cF5>Str2ColorU16</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *st)
|
|
<a name="l308"></a>{</span><span class=cF2>//</span><a href="https://tomawezome.github.io/ZealOS/System/Gr/GrDC.html#l62"><span class=cF4>DCLighting</span></a><span class=cF2> color str with flags to </span><a href="https://tomawezome.github.io/ZealOS/Kernel/KernelA.html#l3599"><span class=cF4>CColorROPU16</span></a><span class=cF2>.</span><span class=cF0>
|
|
<a name="l309"></a> </span><span class=cF9>CColorROPU16</span><span class=cF0> res = </span><span class=cF3>COLOR_INVALID</span><span class=cF0>;
|
|
<a name="l310"></a> </span><span class=cF9>I64</span><span class=cF0> i;
|
|
<a name="l311"></a> </span><span class=cF1>U8</span><span class=cF0> *ptr, *ptr2, *st2;
|
|
<a name="l312"></a>
|
|
<a name="l313"></a> </span><span class=cF1>if</span><span class=cF0> (!st)
|
|
<a name="l314"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>COLOR_INVALID</span><span class=cF0>;
|
|
<a name="l315"></a>
|
|
<a name="l316"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
|
|
<a name="l317"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l318"></a> </span><span class=cF1>if</span><span class=cF0> (!*st || </span><span class=cF5>StrOcc</span><span class=cF7>(</span><span class=cFD>str2color_list</span><span class=cF0>, *st</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l319"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l320"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_alpha</span><span class=cF0>, *st</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l321"></a> {
|
|
<a name="l322"></a> ptr = st;
|
|
<a name="l323"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_alpha_numeric</span><span class=cF0>, *ptr</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l324"></a> ptr++;
|
|
<a name="l325"></a> st2 = ptr2 = </span><span class=cF5>MAlloc</span><span class=cF0>(ptr - st + </span><span class=cFE>1</span><span class=cF0>);
|
|
<a name="l326"></a> </span><span class=cF1>while</span><span class=cF0> (st < ptr)
|
|
<a name="l327"></a> *ptr2++ = *st++;
|
|
<a name="l328"></a> *ptr2++ = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l329"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrICompare</span><span class=cF7>(</span><span class=cF0>st2, </span><span class=cF6>"TWO"</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l330"></a> res.rop |= </span><span class=cF3>ROPBF_TWO_SIDED</span><span class=cF0>;
|
|
<a name="l331"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrICompare</span><span class=cF7>(</span><span class=cF0>st2, </span><span class=cF6>"HALF"</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l332"></a> res.rop |= </span><span class=cF3>ROPBF_HALF_RANGE_COLOR</span><span class=cF0>;
|
|
<a name="l333"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>i = </span><span class=cF5>DefineMatch</span><span class=cF0>(st2, </span><span class=cF6>"ST_COLORS"</span><span class=cF0>, </span><span class=cF3>LMF_IGNORE_CASE</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0> >= </span><span class=cFE>0</span><span class=cF0>)
|
|
<a name="l334"></a> res.color = i;
|
|
<a name="l335"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>StrICompare</span><span class=cF7>(</span><span class=cF0>st2, </span><span class=cF6>"TRANSPARENT"</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l336"></a> res.color = </span><span class=cF3>TRANSPARENT</span><span class=cF0>;
|
|
<a name="l337"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l338"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l339"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
|
<a name="l340"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>COLOR_INVALID</span><span class=cF0>;
|
|
<a name="l341"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l342"></a> </span><span class=cF5>Free</span><span class=cF0>(st2);
|
|
<a name="l343"></a> }
|
|
<a name="l344"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (*st == </span><span class=cF6>'+'</span><span class=cF0> || *st == </span><span class=cF6>'|'</span><span class=cF0> || </span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_white_space</span><span class=cF0>, *st</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l345"></a> st++;
|
|
<a name="l346"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF6>'0'</span><span class=cF0> <= *st <= </span><span class=cF6>'9'</span><span class=cF0>)
|
|
<a name="l347"></a> {
|
|
<a name="l348"></a> i = </span><span class=cF5>Str2I64</span><span class=cF0>(st, </span><span class=cFE>10</span><span class=cF0>, &ptr);
|
|
<a name="l349"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cFE>0</span><span class=cF0> <= i <= </span><span class=cFE>0xFF</span><span class=cF0>)
|
|
<a name="l350"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l351"></a> res.color = i;
|
|
<a name="l352"></a> st = ptr;
|
|
<a name="l353"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l354"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l355"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>COLOR_INVALID</span><span class=cF0>;
|
|
<a name="l356"></a> }
|
|
<a name="l357"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l358"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>COLOR_INVALID</span><span class=cF0>;
|
|
<a name="l359"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l360"></a>}
|
|
<a name="l361"></a>
|
|
<a name="l362"></a></span><span class=cF9>CColorROPU32</span><span class=cF0> </span><span class=cF5>Str2ColorU32</span><span class=cF0>(</span><span class=cF1>U8</span><span class=cF0> *st)
|
|
<a name="l363"></a>{</span><span class=cF2>//</span><a href="https://tomawezome.github.io/ZealOS/System/Gr/GrDC.html#l62"><span class=cF4>DCLighting</span></a><span class=cF2> color str with flags to </span><a href="https://tomawezome.github.io/ZealOS/Kernel/KernelA.html#l3603"><span class=cF4>CColorROPU32</span></a><span class=cF2>.</span><span class=cF0>
|
|
<a name="l364"></a> </span><span class=cF1>U8</span><span class=cF0> *st2;
|
|
<a name="l365"></a> </span><span class=cF9>CColorROPU32</span><span class=cF0> res = </span><span class=cFE>0</span><span class=cF0>;
|
|
<a name="l366"></a>
|
|
<a name="l367"></a> </span><span class=cF1>if</span><span class=cF0> (!st)
|
|
<a name="l368"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>COLOR_INVALID</span><span class=cF0>;
|
|
<a name="l369"></a>
|
|
<a name="l370"></a> st2 = </span><span class=cF5>MAlloc</span><span class=cF0>(</span><span class=cF5>StrLen</span><span class=cF7>(</span><span class=cF0>st</span><span class=cF7>)</span><span class=cF0> + </span><span class=cFE>1</span><span class=cF0>);
|
|
<a name="l371"></a> </span><span class=cF5>StrFirstRemove</span><span class=cF0>(st, </span><span class=cFD>str2color_list</span><span class=cF0>, st2);
|
|
<a name="l372"></a> res.c0 = </span><span class=cF5>Str2ColorU16</span><span class=cF0>(st2);
|
|
<a name="l373"></a> </span><span class=cF1>if</span><span class=cF0> (*st)
|
|
<a name="l374"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l375"></a> res.c1 = </span><span class=cF5>Str2ColorU16</span><span class=cF0>(st);
|
|
<a name="l376"></a> res |= </span><span class=cF3>ROPF_DITHER</span><span class=cF0>;
|
|
<a name="l377"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l378"></a> </span><span class=cF1>if</span><span class=cF0> (res.c0.color == </span><span class=cF3>COLOR_INVALID</span><span class=cF0> || res.c1.color == </span><span class=cF3>COLOR_INVALID</span><span class=cF0>)
|
|
<a name="l379"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>COLOR_INVALID</span><span class=cF0>;
|
|
<a name="l380"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l381"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
|
<a name="l382"></a>}
|
|
</span></pre></body>
|
|
</html>
|