DoneEx INI-File Manager Library  API Help

  GetKeyValue

The function GetKeyValue retrieves the value of key by the key index inside indicated section.

				
int GetKeyValue(long   ini_file_num, 
               long   section_index, 
               long   key_index, 
               char **key_value, 
               long   buf_size
);				

Parameters
ini_file_num
[input] INI-file number which points to the data in memory structure. This number has to be saved from the return value of the previous call CreateINI or LoadINI functions.
section_index
[input] The zero-based index of the section that is enumerated from begin of INI-file.
key_index
[input] The zero-based index of the key to be searched key name.
key_value
[output] Pointer to pointer to null-terminated string where result key name will be placed.
buf_size
[input] The size of buffer reserved for the key name.

Return Values
If succeed the GetKeyValue function returns zero. Otherwise it returns value not equal to zero. To get extended error information, call GetLastErr.

INI-file example
;this is comment
;place before first named section belongs to the unnamed section
unnamed_section_key=value
;
[Section1]
section1_key_name=value of section1 key
;
[Section2]
section2 key name=value of section2 key