Skip to content

Instantly share code, notes, and snippets.

@igorzi
Created August 19, 2011 17:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igorzi/1157497 to your computer and use it in GitHub Desktop.
Save igorzi/1157497 to your computer and use it in GitHub Desktop.
typedef struct uv_tp_req_s uv_tp_req_t;
typedef int (*uv_tp_cb)(uv_tp_req_t* req, int status);
typedef void (*uv_tp_custom_cb)(uv_tp_req_t *req);
#ifdef _WIN32
typedef uv_native_file_type HANDLE;
#else
typedef uv_native_file_type int;
#endif
typedef enum {
UV_TP_UNKNOWN = -1,
UV_TP_CUSTOM,
UV_TP_OPEN,
UV_TP_CLOSE,
UV_TP_READ,
UV_TP_WRITE,
UV_TP_SENDFILE,
UV_TP_STAT,
UV_TP_LSTAT,
UV_TP_FSTAT,
UV_TP_FTRUNCATE,
UV_TP_UTIME,
UV_TP_FUTIME,
UV_TP_CHMOD,
UV_TP_FCHMOD,
UV_TP_FSYNC,
UV_TP_FDATASYNC,
UV_TP_UNLINK,
UV_TP_RMDIR,
UV_TP_MKDIR,
UV_TP_RENAME,
UV_TP_READDIR,
UV_TP_LINK,
UV_TP_SYMLINK,
UV_TP_READLINK,
} uv_tp_type;
struct uv_tp_req_s {
UV_REQ_FIELDS
uv_tp_cb cb;
ssize_t result;
void *ptr1;
void *ptr2;
uv_tp_type tp_type;
int errorno;
UV_TP_REQ_PRIVATE_FIELDS
};
void uv_tp_close(uv_tp_req_t* req, int fd, uv_tp_cb cb);
void uv_tp_open(uv_tp_req_t* req, const char *path, int flags, int mode, uv_tp_cb cb);
void uv_tp_read(uv_tp_req_t* req, int fd, void *buf, size_t length, off_t offset, uv_tp_cb cb);
void uv_tp_fdatasync(uv_tp_req_t* req, int fd, uv_tp_cb cb);
void uv_tp_fsync(uv_tp_req_t* req, int fd, uv_tp_cb cb);
void uv_tp_rename(uv_tp_req_t* req, const char *path, const char *new_path, uv_tp_cb cb);
void uv_tp_truncate(uv_tp_req_t* req, const char *path, off_t offset, uv_tp_cb cb);
void uv_tp_rmdir(uv_tp_req_t* req, const char *path, uv_tp_cb cb);
void uv_tp_mkdir(uv_tp_req_t* req, const char *path, int mode, uv_tp_cb cb);
void uv_tp_sendfile(uv_tp_req_t* req, int out_fd, int in_fd, off_t in_offset, size_t length, uv_tp_cb cb);
void uv_tp_readdir(uv_tp_req_t* req, const char *path, int flags, uv_tp_cb cb);
void uv_tp_stat(uv_tp_req_t* req, const char *path, uv_tp_cb cb);
void uv_tp_lstat(uv_tp_req_t* req, const char *path, uv_tp_cb cb);
void uv_tp_link(uv_tp_req_t* req, const char *path, const char *new_path, uv_tp_cb cb);
void uv_tp_symlink(uv_tp_req_t* req, const char *path, const char *new_path, uv_tp_cb cb);
void uv_tp_readlink(uv_tp_req_t* req, const char *path, uv_tp_cb cb);
void uv_tp_unlink(uv_tp_req_t* req, const char *path, uv_tp_cb cb);
void uv_tp_write(uv_tp_req_t* req, int fd, void *buf, size_t length, off_t offset, uv_tp_cb cb);
void uv_tp_chmod(uv_tp_req_t* req, const char *path, int mode, uv_tp_cb cb);
void uv_tp_fchmod(uv_tp_req_t* req, int fd, int mode, uv_tp_cb cb);
void uv_tp_chown(uv_tp_req_t* req, const char *path, int uid, int gid, uv_tp_cb cb);
void uv_tp_fchown(uv_tp_req_t* req, int fd, int uid, int gid, uv_tp_cb cb);
void uv_tp_utime(uv_tp_req_t* req, const char *path, double atime, double mtime, uv_tp_cb cb);
void uv_tp_futime(uv_tp_req_t* req, int fd, double atime, double mtime, uv_tp_cb cb);
void uv_tp_custom(uv_tp_custom_cb custom_cb, uv_tp_cb cb);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment