diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-04-20 20:36:25 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@rspamd.com> | 2022-04-20 20:36:25 +0100 |
commit | 5d5672f5600c517c23348cbdf9400e1bcae3364c (patch) | |
tree | 28c7456f2f730e55282a89044be9125264ccea95 /src/libserver/symcache/symcache_c.cxx | |
parent | bac819b549f92e5593c92ff5cc32ae82f3e8f460 (diff) | |
download | rspamd-5d5672f5600c517c23348cbdf9400e1bcae3364c.tar.gz rspamd-5d5672f5600c517c23348cbdf9400e1bcae3364c.zip |
[Minor] Add some more methods
Diffstat (limited to 'src/libserver/symcache/symcache_c.cxx')
-rw-r--r-- | src/libserver/symcache/symcache_c.cxx | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/libserver/symcache/symcache_c.cxx b/src/libserver/symcache/symcache_c.cxx index 5432c22f4..7e552e83a 100644 --- a/src/libserver/symcache/symcache_c.cxx +++ b/src/libserver/symcache/symcache_c.cxx @@ -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 |