summaryrefslogtreecommitdiff
path: root/plugins/TrafficCounter/src/misc.h
blob: e8ac6c10ea9ec9f6e12842ceed9fc2fa77986e88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
typedef struct
{
	TCHAR Alignment;	// Âûðàâíèâàíèå. L - ê ëåâîé ãðàíèöå, R - ê ïðàâîé.
	WORD Interval;		// Ðàññòîÿíèå, íà êîòîðîå ãðàíèöà ñòðîêè îòñòîèò îò ëåâîãî êðàÿ ôðåéìà.
	TCHAR *String;		// Ñîáñòâåííî ñòðîêà.
} RowItemInfo;

/* Ôóíêöèÿ ðàçáèðàåò ñòðîêó è âîçâðàùàåò ñïèñîê òåãîâ è ñîîòâåòñòâóþùèõ èì ñòðîê.
Àðãóìåíòû:
InputString - ñòðîêà äëÿ ðàçáîðà;
RowItemsList - ñïèñîê íàéäåííûõ ýëåìåíòîâ.
Âîçâðàùàåìîå çíà÷åíèå - êîëè÷åñòâî ýëåìåíòîâ â ñïèñêàõ. */
WORD GetRowItems(TCHAR *InputString, RowItemInfo **RowItemsList);

/* Ôóíêöèÿ âîçâðàùàåò êîëè÷åñòâî äíåé â óêàçàííîì ìåñÿöå óêàçàííîãî ãîäà. */
BYTE DaysInMonth(BYTE Month, WORD Year);

// Ôóíêöèÿ îïðåäåëÿåò äåíü íåäåëè ïî äàòå
// 7 - ÂÑ, 1 - ÏÍ è ò. ä.
BYTE DayOfWeek(BYTE Day, BYTE Month, WORD Year);

/* Àðãóìåíòû:
	Value - êîëè÷åñòâî áàéò;
	Unit - åäèíèöû èçìåðåíèÿ (0 - áàéòû, 1 - êèëîáàéòû, 2 - ìåãàáàéòû, 3 - àâòîìàòè÷åñêè);
	Buffer - àäðåñ ñòðîêè äëÿ çàïèñè ðåçóëüòàòà;
	Size - ðàçìåð áóôåðà.
Âîçâðàùàåìîå çíà÷åíèå: òðåáóåìûé ðàçìåð áóôåðà. */
WORD GetFormattedTraffic(DWORD Value, BYTE Unit, TCHAR *Buffer, WORD Size);

WORD GetDurationFormatM(DWORD Duration, TCHAR *Format, TCHAR *Buffer, WORD Size);

signed short int TimeCompare(SYSTEMTIME st1, SYSTEMTIME st2);