1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#include <set> #include <string> typedef std::set<std::string> *path_cache; extern "C" { path_cache new_path_cache(void) { return new std::set<std::string>(); } void free_path_cache(path_cache pc) { delete pc; } bool cache_path(path_cache pc, const char *path) { return pc->insert(std::string(path)).second; } }