Rev 1001 | Rev 1295 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1001 | Rev 1048 | ||
---|---|---|---|
Line 58... | Line 58... | ||
58 | ;;------------------------------------------------------------------------------------------------;; |
58 | ;;------------------------------------------------------------------------------------------------;; |
59 | ;> --- TBD --- ;; |
59 | ;> --- TBD --- ;; |
60 | ;;------------------------------------------------------------------------------------------------;; |
60 | ;;------------------------------------------------------------------------------------------------;; |
61 | ;< --- TBD --- ;; |
61 | ;< --- TBD --- ;; |
62 | ;;================================================================================================;; |
62 | ;;================================================================================================;; |
63 | ;push ecx |
- | |
64 | ;mov ecx,[f] |
- | |
65 | ;inc [ecx+INIFILE.cnt] |
- | |
66 | ;dec esi |
- | |
67 | ;pop ecx |
- | |
68 | ;ret |
- | |
69 | push eax ecx |
63 | push eax ecx |
70 | mov ecx, [_f] |
64 | mov ecx, [_f] |
71 | inc [ecx + IniFile.cnt] |
65 | inc [ecx + IniFile.cnt] |
72 | dec esi |
66 | dec esi |
73 | mov eax, [ecx + IniFile.bsize] |
67 | mov eax, [ecx + IniFile.bsize] |
74 | cmp [ecx + IniFile.cnt], eax |
68 | cmp [ecx + IniFile.cnt], eax |
75 | jle @f |
69 | jle @f |
76 | stdcall libini._.unload_block, [_f] |
70 | stdcall libini._.unload_block, [_f] |
77 | @@: ;mov al,[esi-1] |
- | |
78 | pop ecx eax |
71 | @@: pop ecx eax |
79 | ret |
72 | ret |
80 | endp |
73 | endp |
Line 81... | Line 74... | ||
81 | 74 | ||
82 | ;;================================================================================================;; |
75 | ;;================================================================================================;; |
Line 114... | Line 107... | ||
114 | je @b |
107 | je @b |
115 | cmp al, 10 |
108 | cmp al, 10 |
116 | je @b |
109 | je @b |
117 | cmp al, 9 |
110 | cmp al, 9 |
118 | je @b |
111 | je @b |
- | 112 | cmp al, ini.COMMENT_CHAR |
|
- | 113 | jne @f |
|
- | 114 | stdcall libini._.skip_line, [_f] |
|
- | 115 | jmp @b |
|
119 | @@: stdcall libini._.unget_char, [_f] |
116 | @@: stdcall libini._.unget_char, [_f] |
120 | ;inc [ecx+INIFILE.cnt] |
- | |
121 | ret |
117 | ret |
122 | endp |
118 | endp |
Line 123... | Line 119... | ||
123 | 119 | ||
124 | ;;================================================================================================;; |
120 | ;;================================================================================================;; |
Line 135... | Line 131... | ||
135 | cmp al, 32 |
131 | cmp al, 32 |
136 | je @b |
132 | je @b |
137 | cmp al, 9 |
133 | cmp al, 9 |
138 | je @b |
134 | je @b |
139 | @@: stdcall libini._.unget_char, [_f] |
135 | @@: stdcall libini._.unget_char, [_f] |
140 | ;inc [ecx+INIFILE.cnt] |
- | |
141 | ret |
136 | ret |
142 | endp |
137 | endp |
Line 143... | Line 138... | ||
143 | 138 | ||
144 | ;;================================================================================================;; |
139 | ;;================================================================================================;; |
Line 157... | Line 152... | ||
157 | cmp al, 13 |
152 | cmp al, 13 |
158 | je @f |
153 | je @f |
159 | cmp al, 10 |
154 | cmp al, 10 |
160 | jne @b |
155 | jne @b |
161 | @@: stdcall libini._.unget_char, [_f] |
156 | @@: stdcall libini._.unget_char, [_f] |
162 | ;inc [ecx+INIFILE.cnt] |
- | |
163 | ret |
157 | ret |
164 | endp |
158 | endp |
Line 165... | Line 159... | ||
165 | 159 | ||
166 | ;;================================================================================================;; |
160 | ;;================================================================================================;; |
Line 176... | Line 170... | ||
176 | mov ebx, [_f] |
170 | mov ebx, [_f] |
177 | mov eax, [ebx + IniFile.pos] |
171 | mov eax, [ebx + IniFile.pos] |
178 | add eax, -ini.BLOCK_SIZE |
172 | add eax, -ini.BLOCK_SIZE |
179 | invoke file.seek, [ebx + IniFile.fh], eax, SEEK_SET |
173 | invoke file.seek, [ebx + IniFile.fh], eax, SEEK_SET |
180 | stdcall libini._.preload_block, ebx |
174 | stdcall libini._.preload_block, ebx |
181 | add esi, eax ; ini.BLOCK_SIZE |
175 | add esi, eax |
182 | mov [ebx + IniFile.cnt], 0 |
176 | mov [ebx + IniFile.cnt], 0 |
183 | pop ecx ebx eax |
177 | pop ecx ebx eax |
184 | ret |
178 | ret |
185 | endp |
179 | endp |
Line 206... | Line 200... | ||
206 | mov [ebx + IniFile.pos], eax |
200 | mov [ebx + IniFile.pos], eax |
207 | invoke file.read, [ebx + IniFile.fh], esi, ini.BLOCK_SIZE |
201 | invoke file.read, [ebx + IniFile.fh], esi, ini.BLOCK_SIZE |
208 | mov esi,[ebx + IniFile.buf] |
202 | mov esi,[ebx + IniFile.buf] |
209 | cmp eax,ini.BLOCK_SIZE |
203 | cmp eax,ini.BLOCK_SIZE |
210 | jl @f |
204 | jl @f |
211 | ;dec eax |
- | |
212 | @@: mov [ebx + IniFile.cnt], eax;ini.BLOCK_SIZE-1 |
205 | @@: mov [ebx + IniFile.cnt], eax |
213 | mov [ebx + IniFile.bsize], eax |
206 | mov [ebx + IniFile.bsize], eax |
214 | pop ecx ebx eax |
207 | pop ecx ebx eax |
215 | ret |
208 | ret |
216 | endp |
209 | endp |
Line 271... | Line 264... | ||
271 | 264 | ||
272 | mov ebx, [_f] |
265 | mov ebx, [_f] |
273 | mov ecx, [ebx + IniFile.cnt] |
266 | mov ecx, [ebx + IniFile.cnt] |
274 | mov ebx, [ebx + IniFile.fh] |
267 | mov ebx, [ebx + IniFile.fh] |
275 | invoke file.tell, ebx |
- | |
276 | ; push eax |
268 | invoke file.tell, ebx |
277 | sub eax, ecx |
- | |
278 | ; dec eax |
269 | sub eax, ecx |
279 | invoke file.seek, ebx, eax, SEEK_SET |
270 | invoke file.seek, ebx, eax, SEEK_SET |
280 | @@: invoke file.seek, ebx, [_delta], SEEK_CUR |
271 | @@: invoke file.seek, ebx, [_delta], SEEK_CUR |
281 | invoke file.eof?, ebx |
272 | invoke file.eof?, ebx |
282 | or eax, eax |
273 | or eax, eax |
283 | jnz .done |
274 | jnz .done |
284 | invoke file.read, ebx, [buf], ini.BLOCK_SIZE |
275 | invoke file.read, ebx, [buf], ini.BLOCK_SIZE |
285 | mov ecx, eax |
276 | mov ecx, eax |
286 | mov eax, [_delta] |
277 | mov eax, [_delta] |
287 | neg eax |
278 | neg eax |
288 | sub eax, ecx;ini.BLOCK_SIZE |
279 | sub eax, ecx |
289 | invoke file.seek, ebx, eax, SEEK_CUR |
280 | invoke file.seek, ebx, eax, SEEK_CUR |
290 | invoke file.write, ebx, [buf], ecx;ini.BLOCK_SIZE |
281 | invoke file.write, ebx, [buf], ecx |
291 | jmp @b |
282 | jmp @b |
292 | .done: |
283 | .done: |
293 | mov eax, [_delta] |
284 | mov eax, [_delta] |
294 | neg eax |
285 | neg eax |
295 | invoke file.seek, ebx, eax, SEEK_CUR |
286 | invoke file.seek, ebx, eax, SEEK_CUR |
296 | invoke file.seteof, ebx |
- | |
297 | ; pop eax |
- | |
298 | ; invoke file.seek, ebx, SEEK_SET;, eax |
287 | invoke file.seteof, ebx |
299 | stdcall libini._.reload_block, [_f] |
288 | stdcall libini._.reload_block, [_f] |
300 | invoke mem.free, [buf] |
289 | invoke mem.free, [buf] |
301 | pop ecx ebx |
290 | pop ecx ebx |
302 | .skip: |
291 | .skip: |
Line 311... | Line 300... | ||
311 | 300 | ||
312 | mov ebx, [_f] |
301 | mov ebx, [_f] |
313 | mov ecx, [ebx + IniFile.cnt] |
302 | mov ecx, [ebx + IniFile.cnt] |
314 | mov ebx, [ebx + IniFile.fh] |
303 | mov ebx, [ebx + IniFile.fh] |
315 | invoke file.tell, ebx |
- | |
316 | ; push eax |
304 | invoke file.tell, ebx |
317 | sub eax, ecx |
305 | sub eax, ecx |
318 | lea edx, [eax - 1] |
306 | lea edx, [eax - 1] |
319 | push edx |
307 | push edx |
320 | @@: invoke file.seek, ebx, edx, SEEK_SET |
308 | @@: invoke file.seek, ebx, edx, SEEK_SET |
Line 337... | Line 325... | ||
337 | invoke file.write, ebx, [buf], ecx |
325 | invoke file.write, ebx, [buf], ecx |
338 | jmp @b |
326 | jmp @b |
339 | @@: |
327 | @@: |
340 | .skip.2: |
328 | .skip.2: |
341 | add esp, 4 |
329 | add esp, 4 |
342 | ; mov eax,[delta] |
- | |
343 | ; neg eax |
- | |
344 | ; invoke file.seek,ebx,SEEK_CUR,eax |
- | |
345 | ; pop eax |
- | |
346 | ; invoke file.seek,ebx,SEEK_SET;,eax |
- | |
347 | stdcall libini._.reload_block, [_f] |
330 | stdcall libini._.reload_block, [_f] |
348 | invoke mem.free, [buf] |
331 | invoke mem.free, [buf] |
349 | pop ecx ebx |
332 | pop ecx ebx |
350 | ret |
333 | ret |
351 | endp |
334 | endp |
Line 449... | Line 432... | ||
449 | stdcall libini._.find_next_section, [_f] |
432 | stdcall libini._.find_next_section, [_f] |
450 | or eax, eax |
433 | or eax, eax |
451 | jnz .exit_error |
434 | jnz .exit_error |
Line 452... | Line 435... | ||
452 | 435 | ||
453 | stdcall libini._.get_char, [_f] |
- | |
454 | ; inc esi |
- | |
455 | ; dec [ecx + IniFile.cnt] |
436 | stdcall libini._.get_char, [_f] |
456 | stdcall libini._.skip_spaces, [_f] |
437 | stdcall libini._.skip_spaces, [_f] |
457 | mov edi, [_sec_name] |
438 | mov edi, [_sec_name] |
458 | @@: stdcall libini._.get_char, [_f] |
439 | @@: stdcall libini._.get_char, [_f] |
459 | cmp al, ']' |
440 | cmp al, ']' |
Line 562... | Line 543... | ||
562 | or al, al |
543 | or al, al |
563 | jnz @b |
544 | jnz @b |
564 | @@: stdcall libini._.unget_char, [_f_addr] |
545 | @@: stdcall libini._.unget_char, [_f_addr] |
565 | mov byte[edi], 0 |
546 | mov byte[edi], 0 |
566 | dec edi |
547 | dec edi |
- | 548 | @@: cmp edi, [_buffer] |
|
- | 549 | jb @f |
|
567 | @@: cmp byte[edi], 32 |
550 | cmp byte[edi], 32 |
568 | ja @f |
551 | ja @f |
569 | mov byte[edi], 0 |
552 | mov byte[edi], 0 |
570 | dec edi |
553 | dec edi |
571 | cmp edi, [_buffer] |
- | |
572 | jae @b |
554 | jmp @b |
573 | @@: pop eax edi |
555 | @@: pop eax edi |
574 | ret |
556 | ret |
575 | endp |
557 | endp |
Line 576... | Line 558... | ||
576 | 558 |