about summary refs log tree commit diff
path: root/pkgs/build-support/build-sandbox/src/path-cache.cc
blob: 5bfa43a7694c76c3531c474ff0b4b6fc733be447 (plain) (blame)
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;
    }
}