Added new functions; Added new function descripyions

pull/83/head
parent c7155f09a9
commit 427bf1a542

@ -595,6 +595,43 @@ int yon_config_remove_by_key(char *key){
return 0;
}
int yon_config_remove_by_list(config_str keys, size_t size){
int result = 0;
check_config{
for (size_t i = 0;i<size;i++){
dictionary *dict = yon_dictionary_get((dictionary**)&__yon__config__strings,keys[i]);
if (dict){
yon_config_remove_ignore(dict->key);
((yon_config_parameter*)dict)->flag1=-1;
dict->data="";
result=1;
}
}
}
return result;
}
int yon_config_remove_by_args(char *key, ...){
int result = 0;
check_config{
va_list args;
va_start(args,key);
char *cur_key = key;
while (!yon_char_is_empty(cur_key)){
dictionary *dict = yon_dictionary_get((dictionary**)&__yon__config__strings,cur_key);
if (dict){
yon_config_remove_ignore(dict->key);
((yon_config_parameter*)dict)->flag1=-1;
dict->data="";
result=1;
}
cur_key = va_arg(args,char*);
}
va_end(args);
}
return result;
}
int yon_config_clear_by_key(const char *key){
check_config{
dictionary *dict = yon_dictionary_get((dictionary**)&__yon__config__strings,(char*)key);

@ -1340,25 +1340,36 @@ int yon_config_load_register_no_cleaning(YON_CONFIG_TYPE config_type,char *secti
[[ deprecated ( "Use yon_config_load_config instead" ) ]]
int yon_config_load_register(YON_CONFIG_TYPE config_type,char *section,char *parameter, ...);
/// @brief Set configuration parameter ignore status. Determines whether the parameter will be compared with the value from the configuration or the old value will be ignored when saving.
/// @param key Key of parameter.
/// @param status New status
void yon_config_compare_ignore_set(char *key, int status);
/// @brief Get configuration parameter ignore status
/// @param key Key of parameter.
/// @return TRUE if parameter is ignored, FALSE otherwise
int yon_config_compare_ignore_get(char *key);
/**yon_config_remove_by_key(char *key)
* [EN]
*
* [RU]
* Удаляет параметр конфига по ключу [key]
*/
/// @brief Mark parameter from configuration for remove. It will be removed from target configuration at save.
/// @param key Key of parameter.
/// @return TRUE if parameter was successfully removed, FALSE otherwise.
int yon_config_remove_by_key(char *key);
/**yon_config_remove_by_key(char *key)
* [EN]
*
* [RU]
* Очищает параметр конфига по ключу [key].
* Параметр удаляется как при полной очистке всего конфига.
*/
/// @brief Mark list of parameters from configuration for remove. It will be removed from target configuration at save.
/// @param keys string array of parameters removing parameter keys.
/// @param size size of string array.
/// @return TRUE if parameter was successfully removed, FALSE otherwise.
int yon_config_remove_by_list(config_str keys, size_t size);
/// @brief Mark list of parameters from configuration for remove. It will be removed from target configuration at save.
/// @param key First of parameter keys to remove.
/// @param ... A null-terminated list of remaining parameter keys.
/// @return TRUE if parameter was successfully removed, FALSE otherwise.
int yon_config_remove_by_args(char *key, ...);
/// @brief Clear a configuration parameter. Remove it completely, as if it had never been added - a parameter removed this way will not be compared when saving.
/// @param key Key of parameter.
/// @return TRUE if parameter was successfully removed, FALSE otherwise.
int yon_config_clear_by_key(const char *key);
/// @brief Remove substring from registered parameter value string

Loading…
Cancel
Save