From 997d6057d1318fc303c4847f21bb97d35b3562e1 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Mon, 20 Jan 2025 11:31:38 +0600 Subject: [PATCH] Added compare ignore parameter --- source/libublsettings.c | 18 ++++++++++++++++++ source/libublsettings.h | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/source/libublsettings.c b/source/libublsettings.c index 799fa2d..ef04c51 100644 --- a/source/libublsettings.c +++ b/source/libublsettings.c @@ -1157,6 +1157,7 @@ typedef struct yon_config_parameter int ignore; char *save_command; char *load_command; + int compare_ignore; } yon_config_parameter; yon_config_parameter *yon_config_parameter_new_with_data(char *key, void *data){ @@ -1172,6 +1173,7 @@ yon_config_parameter *yon_config_parameter_new_with_data(char *key, void *data){ param->ignore=0; param->save_command=NULL; param->load_command=NULL; + param->compare_ignore=0; return param; } @@ -1534,6 +1536,22 @@ int yon_config_load_register(YON_CONFIG_TYPE config_type,char *section,char *par } else return -1; } +void yon_config_compare_ignore_set(char *key, int status){ + dictionary *cur = yon_dictionary_get((dictionary**)&__yon__config__strings,key); + if (cur){ + ((yon_config_parameter*)cur)->compare_ignore=!!status; + } +} + +int yon_config_compare_ignore_get(char *key){ + + dictionary *cur = yon_dictionary_get((dictionary**)&__yon__config__strings,key); + if (cur){ + return ((yon_config_parameter*)cur)->compare_ignore; + } + return 0; +} + int yon_config_remove_by_key(char *key){ check_config{ dictionary *dict = yon_dictionary_get((dictionary**)&__yon__config__strings,key); diff --git a/source/libublsettings.h b/source/libublsettings.h index cf9e46a..96894fd 100644 --- a/source/libublsettings.h +++ b/source/libublsettings.h @@ -862,6 +862,10 @@ 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, ...); +void yon_config_compare_ignore_set(char *key, int status); + +int yon_config_compare_ignore_get(char *key); + /**yon_config_remove_by_key(char *key) * [EN] *