summaryrefslogtreecommitdiff
path: root/include/mbgl/util/uv.hpp
blob: 85f93e78bd566b627d7d15b72cf0949ae23d556a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef MBGL_UTIL_UV
#define MBGL_UTIL_UV

#include <string>

typedef struct uv_handle_s uv_handle_t;
typedef struct uv_async_s uv_async_t;
typedef struct uv_timer_s uv_timer_t;
typedef struct uv_loop_s uv_loop_t;
typedef struct uv_fs_s uv_fs_t;

namespace uv {

std::string cwd();

class rwlock;
class loop;
class async;
class worker;
class mutex;
class cond;

const char *getFileRequestError(uv_fs_t *req);

template <typename T>
void close(T *specific) {
    uv_close(reinterpret_cast<uv_handle_t *>(specific), [](uv_handle_t *generic) {
        delete reinterpret_cast<T *>(generic);
    });
}

}

#endif