From b46d1694c4ba63eac2ee1da121f788b735b3daa7 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Wed, 3 Jan 2024 04:41:07 +0900 Subject: [PATCH] conf-parser: expose config_section_{hash,compare}_func() They will be used in later commits. --- src/shared/conf-parser.c | 4 ++-- src/shared/conf-parser.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index 5d4500cb05b..bdc8d732a27 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -795,12 +795,12 @@ bool stats_by_path_equal(Hashmap *a, Hashmap *b) { return true; } -static void config_section_hash_func(const ConfigSection *c, struct siphash *state) { +void config_section_hash_func(const ConfigSection *c, struct siphash *state) { siphash24_compress_string(c->filename, state); siphash24_compress_typesafe(c->line, state); } -static int config_section_compare_func(const ConfigSection *x, const ConfigSection *y) { +int config_section_compare_func(const ConfigSection *x, const ConfigSection *y) { int r; r = strcmp(x->filename, y->filename); diff --git a/src/shared/conf-parser.h b/src/shared/conf-parser.h index a1768cd9198..72020b7d699 100644 --- a/src/shared/conf-parser.h +++ b/src/shared/conf-parser.h @@ -137,7 +137,11 @@ static inline ConfigSection* config_section_free(ConfigSection *cs) { DEFINE_TRIVIAL_CLEANUP_FUNC(ConfigSection*, config_section_free); int config_section_new(const char *filename, unsigned line, ConfigSection **ret); + +void config_section_hash_func(const ConfigSection *c, struct siphash *state); +int config_section_compare_func(const ConfigSection *x, const ConfigSection *y); extern const struct hash_ops config_section_hash_ops; + int _hashmap_by_section_find_unused_line( HashmapBase *entries_by_section, const char *filename, -- 2.47.3