Rev 3920 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3920 | Rev 4422 | ||
---|---|---|---|
Line 73... | Line 73... | ||
73 | include 'libini_p.asm' |
73 | include 'libini_p.asm' |
Line 74... | Line 74... | ||
74 | 74 | ||
75 | ;;================================================================================================;; |
75 | ;;================================================================================================;; |
76 | proc ini.enum_sections _f_name, _callback ;///////////////////////////////////////////////////////;; |
76 | proc ini.enum_sections _f_name, _callback ;///////////////////////////////////////////////////////;; |
77 | ;;------------------------------------------------------------------------------------------------;; |
- | |
78 | ;? Enumerate sections, calling callback function for each of them ;; |
77 | ;;------------------------------------------------------------------------------------------------;; |
79 | ;;------------------------------------------------------------------------------------------------;; |
78 | ;? Enumerate sections, calling c2------------------------------------------------------------------;; |
80 | ;> _f_name = ini filename |
79 | ;> _f_name = ini filename |
81 | ;> _callback = callback function address: func(f_name, sec_name), where ;; |
80 | ;> _callback = callback function address: func(f_name, sec_name), where ;; |
82 | ;> f_name = ini filename (as passed to the function) |
81 | ;> f_name = ini filename (as passed to the function) |
83 | ;> sec_name = section name found |
82 | ;> sec_name = section name found |
Line 374... | Line 373... | ||
374 | jz .exit_error |
373 | jz .exit_error |
375 | mov [f.buf], eax |
374 | mov [f.buf], eax |
376 | lea ebx, [f] |
375 | lea ebx, [f] |
377 | mov [f_addr], ebx |
376 | mov [f_addr], ebx |
Line -... | Line 377... | ||
- | 377 | ||
- | 378 | ;/GerdtR - bugfix: at end of file required empty line |
|
- | 379 | invoke file.seek, [f.fh],2,SEEK_END |
|
- | 380 | invoke file.read, [f.fh],[f.buf],2 |
|
- | 381 | mov edx,[f.buf] |
|
- | 382 | cmp word[edx],0A0Dh |
|
- | 383 | je @f |
|
- | 384 | mov word[edx],0A0Dh |
|
- | 385 | invoke file.seek, [f.fh],0,SEEK_END |
|
- | 386 | invoke file.write, [f.fh],[f.buf],2 |
|
- | 387 | @@: |
|
- | 388 | ||
- | 389 | ; lea ebx, [f] |
|
- | 390 | ;\GerdtR |
|
378 | 391 | ||
379 | stdcall libini._.find_section, ebx, [_sec_name] |
392 | stdcall libini._.find_section, ebx, [_sec_name] |
380 | or eax, eax |
393 | or eax, eax |
Line 381... | Line 394... | ||
381 | jnz .create_section |
394 | jnz .create_section |
Line 431... | Line 444... | ||
431 | mov edi, [f.buf] |
444 | mov edi, [f.buf] |
432 | add edi, ini.BLOCK_SIZE |
445 | add edi, ini.BLOCK_SIZE |
433 | push edi |
446 | push edi |
Line 434... | Line 447... | ||
434 | 447 | ||
- | 448 | mov esi, [_sec_name] |
|
435 | mov esi, [_sec_name] |
449 | |
436 | mov byte[edi], '[' |
450 | mov byte[edi], '[' |
437 | inc edi |
451 | inc edi |
438 | call libini._.string_copy |
452 | call libini._.string_copy |
439 | mov dword[edi], ']' + (0x0A0D shl 8) |
453 | mov dword[edi], ']' + (0x0A0D shl 8) |
Line 696... | Line 710... | ||
696 | endMem rd 1 |
710 | endMem rd 1 |
697 | begDel rd 1 |
711 | begDel rd 1 |
698 | endDel rd 1 |
712 | endDel rd 1 |
699 | endl |
713 | endl |
700 | push ebx ecx edi esi |
714 | push ebx ecx edi esi |
- | 715 | xor eax,eax |
|
701 | mov dword[funcFile],5 ;get file info |
716 | mov dword[funcFile],5 ;get file info |
702 | mov dword[funcFile+4],0 |
717 | mov dword[funcFile+4],eax |
703 | mov dword[funcFile+8],0 |
718 | mov dword[funcFile+8],eax |
704 | mov dword[funcFile+12],0 |
719 | mov dword[funcFile+12],eax |
705 | lea eax,[fileInfo] |
720 | lea eax,[fileInfo] |
706 | mov dword[funcFile+16],eax |
721 | mov dword[funcFile+16],eax |
707 | mov byte[funcFile+20],0 |
722 | mov byte[funcFile+20],0 |
708 | m2m dword[funcFile+21],[_f_name] |
723 | m2m dword[funcFile+21],[_f_name] |
709 | lea ebx,[funcFile] |
724 | lea ebx,[funcFile] |
Line 797... | Line 812... | ||
797 | pop esi edi ecx ebx |
812 | pop esi edi ecx ebx |
798 | ret |
813 | ret |
799 | endp |
814 | endp |
Line 800... | Line -... | ||
800 | - | ||
801 | - | ||
802 | 815 | ||
803 | 816 | ||
804 | ;;================================================================================================;; |
817 | ;;================================================================================================;; |
805 | proc ini.get_shortcut _f_name, _sec_name, _key_name, _def_val, _modifiers ;///////////////////////;; |
818 | proc ini.get_shortcut _f_name, _sec_name, _key_name, _def_val, _modifiers ;///////////////////////;; |
806 | ;;------------------------------------------------------------------------------------------------;; |
819 | ;;------------------------------------------------------------------------------------------------;; |