|
Packit |
b5b901 |
#include "uv.h"
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
const char* uv_handle_type_name(uv_handle_type type) {
|
|
Packit |
b5b901 |
switch (type) {
|
|
Packit |
b5b901 |
#define XX(uc,lc) case UV_##uc: return #lc;
|
|
Packit |
b5b901 |
UV_HANDLE_TYPE_MAP(XX)
|
|
Packit |
b5b901 |
#undef XX
|
|
Packit |
b5b901 |
case UV_FILE: return "file";
|
|
Packit |
b5b901 |
case UV_HANDLE_TYPE_MAX:
|
|
Packit |
b5b901 |
case UV_UNKNOWN_HANDLE: return NULL;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
return NULL;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
uv_handle_type uv_handle_get_type(const uv_handle_t* handle) {
|
|
Packit |
b5b901 |
return handle->type;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
void* uv_handle_get_data(const uv_handle_t* handle) {
|
|
Packit |
b5b901 |
return handle->data;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
uv_loop_t* uv_handle_get_loop(const uv_handle_t* handle) {
|
|
Packit |
b5b901 |
return handle->loop;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
void uv_handle_set_data(uv_handle_t* handle, void* data) {
|
|
Packit |
b5b901 |
handle->data = data;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
const char* uv_req_type_name(uv_req_type type) {
|
|
Packit |
b5b901 |
switch (type) {
|
|
Packit |
b5b901 |
#define XX(uc,lc) case UV_##uc: return #lc;
|
|
Packit |
b5b901 |
UV_REQ_TYPE_MAP(XX)
|
|
Packit |
b5b901 |
#undef XX
|
|
Packit |
b5b901 |
case UV_REQ_TYPE_MAX:
|
|
Packit |
b5b901 |
case UV_UNKNOWN_REQ: return NULL;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
return NULL;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
uv_req_type uv_req_get_type(const uv_req_t* req) {
|
|
Packit |
b5b901 |
return req->type;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
void* uv_req_get_data(const uv_req_t* req) {
|
|
Packit |
b5b901 |
return req->data;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
void uv_req_set_data(uv_req_t* req, void* data) {
|
|
Packit |
b5b901 |
req->data = data;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
size_t uv_stream_get_write_queue_size(const uv_stream_t* stream) {
|
|
Packit |
b5b901 |
return stream->write_queue_size;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
size_t uv_udp_get_send_queue_size(const uv_udp_t* handle) {
|
|
Packit |
b5b901 |
return handle->send_queue_size;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
size_t uv_udp_get_send_queue_count(const uv_udp_t* handle) {
|
|
Packit |
b5b901 |
return handle->send_queue_count;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
uv_pid_t uv_process_get_pid(const uv_process_t* proc) {
|
|
Packit |
b5b901 |
return proc->pid;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
uv_fs_type uv_fs_get_type(const uv_fs_t* req) {
|
|
Packit |
b5b901 |
return req->fs_type;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
ssize_t uv_fs_get_result(const uv_fs_t* req) {
|
|
Packit |
b5b901 |
return req->result;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
void* uv_fs_get_ptr(const uv_fs_t* req) {
|
|
Packit |
b5b901 |
return req->ptr;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
const char* uv_fs_get_path(const uv_fs_t* req) {
|
|
Packit |
b5b901 |
return req->path;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
uv_stat_t* uv_fs_get_statbuf(uv_fs_t* req) {
|
|
Packit |
b5b901 |
return &req->statbuf;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
void* uv_loop_get_data(const uv_loop_t* loop) {
|
|
Packit |
b5b901 |
return loop->data;
|
|
Packit |
b5b901 |
}
|
|
Packit |
b5b901 |
|
|
Packit |
b5b901 |
void uv_loop_set_data(uv_loop_t* loop, void* data) {
|
|
Packit |
b5b901 |
loop->data = data;
|
|
Packit |
b5b901 |
}
|