diff options
Diffstat (limited to 'pkgs/build-support/build-sandbox/src/path-cache.cc')
-rw-r--r-- | pkgs/build-support/build-sandbox/src/path-cache.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pkgs/build-support/build-sandbox/src/path-cache.cc b/pkgs/build-support/build-sandbox/src/path-cache.cc new file mode 100644 index 00000000..5bfa43a7 --- /dev/null +++ b/pkgs/build-support/build-sandbox/src/path-cache.cc @@ -0,0 +1,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; + } +} |