Rev 8193 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
8193 | maxcodehac | 1 | |
2 | * Backy_lib.h |
||
3 | * Author: JohnXenox aka Aleksandr Igorevich. |
||
4 | */ |
||
5 | |||
6 | |||
7 | #define __Backy_lib_h__ |
||
8 | |||
8467 | maxcodehac | 9 | |
10 | char* strrev(char *p) |
||
11 | { |
||
12 | char *q = p, *res = p, z; |
||
13 | while(q && *q) ++q; /* find eos */ |
||
14 | for(--q; p < q; ++p, --q) |
||
15 | { |
||
16 | z = *p; |
||
17 | *p = *q; |
||
18 | *q = z; |
||
19 | } |
||
20 | return res; |
||
21 | } |
||
22 | char* itoab(unsigned int n, char* s, int b) |
||
23 | { |
||
24 | char *ptr; |
||
25 | int lowbit; |
||
26 | ptr = s; |
||
27 | b >>= 1; |
||
28 | do { |
||
29 | lowbit = n & 1; |
||
30 | n = (n >> 1) & 0x7FFFFFFF; |
||
31 | *ptr = ((n % b) << 1) + lowbit; |
||
32 | if(*ptr < 10) *ptr += '0'; else *ptr += 55; |
||
33 | ++ptr; |
||
34 | } while(n /= b); |
||
35 | *ptr = 0; |
||
36 | return strrev(s); |
||
37 | } |
||
38 | |||
39 | |||
8193 | maxcodehac | 40 | typedef unsigned int uint32_t; |
41 | typedef unsigned char uint8_t; |
||
42 | typedef unsigned short int uint16_t; |
||
43 | typedef unsigned long long uint64_t; |
||
44 | typedef char int8_t; |
||
45 | typedef short int int16_t; |
||
46 | typedef int int32_t; |
||
47 | typedef long long int64_t; |
||
48 | */ |
||
49 | static inline uint32_t getDate(void) |
||
50 | { |
||
51 | uint32_t date; |
||
52 | __asm__ __volatile__("int $0x40":"=a"(date):"a"(29)); |
||
53 | return date; |
||
54 | } |
||
55 | |||
56 | |||
57 | |||
58 | |||
59 | { |
||
60 | uint32_t time; |
||
61 | __asm__ __volatile__("int $0x40":"=a"(time):"a"(3)); |
||
62 | return time; |
||
63 | } |
||
64 | |||
65 | |||
66 | |||
67 | |||
68 | { |
||
69 | uint8_t *fd; |
||
70 | |||
71 | |||
72 | |||
73 | |||
74 | } |
||
75 | |||
76 | |||
8467 | maxcodehac | 77 | { |
8193 | maxcodehac | 78 | int p1; |
8467 | maxcodehac | 79 | int p2; |
80 | int p3; |
||
81 | int p4; |
||
82 | |||
8193 | maxcodehac | 83 | |
8467 | maxcodehac | 84 | int p6; |
85 | char* p7; |
||
86 | }; |
||
8193 | maxcodehac | 87 | |
8467 | maxcodehac | 88 | |
8193 | maxcodehac | 89 | { |
90 | int32_t val; |
||
91 | |||
8467 | maxcodehac | 92 | |
93 | |||
8193 | maxcodehac | 94 | |
8467 | maxcodehac | 95 | dt.p2= 0; // reserved. |
96 | dt.p3 = 0; // reserved. |
||
97 | dt.p4 = nbytes; // number of bytes to write. |
||
98 | dt.p5 = data; // pointer to data. |
||
99 | dt.p6 = enc; // string encoding (0 = default, 1 = cp866, 2 = UTF-16LE, 3 = UTF-8). |
||
100 | dt.p7 = path; // pointer to path. |
||
101 | |||
8193 | maxcodehac | 102 | |
8467 | maxcodehac | 103 | |
104 | |||
8193 | maxcodehac | 105 | } |
106 | |||
107 | |||
108 | { |
||
109 | #if defined (lang_en) |
||
110 | |||
111 | |||
112 | { |
||
113 | case 2: con_printf("\nThe function isn't supported for the given file system!\n"); |
||
114 | return 2; |
||
115 | |||
116 | |||
117 | return 3; |
||
118 | |||
119 | |||
120 | return 5; |
||
121 | |||
122 | |||
123 | return 6; |
||
124 | |||
125 | |||
126 | return 7; |
||
127 | |||
128 | |||
129 | return 8; |
||
130 | |||
131 | |||
132 | return 9; |
||
133 | |||
134 | |||
135 | return 10; |
||
136 | |||
137 | |||
138 | return 11; |
||
139 | |||
140 | |||
141 | return 12; |
||
142 | } |
||
143 | |||
144 | |||
145 | |||
146 | |||
147 | { |
||
148 | case 2: con_printf("\nФункция не поддерживается для данной файловой системы!\n"); |
||
149 | return 2; |
||
150 | |||
151 | |||
152 | return 3; |
||
153 | |||
154 | |||
155 | return 5; |
||
156 | |||
157 | |||
158 | return 6; |
||
159 | |||
160 | |||
161 | return 7; |
||
162 | |||
163 | |||
164 | return 8; |
||
165 | |||
166 | |||
167 | return 9; |
||
168 | |||
169 | |||
170 | return 10; |
||
171 | |||
172 | |||
173 | return 11; |
||
174 | |||
175 | |||
176 | return 12; |
||
177 | } |
||
178 | |||
179 | |||
180 | } |
||
181 | |||
182 | |||
183 | |||
184 | |||
185 | |||
186 | |||
187 | |||
188 | |||
189 |