]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
conf-parser: expose config_section_{hash,compare}_func()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 2 Jan 2024 19:41:07 +0000 (04:41 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 3 Jan 2024 19:58:36 +0000 (04:58 +0900)
They will be used in later commits.

src/shared/conf-parser.c
src/shared/conf-parser.h

index 5d4500cb05bf320a572d0b9940a2c482afaef976..bdc8d732a27c1a7481fce7d38659e707d315af22 100644 (file)
@@ -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);
index a1768cd9198e9c511f1075bf84c4a6ebd2431b5c..72020b7d699621929381c89fb374bd4e8dae7a71 100644 (file)
@@ -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,