return real_item->get_name().c_str();
}
+gint
+rspamd_symcache_item_flags (struct rspamd_symcache_item *item)
+{
+ auto *real_item = C_API_SYMCACHE_ITEM(item);
+ return real_item->get_flags();
+}
+
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;
+}
+
+void
+rspamd_symcache_foreach(struct rspamd_symcache *cache,
+ void (*func) (struct rspamd_symcache_item *item, gpointer /* userdata */),
+ gpointer ud)
+{
+ auto *real_cache = C_API_SYMCACHE(cache);
+
+ real_cache->symbols_foreach([&](const rspamd::symcache::cache_item* item) {
+ func((struct rspamd_symcache_item *)item, ud);
+ });
}
\ No newline at end of file
*/
auto periodic_resort(struct ev_loop *ev_loop, double cur_time, double last_resort) -> void;
+ /**
+ * A simple helper to get the reload time
+ * @return
+ */
auto get_reload_time() const { return reload_time; };
+
+ /**
+ * Iterate over all symbols using a specific functor
+ * @tparam Functor
+ * @param f
+ */
+ template<typename Functor>
+ auto symbols_foreach(Functor f) -> void {
+ for (const auto &sym_it : items_by_symbol) {
+ f(sym_it.second.get());
+ }
+ }
};
/*