libini_config  0.6.0
Enumerations
Flags used in add_xxx_value functions

Enumerations

enum  INI_VA {
  INI_VA_NOCHECK = 0, INI_VA_MOD = 1, INI_VA_MOD_E = 2, INI_VA_MODADD = 3,
  INI_VA_MODADD_E = 4, INI_VA_CLEAN = 5, INI_VA_DUPERROR = 6
}
 

Detailed Description

These flags control the behavior of the add_xxx_value functions. Use these flags to specify how you want to process the key. Do you want the function to replace an existing key? Or may be you want to generate an error when function sees that there is a duplicate key? Or may be you do not want to check anything and just add the key to the section?

Individual values provide more details about use.

Enumeration Type Documentation

◆ INI_VA

enum INI_VA
Enumerator
INI_VA_NOCHECK 

No check.

This is the default mode. Function will not perform any checks for duplicates and will just add a key.

INI_VA_MOD 

Update a specific value (best effort).

Value of the index is used to determine which one of the duplicates needs to be updated. Index is 0-based. If the index is out of range the function will do best effort and return the last instance of the key. For example if you have five duplicates and you are searching for the tenth the function will find and return the fifth instance.

INI_VA_MOD_E 

Update a specific value (with error).

Value of the index is used to determine which one of the duplicates needs to be updated. Index is 0-based. If the value is not found or the index is out of range the function returns ENOENT. For example if you have five duplicates and you are searching for the tenth the error ENOENT will be returned.

INI_VA_MODADD 

Update or add if not found (best effort).

Function will check for duplicates and would overwrite the specified key if found. Value of the index is used to determine which one of the duplicates needs to be updated. Index is 0-based. If the value is not found the new value will be added following other position related arguments. This option performs best effort search. For example if you have five duplicates and you are searching for the tenth the function will find and return fifth instance.

INI_VA_MODADD_E 

Update or add if not found (with error).

Function will check for duplicates and would overwrite the specified key if found. Value of the index is used to determine which one of the duplicates needs to be updated. Index is 0-based. If the value is not found the new value will be added following other position related arguments. This option performs an exact search. For example if you have five duplicates and you are searching for tenth the error ENOENT will be returned.

INI_VA_CLEAN 

Clean all duplicates.

Find all instances of the specific key and remove them first. Then add the new key respecting the position related arguments.

INI_VA_DUPERROR 

Error if duplicate.

Return error EEXIST if an entry with the same key exists.