Subversion Repositories Kolibri OS

Rev

Rev 1001 | Rev 1102 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1001 Rev 1048
Line 15... Line 15...
15
;; You should have received a copy of the GNU Lesser General Public License along with Libs-Dev.  ;;
15
;; You should have received a copy of the GNU Lesser General Public License along with Libs-Dev.  ;;
16
;; If not, see .                                                    ;;
16
;; If not, see .                                                    ;;
17
;;                                                                                                ;;
17
;;                                                                                                ;;
18
;;================================================================================================;;
18
;;================================================================================================;;
19
;;                                                                                                ;;
19
;;                                                                                                ;;
-
 
20
;; 2009-03-08 (mike.dld)                                                                          ;;
-
 
21
;;   bug-fixes:                                                                                   ;;
-
 
22
;;     - moved buffer bound check in libini._.low.read_value up (reported by Insolor)             ;;
-
 
23
;;   new features:                                                                                ;;
-
 
24
;;     - comments support (char is ini.COMMENT_CHAR, defaults to ';')                             ;;
-
 
25
;;       inline comments are not supported                                                        ;;
20
;; 2008-12-29 (mike.dld)                                                                          ;;
26
;; 2008-12-29 (mike.dld)                                                                          ;;
21
;;   bug-fixes:                                                                                   ;;
27
;;   bug-fixes:                                                                                   ;;
22
;;     - unnecessary 'stosb' in ini.get_str was causing problems                                  ;;
28
;;     - unnecessary 'stosb' in ini.get_str was causing problems                                  ;;
23
;;   new features:                                                                                ;;
29
;;   new features:                                                                                ;;
24
;;     - new functions: ini.get_color and ini.set_color                                           ;;
30
;;     - new functions: ini.get_color and ini.set_color                                           ;;
Line 115... Line 121...
115
	or	eax, eax
121
	or	eax, eax
116
	jnz	.exit_error
122
	jnz	.exit_error
Line 117... Line 123...
117
 
123
 
118
	stdcall libini._.get_char, [f_addr]
124
	stdcall libini._.get_char, [f_addr]
119
	stdcall libini._.skip_spaces, [f_addr]
-
 
120
;       inc     esi
-
 
121
;       dec     [f.cnt]
125
	stdcall libini._.skip_spaces, [f_addr]
122
	mov	edi, [sec_buf]
126
	mov	edi, [sec_buf]
123
    @@: stdcall libini._.get_char, [f_addr]
127
    @@: stdcall libini._.get_char, [f_addr]
124
	cmp	al, ']'
128
	cmp	al, ']'
125
	je	@f
129
	je	@f
Line 383... Line 387...
383
	stdcall libini._.shift_content, [f_addr], eax
387
	stdcall libini._.shift_content, [f_addr], eax
Line 384... Line 388...
384
 
388
 
385
  .modify_key.ex:
389
  .modify_key.ex:
386
	invoke	file.tell, [f.fh]
390
	invoke	file.tell, [f.fh]
387
	sub	eax, [f.cnt]
-
 
388
;       dec     eax
391
	sub	eax, [f.cnt]
389
	invoke	file.seek, [f.fh], eax, SEEK_SET
392
	invoke	file.seek, [f.fh], eax, SEEK_SET
Line 390... Line 393...
390
	invoke	file.write, [f.fh], [_buffer], [_buf_len]
393
	invoke	file.write, [f.fh], [_buffer], [_buf_len]
391
 
394
 
Line 397... Line 400...
397
	mov	edi, [f.buf]
400
	mov	edi, [f.buf]
398
	add	edi, ini.BLOCK_SIZE
401
	add	edi, ini.BLOCK_SIZE
399
	push	edi
402
	push	edi
Line 400... Line 403...
400
 
403
 
401
  .create_key.ex:
-
 
402
;       mov     word[edi], 0x0A0D
-
 
403
;       add     edi,2
404
  .create_key.ex:
404
	mov	esi, [_key_name]
405
	mov	esi, [_key_name]
405
	call	libini._.string_copy
406
	call	libini._.string_copy
406
	mov	byte[edi], '='
407
	mov	byte[edi], '='
407
	inc	edi
408
	inc	edi
Line 425... Line 426...
425
	mov	edi, [f.buf]
426
	mov	edi, [f.buf]
426
	add	edi, ini.BLOCK_SIZE
427
	add	edi, ini.BLOCK_SIZE
427
	push	edi
428
	push	edi
Line 428... Line 429...
428
 
429
 
429
	mov	esi, [_sec_name]
-
 
430
;       mov     dword[edi], 0x0A0D + ('[' shl 16)
-
 
431
;       add     edi, 3
430
	mov	esi, [_sec_name]
432
	mov	byte[edi], '['
431
	mov	byte[edi], '['
433
	inc	edi
432
	inc	edi
434
	call	libini._.string_copy
-
 
435
;       mov     byte[edi], ']'
-
 
436
;       inc     edi
433
	call	libini._.string_copy
437
	mov	dword[edi], ']' + (0x0A0D shl 8)
434
	mov	dword[edi], ']' + (0x0A0D shl 8)
Line 438... Line 435...
438
	add	edi, 3
435
	add	edi, 3
Line 483... Line 480...
483
 
480
 
484
	stdcall libini._.find_key, ebx, [_key_name]
481
	stdcall libini._.find_key, ebx, [_key_name]
485
	or	eax, eax
482
	or	eax, eax
Line 486... Line 483...
486
	jnz	.exit_error
483
	jnz	.exit_error
487
 
484
 
488
	stdcall libini._.skip_nonblanks, [f_addr]
485
	stdcall libini._.skip_spaces, [f_addr]
489
	xor	eax, eax
486
	xor	eax, eax
490
	xor	ebx, ebx
487
	xor	ebx, ebx
491
	xor	edx, edx
488
	xor	edx, edx
Line 700... Line 697...
700
align 16
697
align 16
701
@EXPORT:
698
@EXPORT:
Line 702... Line 699...
702
 
699
 
703
export						  \
700
export						  \
704
	libini._.init	  , 'lib_init'		, \
701
	libini._.init	  , 'lib_init'		, \
705
	0x00040006	  , 'version'		, \
702
	0x00040007	  , 'version'		, \
706
	ini.enum_sections , 'ini.enum_sections' , \
703
	ini.enum_sections , 'ini.enum_sections' , \
707
	ini.enum_keys	  , 'ini.enum_keys'	, \
704
	ini.enum_keys	  , 'ini.enum_keys'	, \
708
	ini.get_str	  , 'ini.get_str'	, \
705
	ini.get_str	  , 'ini.get_str'	, \
709
	ini.get_int	  , 'ini.get_int'	, \
706
	ini.get_int	  , 'ini.get_int'	, \