]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add some more methods
authorVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 20 Apr 2022 19:36:25 +0000 (20:36 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 20 Apr 2022 19:36:25 +0000 (20:36 +0100)
src/libserver/symcache/symcache_c.cxx

index 5432c22f41458ae632c35f5f88ef6f02a8bd7807..7e552e83a8da7e5765d1f767f844be1465ded6ce 100644 (file)
@@ -190,4 +190,37 @@ rspamd_symcache_add_delayed_dependency (struct rspamd_symcache *cache,
 {
        auto *real_cache = C_API_SYMCACHE(cache);
        real_cache->add_delayed_dependency(from, to);
+}
+
+const gchar *
+rspamd_symcache_get_parent (struct rspamd_symcache *cache,
+                                                       const gchar *symbol)
+{
+       auto *real_cache = C_API_SYMCACHE(cache);
+
+       auto *sym = real_cache->get_item_by_name(symbol, false);
+
+       if (sym && sym->is_virtual()) {
+               auto *parent = sym->get_parent(*real_cache);
+
+               if (parent) {
+                       return parent->get_name().c_str();
+               }
+       }
+
+       return nullptr;
+}
+
+const gchar*
+rspamd_symcache_item_name (struct rspamd_symcache_item *item)
+{
+       auto *real_item = C_API_SYMCACHE_ITEM(item);
+       return real_item->get_name().c_str();
+}
+
+const struct rspamd_symcache_item_stat *
+rspamd_symcache_item_stat (struct rspamd_symcache_item *item)
+{
+       auto *real_item = C_API_SYMCACHE_ITEM(item);
+       return real_item->st;
 }
\ No newline at end of file