mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-28 08:16:31 +00:00
250 lines
19 KiB
HTML
Executable file
250 lines
19 KiB
HTML
Executable file
<!DOCTYPE HTML>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=US-ASCII">
|
|
<meta name="generator" content="ZealOS V1.04">
|
|
<style type="text/css">
|
|
body {background-color:#1f1f1f;}
|
|
.cF0{color:#e3e3e3;background-color:#1f1f1f;}
|
|
.cF1{color:#4f84a6;background-color:#1f1f1f;}
|
|
.cF2{color:#73a255;background-color:#1f1f1f;}
|
|
.cF3{color:#297582;background-color:#1f1f1f;}
|
|
.cF4{color:#b34f4b;background-color:#1f1f1f;}
|
|
.cF5{color:#8a52c3;background-color:#1f1f1f;}
|
|
.cF6{color:#b7822f;background-color:#1f1f1f;}
|
|
.cF7{color:#444444;background-color:#1f1f1f;}
|
|
.cF8{color:#6d6d6d;background-color:#1f1f1f;}
|
|
.cF9{color:#94bfde;background-color:#1f1f1f;}
|
|
.cFA{color:#a1ce97;background-color:#1f1f1f;}
|
|
.cFB{color:#6db4be;background-color:#1f1f1f;}
|
|
.cFC{color:#e88e88;background-color:#1f1f1f;}
|
|
.cFD{color:#ca94e8;background-color:#1f1f1f;}
|
|
.cFE{color:#d4b475;background-color:#1f1f1f;}
|
|
.cFF{color:#1f1f1f;background-color:#1f1f1f;}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<pre style="font-family:monospace;font-size:12pt">
|
|
<a name="l1"></a><span class=cF1>U0</span><span class=cF0> BgtTemplatePurge(CBgtTemplate *tmpt)
|
|
<a name="l2"></a>{
|
|
<a name="l3"></a> CBgtEntry *tmpb, *tmpb1;
|
|
<a name="l4"></a>
|
|
<a name="l5"></a> tmpb=b_head.next;
|
|
<a name="l6"></a> </span><span class=cF1>while</span><span class=cF0> (tmpb != &b_head)
|
|
<a name="l7"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l8"></a> tmpb1 = tmpb->next;
|
|
<a name="l9"></a> </span><span class=cF1>if</span><span class=cF0> (tmpb->template == tmpt)
|
|
<a name="l10"></a> {
|
|
<a name="l11"></a> </span><span class=cF5>QueueRemove</span><span class=cF0>(tmpb);
|
|
<a name="l12"></a> BgtEntryDel2(tmpb);
|
|
<a name="l13"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpb);
|
|
<a name="l14"></a> }
|
|
<a name="l15"></a> tmpb = tmpb1;
|
|
<a name="l16"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l17"></a>}
|
|
<a name="l18"></a>
|
|
<a name="l19"></a></span><span class=cF1>U0</span><span class=cF0> BgtTemplateDel(CBgtTemplate *tmpt)
|
|
<a name="l20"></a>{
|
|
<a name="l21"></a> BgtTemplatePurge(tmpt);
|
|
<a name="l22"></a> BgtEntryDel2(&tmpt->b);
|
|
<a name="l23"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpt);
|
|
<a name="l24"></a>}
|
|
<a name="l25"></a>
|
|
<a name="l26"></a></span><span class=cF1>U0</span><span class=cF0> BgtTemplateExpand(CBgtTemplate *tmpt, </span><span class=cF1>Bool</span><span class=cF0> periodic_copy=</span><span class=cF3>FALSE</span><span class=cF0>)
|
|
<a name="l27"></a>{
|
|
<a name="l28"></a> </span><span class=cF9>CDate</span><span class=cF0> d, </span><span class=cF1>start</span><span class=cF0>, </span><span class=cF1>end</span><span class=cF0>;
|
|
<a name="l29"></a> </span><span class=cF9>CDateStruct</span><span class=cF0> ds;
|
|
<a name="l30"></a> CBgtEntry *tmpb;
|
|
<a name="l31"></a> </span><span class=cF1>Bool</span><span class=cF0> first = </span><span class=cF3>TRUE</span><span class=cF0>;
|
|
<a name="l32"></a>
|
|
<a name="l33"></a> </span><span class=cF1>start</span><span class=cF0> = MyStr2Date(tmpt->start_date);
|
|
<a name="l34"></a> </span><span class=cF1>end</span><span class=cF0> = MyStr2Date(tmpt->end_date);
|
|
<a name="l35"></a> tmpt->b.template = tmpt;
|
|
<a name="l36"></a> </span><span class=cF1>switch</span><span class=cF0> (tmpt->type)
|
|
<a name="l37"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l38"></a> </span><span class=cF1>case</span><span class=cF0> BT_INTERVAL:
|
|
<a name="l39"></a> d = </span><span class=cF1>start</span><span class=cF0>;
|
|
<a name="l40"></a> </span><span class=cF1>while</span><span class=cF0> (d <= </span><span class=cF1>end</span><span class=cF0>)
|
|
<a name="l41"></a> {
|
|
<a name="l42"></a> </span><span class=cF1>if</span><span class=cF0> (!first || !periodic_copy)
|
|
<a name="l43"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l44"></a> tmpb = BgtEntryCopy(&tmpt->b, periodic_copy);
|
|
<a name="l45"></a> tmpb->date = d;
|
|
<a name="l46"></a> </span><span class=cF1>if</span><span class=cF0> (periodic_copy)
|
|
<a name="l47"></a> tmpb->template = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l48"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l49"></a> tmpb->type = BE_TEMPLATE_COPY;
|
|
<a name="l50"></a> BgtIns(tmpb);
|
|
<a name="l51"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l52"></a> d += tmpt->period * </span><span class=cFE>0x100000000</span><span class=cF0>;
|
|
<a name="l53"></a> first = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l54"></a> }
|
|
<a name="l55"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l56"></a>
|
|
<a name="l57"></a> </span><span class=cF1>case</span><span class=cF0> BT_MONTHLY:
|
|
<a name="l58"></a> </span><span class=cF5>Date2Struct</span><span class=cF0>(&ds, </span><span class=cF1>start</span><span class=cF0>);
|
|
<a name="l59"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
|
|
<a name="l60"></a> {
|
|
<a name="l61"></a> d = </span><span class=cF5>Struct2Date</span><span class=cF0>(&ds);
|
|
<a name="l62"></a> </span><span class=cF1>if</span><span class=cF0> (d <= </span><span class=cF1>end</span><span class=cF0>)
|
|
<a name="l63"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l64"></a> </span><span class=cF1>if</span><span class=cF0> (!first || !periodic_copy)
|
|
<a name="l65"></a> {
|
|
<a name="l66"></a> tmpb = BgtEntryCopy(&tmpt->b, periodic_copy);
|
|
<a name="l67"></a> tmpb->date = d;
|
|
<a name="l68"></a> </span><span class=cF1>if</span><span class=cF0> (periodic_copy)
|
|
<a name="l69"></a> tmpb->template = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l70"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l71"></a> tmpb->type = BE_TEMPLATE_COPY;
|
|
<a name="l72"></a> BgtIns(tmpb);
|
|
<a name="l73"></a> }
|
|
<a name="l74"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l75"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l76"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l77"></a> </span><span class=cF1>if</span><span class=cF0> (++ds.mon > </span><span class=cFE>12</span><span class=cF0>)
|
|
<a name="l78"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l79"></a> ds.mon = </span><span class=cFE>1</span><span class=cF0>;
|
|
<a name="l80"></a> ds.year++;
|
|
<a name="l81"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l82"></a> first = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l83"></a> }
|
|
<a name="l84"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l85"></a>
|
|
<a name="l86"></a> </span><span class=cF1>case</span><span class=cF0> BT_BIMONTHLY:
|
|
<a name="l87"></a> </span><span class=cF5>Date2Struct</span><span class=cF0>(&ds, </span><span class=cF1>start</span><span class=cF0>);
|
|
<a name="l88"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
|
|
<a name="l89"></a> {
|
|
<a name="l90"></a> d = </span><span class=cF5>Struct2Date</span><span class=cF0>(&ds);
|
|
<a name="l91"></a> </span><span class=cF1>if</span><span class=cF0> (d <= </span><span class=cF1>end</span><span class=cF0>)
|
|
<a name="l92"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l93"></a> </span><span class=cF1>if</span><span class=cF0> (!first || !periodic_copy)
|
|
<a name="l94"></a> {
|
|
<a name="l95"></a> tmpb = BgtEntryCopy(&tmpt->b, periodic_copy);
|
|
<a name="l96"></a> tmpb->date = d;
|
|
<a name="l97"></a> </span><span class=cF1>if</span><span class=cF0> (periodic_copy)
|
|
<a name="l98"></a> tmpb->template = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l99"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l100"></a> tmpb->type = BE_TEMPLATE_COPY;
|
|
<a name="l101"></a> BgtIns(tmpb);
|
|
<a name="l102"></a> }
|
|
<a name="l103"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l104"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l105"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l106"></a>
|
|
<a name="l107"></a> ds.mon += </span><span class=cFE>2</span><span class=cF0>;
|
|
<a name="l108"></a> </span><span class=cF1>if</span><span class=cF0> (ds.mon > </span><span class=cFE>12</span><span class=cF0>)
|
|
<a name="l109"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l110"></a> ds.mon -= </span><span class=cFE>12</span><span class=cF0>;
|
|
<a name="l111"></a> ds.year++;
|
|
<a name="l112"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l113"></a> first = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l114"></a> }
|
|
<a name="l115"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l116"></a>
|
|
<a name="l117"></a> </span><span class=cF1>case</span><span class=cF0> BT_SEMIANNUAL:
|
|
<a name="l118"></a> </span><span class=cF5>Date2Struct</span><span class=cF0>(&ds, </span><span class=cF1>start</span><span class=cF0>);
|
|
<a name="l119"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
|
|
<a name="l120"></a> {
|
|
<a name="l121"></a> d = </span><span class=cF5>Struct2Date</span><span class=cF0>(&ds);
|
|
<a name="l122"></a> </span><span class=cF1>if</span><span class=cF0> (d <= </span><span class=cF1>end</span><span class=cF0>)
|
|
<a name="l123"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l124"></a> </span><span class=cF1>if</span><span class=cF0> (!first || !periodic_copy)
|
|
<a name="l125"></a> {
|
|
<a name="l126"></a> tmpb = BgtEntryCopy(&tmpt->b, periodic_copy);
|
|
<a name="l127"></a> tmpb->date = d;
|
|
<a name="l128"></a> </span><span class=cF1>if</span><span class=cF0> (periodic_copy)
|
|
<a name="l129"></a> tmpb->template = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l130"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l131"></a> tmpb->type = BE_TEMPLATE_COPY;
|
|
<a name="l132"></a> BgtIns(tmpb);
|
|
<a name="l133"></a> }
|
|
<a name="l134"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l135"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l136"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l137"></a> ds.mon += </span><span class=cFE>6</span><span class=cF0>;
|
|
<a name="l138"></a> </span><span class=cF1>if</span><span class=cF0> (ds.mon></span><span class=cFE>12</span><span class=cF0>)
|
|
<a name="l139"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l140"></a> ds.mon -= </span><span class=cFE>12</span><span class=cF0>;
|
|
<a name="l141"></a> ds.year++;
|
|
<a name="l142"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l143"></a> first = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l144"></a> }
|
|
<a name="l145"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l146"></a>
|
|
<a name="l147"></a> </span><span class=cF1>case</span><span class=cF0> BT_ANNUAL:
|
|
<a name="l148"></a> </span><span class=cF5>Date2Struct</span><span class=cF0>(&ds, </span><span class=cF1>start</span><span class=cF0>);
|
|
<a name="l149"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
|
|
<a name="l150"></a> {
|
|
<a name="l151"></a> d = </span><span class=cF5>Struct2Date</span><span class=cF0>(&ds);
|
|
<a name="l152"></a> </span><span class=cF1>if</span><span class=cF0> (d <= </span><span class=cF1>end</span><span class=cF0>)
|
|
<a name="l153"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l154"></a> </span><span class=cF1>if</span><span class=cF0> (!first || !periodic_copy)
|
|
<a name="l155"></a> {
|
|
<a name="l156"></a> tmpb = BgtEntryCopy(&tmpt->b, periodic_copy);
|
|
<a name="l157"></a> tmpb->date = d;
|
|
<a name="l158"></a> </span><span class=cF1>if</span><span class=cF0> (periodic_copy)
|
|
<a name="l159"></a> tmpb->template = </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l160"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l161"></a> tmpb->type = BE_TEMPLATE_COPY;
|
|
<a name="l162"></a> BgtIns(tmpb);
|
|
<a name="l163"></a> }
|
|
<a name="l164"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l165"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l166"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l167"></a> ds.year++;
|
|
<a name="l168"></a> first = </span><span class=cF3>FALSE</span><span class=cF0>;
|
|
<a name="l169"></a> }
|
|
<a name="l170"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l171"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l172"></a>}
|
|
<a name="l173"></a>
|
|
<a name="l174"></a></span><span class=cF1>U0</span><span class=cF0> CBgtTemplatesExpand()
|
|
<a name="l175"></a>{
|
|
<a name="l176"></a> CBgtTemplate *tmpt = t_head.next;
|
|
<a name="l177"></a>
|
|
<a name="l178"></a> </span><span class=cF1>while</span><span class=cF0> (tmpt != &t_head)
|
|
<a name="l179"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l180"></a> BgtTemplateExpand(tmpt);
|
|
<a name="l181"></a> tmpt = tmpt->next;
|
|
<a name="l182"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l183"></a>}
|
|
<a name="l184"></a>
|
|
<a name="l185"></a>CBgtTemplate *BgtTemplatePrompt(CBgtTemplate *default_t=</span><span class=cF3>NULL</span><span class=cF0>, CBgtEntry *default_b=</span><span class=cF3>NULL</span><span class=cF0>)
|
|
<a name="l186"></a>{
|
|
<a name="l187"></a> CBgtTemplate t, *tmpt;
|
|
<a name="l188"></a> CBgtEntry *tmpb;
|
|
<a name="l189"></a>
|
|
<a name="l190"></a> </span><span class=cF5>MemSet</span><span class=cF0>(&t, </span><span class=cFE>0</span><span class=cF0>, </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>CBgtTemplate</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l191"></a> </span><span class=cF1>if</span><span class=cF0> (default_t)
|
|
<a name="l192"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l193"></a> </span><span class=cF5>MemCopy</span><span class=cF0>(&t.</span><span class=cF1>start</span><span class=cF0>, &default_t-></span><span class=cF1>start</span><span class=cF0>, BT_SIZE);
|
|
<a name="l194"></a> default_b = &default_t->b;
|
|
<a name="l195"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l196"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l197"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l198"></a> t.type = BT_INTERVAL;
|
|
<a name="l199"></a> </span><span class=cF1>if</span><span class=cF0> (default_b)
|
|
<a name="l200"></a> </span><span class=cF5>StrPrint</span><span class=cF0>(&t.start_date, </span><span class=cF6>"%D"</span><span class=cF0>, default_b->date);
|
|
<a name="l201"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l202"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(&t.start_date, </span><span class=cF6>"["</span><span class=cF0>);
|
|
<a name="l203"></a> </span><span class=cF5>StrCopy</span><span class=cF0>(&t.end_date, </span><span class=cF6>"]"</span><span class=cF0>);
|
|
<a name="l204"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l205"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>)
|
|
<a name="l206"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>PopUpForm</span><span class=cF7>(</span><span class=cF0>&t</span><span class=cF7>)</span><span class=cF0> && </span><span class=cF7>(</span><span class=cF0>(t.type == BT_INTERVAL && t.period > </span><span class=cFE>0</span><span class=cF0>) || t.type > BT_INTERVAL</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l207"></a> </span><span class=cF7>{</span><span class=cF0>
|
|
<a name="l208"></a> </span><span class=cF1>if</span><span class=cF0> (tmpb = BgtEntryPrompt</span><span class=cF7>(</span><span class=cF0>default_b</span><span class=cF7>)</span><span class=cF0>)
|
|
<a name="l209"></a> {
|
|
<a name="l210"></a> tmpt = </span><span class=cF5>CAlloc</span><span class=cF0>(</span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>CBgtTemplate</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l211"></a> </span><span class=cF5>MemCopy</span><span class=cF0>(&tmpt-></span><span class=cF1>start</span><span class=cF0>, &t.</span><span class=cF1>start</span><span class=cF0>, BT_SIZE);
|
|
<a name="l212"></a> </span><span class=cF5>MemCopy</span><span class=cF0>(&tmpt->b, tmpb, </span><span class=cF1>sizeof</span><span class=cF7>(</span><span class=cF0>CBgtEntry</span><span class=cF7>)</span><span class=cF0>);
|
|
<a name="l213"></a> </span><span class=cF5>Free</span><span class=cF0>(tmpb);
|
|
<a name="l214"></a> </span><span class=cF1>return</span><span class=cF0> tmpt;
|
|
<a name="l215"></a> }
|
|
<a name="l216"></a> </span><span class=cF7>}</span><span class=cF0>
|
|
<a name="l217"></a> </span><span class=cF1>else</span><span class=cF0>
|
|
<a name="l218"></a> </span><span class=cF1>break</span><span class=cF0>;
|
|
<a name="l219"></a>
|
|
<a name="l220"></a> </span><span class=cF1>return</span><span class=cF0> </span><span class=cF3>NULL</span><span class=cF0>;
|
|
<a name="l221"></a>}
|
|
</span></pre></body>
|
|
</html>
|