您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ uv__handle_init函数代码示例

51自学网 2021-06-03 09:26:40
  C++
这篇教程C++ uv__handle_init函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中uv__handle_init函数的典型用法代码示例。如果您正苦于以下问题:C++ uv__handle_init函数的具体用法?C++ uv__handle_init怎么用?C++ uv__handle_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了uv__handle_init函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: uv_fs_event_init

int uv_fs_event_init(uv_loop_t* loop,                     uv_fs_event_t* handle,                     const char* filename,                     uv_fs_event_cb cb,                     int flags) {  int portfd;  loop->counters.fs_event_init++;  /* We don't support any flags yet. */  assert(!flags);  if ((portfd = port_create()) == -1) {    uv__set_sys_error(loop, errno);    return -1;  }  uv__handle_init(loop, (uv_handle_t*)handle, UV_FS_EVENT);  handle->filename = strdup(filename);  handle->fd = portfd;  handle->cb = cb;  memset(&handle->fo, 0, sizeof handle->fo);  handle->fo.fo_name = handle->filename;  uv__fs_event_rearm(handle);  ev_io_init(&handle->event_watcher, uv__fs_event_read, portfd, EV_READ);  ev_io_start(loop->ev, &handle->event_watcher);  ev_unref(loop->ev);  return 0;}
开发者ID:0x00A,项目名称:uvxx,代码行数:32,


示例2: uv_fs_event_init

int uv_fs_event_init(uv_loop_t* loop,                     uv_fs_event_t* handle,                     const char* filename,                     uv_fs_event_cb cb,                     int flags) {  int portfd;  int first_run = 0;  if (loop->fs_fd == -1) {    if ((portfd = port_create()) == -1) {      uv__set_sys_error(loop, errno);      return -1;    }    loop->fs_fd = portfd;    first_run = 1;  }  uv__handle_init(loop, (uv_handle_t*)handle, UV_FS_EVENT);  uv__handle_start(handle); /* FIXME shouldn't start automatically */  handle->filename = strdup(filename);  handle->fd = PORT_UNUSED;  handle->cb = cb;  memset(&handle->fo, 0, sizeof handle->fo);  handle->fo.fo_name = handle->filename;  uv__fs_event_rearm(handle);  if (first_run) {    uv__io_init(&loop->fs_event_watcher, uv__fs_event_read, portfd);    uv__io_start(loop, &loop->fs_event_watcher, UV__POLLIN);  }  return 0;}
开发者ID:2saki,项目名称:node,代码行数:34,


示例3: uv__stream_init

void uv__stream_init(uv_loop_t* loop, uv_stream_t* stream,                     uv_handle_type type) {  int err;  uv__handle_init(loop, (uv_handle_t*)stream, type);  stream->read_cb = NULL;  stream->alloc_cb = NULL;  stream->close_cb = NULL;  stream->connection_cb = NULL;  stream->connect_req = NULL;  stream->shutdown_req = NULL;  stream->accepted_fd = -1;  stream->queued_fds = NULL;  stream->delayed_error = 0;  QUEUE_INIT(&stream->write_queue);  QUEUE_INIT(&stream->write_completed_queue);  stream->write_queue_size = 0;  if (loop->emfile_fd == -1) {    err = uv__open_cloexec("/", O_RDONLY);    //if (err >= 0)    if (err > 0)  // 0 is invalid      loop->emfile_fd = err;  }  uv__io_init(&stream->io_watcher, uv__stream_io, -1);}
开发者ID:esevan,项目名称:libtuv,代码行数:27,


示例4: uv_fs_event_init

int uv_fs_event_init(uv_loop_t* loop,                     uv_fs_event_t* handle,                     const char* filename,                     uv_fs_event_cb cb,                     int flags) {  int events;  int wd;  loop->counters.fs_event_init++;  /* We don't support any flags yet. */  assert(!flags);  if (init_inotify(loop)) return -1;  events = IN_ATTRIB         | IN_CREATE         | IN_MODIFY         | IN_DELETE         | IN_DELETE_SELF         | IN_MOVED_FROM         | IN_MOVED_TO;  wd = inotify_add_watch(loop->inotify_fd, filename, events);  if (wd == -1) return uv__set_sys_error(loop, errno);  uv__handle_init(loop, (uv_handle_t*)handle, UV_FS_EVENT);  handle->filename = strdup(filename);  handle->cb = cb;  handle->fd = wd;  add_watcher(handle);  return 0;}
开发者ID:337240552,项目名称:node,代码行数:34,


示例5: uv_fs_event_init

int uv_fs_event_init(uv_loop_t* loop,                     uv_fs_event_t* handle,                     const char* filename,                     uv_fs_event_cb cb,                     int flags) {  int fd;  loop->counters.fs_event_init++;  /* We don't support any flags yet. */  assert(!flags);  if (cb == NULL) {    uv__set_sys_error(loop, EINVAL);    return -1;  }  /* TODO open asynchronously - but how do we report back errors? */  if ((fd = open(filename, O_RDONLY)) == -1) {    uv__set_sys_error(loop, errno);    return -1;  }  uv__handle_init(loop, (uv_handle_t*)handle, UV_FS_EVENT);  handle->filename = strdup(filename);  handle->fflags = 0;  handle->cb = cb;  handle->fd = fd;  uv__fs_event_start(handle);  return 0;}
开发者ID:geraldfong,项目名称:svprep,代码行数:32,


示例6: uv_poll_init

int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd) {  int err;  if (uv__fd_exists(loop, fd))    return UV_EEXIST;  err = uv__io_check_fd(loop, fd);  if (err)    return err;  /* If ioctl(FIONBIO) reports ENOTTY, try fcntl(F_GETFL) + fcntl(F_SETFL).   * Workaround for e.g. kqueue fds not supporting ioctls.   */  err = uv__nonblock(fd, 1);  if (err == UV_ENOTTY)    if (uv__nonblock == uv__nonblock_ioctl)      err = uv__nonblock_fcntl(fd, 1);  if (err)    return err;  uv__handle_init(loop, (uv_handle_t*) handle, UV_POLL);  uv__io_init(&handle->io_watcher, uv__poll_io, fd);  handle->poll_cb = NULL;  return 0;}
开发者ID:JuliaLang,项目名称:libuv,代码行数:26,


示例7: uv_tcp_init

int uv_tcp_init(uv_tcp_t* tcp) {  uv__handle_init((uv_handle_t*)tcp, UV_TCP);  uv_counters()->tcp_init++;  tcp->alloc_cb = NULL;  tcp->connect_req = NULL;  tcp->accepted_fd = -1;  tcp->fd = -1;  tcp->delayed_error = 0;  ngx_queue_init(&tcp->write_queue);  ngx_queue_init(&tcp->write_completed_queue);  tcp->write_queue_size = 0;  ev_init(&tcp->read_watcher, uv__tcp_io);  tcp->read_watcher.data = tcp;  ev_init(&tcp->write_watcher, uv__tcp_io);  tcp->write_watcher.data = tcp;  assert(ngx_queue_empty(&tcp->write_queue));  assert(ngx_queue_empty(&tcp->write_completed_queue));  assert(tcp->write_queue_size == 0);  return 0;}
开发者ID:markuskopf,项目名称:node,代码行数:25,


示例8: uv__stream_init

void uv__stream_init(uv_loop_t* loop,                     uv_stream_t* stream,                     uv_handle_type type) {  uv__handle_init(loop, (uv_handle_t*)stream, type);  stream->read_cb = NULL;  stream->read2_cb = NULL;  stream->alloc_cb = NULL;  stream->close_cb = NULL;  stream->connection_cb = NULL;  stream->connect_req = NULL;  stream->shutdown_req = NULL;  stream->accepted_fd = -1;  stream->delayed_error = 0;  ngx_queue_init(&stream->write_queue);  ngx_queue_init(&stream->write_completed_queue);  stream->write_queue_size = 0;  if (loop->emfile_fd == -1)    loop->emfile_fd = uv__open_cloexec("/", O_RDONLY);#if defined(__APPLE__)  stream->select = NULL;#endif /* defined(__APPLE_) */  uv__io_init(&stream->io_watcher, uv__stream_io, -1);}
开发者ID:Allan-Ngigi,项目名称:node,代码行数:26,


示例9: uv_udp_init_ex

int uv_udp_init_ex(uv_loop_t* loop, uv_udp_t* handle, unsigned int flags) {  int domain;  int err;  int fd;  /* Use the lower 8 bits for the domain */  domain = flags & 0xFF;  if (domain != AF_INET && domain != AF_INET6 && domain != AF_UNSPEC)    return -EINVAL;  if (flags & ~0xFF)    return -EINVAL;  if (domain != AF_UNSPEC) {    err = uv__socket(domain, SOCK_DGRAM, 0);    if (err < 0)      return err;    fd = err;  } else {    fd = -1;  }  uv__handle_init(loop, (uv_handle_t*)handle, UV_UDP);  handle->alloc_cb = NULL;  handle->recv_cb = NULL;  handle->send_queue_size = 0;  handle->send_queue_count = 0;  uv__io_init(&handle->io_watcher, uv__udp_io, fd);  QUEUE_INIT(&handle->write_queue);  QUEUE_INIT(&handle->write_completed_queue);  return 0;}
开发者ID:cwz920716,项目名称:tail.js,代码行数:32,


示例10: uv__stream_init

void uv__stream_init(uv_loop_t* loop,                     uv_stream_t* stream,                     uv_handle_type type) {  uv__handle_init(loop, (uv_handle_t*)stream, type);  loop->counters.stream_init++;  stream->alloc_cb = NULL;  stream->close_cb = NULL;  stream->connection_cb = NULL;  stream->connect_req = NULL;  stream->accepted_fd = -1;  stream->fd = -1;  stream->delayed_error = 0;  stream->blocking = 0;  ngx_queue_init(&stream->write_queue);  ngx_queue_init(&stream->write_completed_queue);  stream->write_queue_size = 0;  ev_init(&stream->read_watcher, uv__stream_io);  stream->read_watcher.data = stream;  ev_init(&stream->write_watcher, uv__stream_io);  stream->write_watcher.data = stream;  assert(ngx_queue_empty(&stream->write_queue));  assert(ngx_queue_empty(&stream->write_completed_queue));  assert(stream->write_queue_size == 0);}
开发者ID:Andypro1,项目名称:node,代码行数:28,


示例11: uv_timer_init

int uv_timer_init(uv_loop_t* loop, uv_timer_t* handle) {  uv__handle_init(loop, (uv_handle_t*)handle, UV_TIMER);  handle->timer_cb = NULL;  handle->repeat = 0;  return 0;}
开发者ID:Andrepuel,项目名称:jxcore,代码行数:7,


示例12: uv_fs_event_init

int uv_fs_event_init(uv_loop_t* loop, uv_fs_event_t* handle) {#ifdef HAVE_SYS_AHAFS_EVPRODS_H  uv__handle_init(loop, (uv_handle_t*)handle, UV_FS_EVENT);  return 0;#else  return -ENOSYS;#endif}
开发者ID:2014lh,项目名称:node-v0.x-archive,代码行数:8,


示例13: uv_timer_init

int uv_timer_init(uv_loop_t* loop, uv_timer_t* timer) {  uv__handle_init(loop, (uv_handle_t*)timer, UV_TIMER);  loop->counters.timer_init++;  ev_init(&timer->timer_watcher, uv__timer_cb);  return 0;}
开发者ID:Maxence,项目名称:node,代码行数:8,


示例14: uv_timer_init

int uv_timer_init(uv_handle_t* handle, uv_close_cb close_cb, void* data) {    uv__handle_init(handle, UV_TIMER, close_cb, data);    ev_init(&handle->timer_watcher, uv__timer_cb);    handle->timer_watcher.data = handle;    return 0;}
开发者ID:nekedos,项目名称:node,代码行数:8,


示例15: uv_udp_init

int uv_udp_init(uv_loop_t* loop, uv_udp_t* handle) {  uv__handle_init(loop, (uv_handle_t*)handle, UV_UDP);  handle->alloc_cb = NULL;  handle->recv_cb = NULL;  uv__io_init(&handle->io_watcher, uv__udp_io, -1);  ngx_queue_init(&handle->write_queue);  ngx_queue_init(&handle->write_completed_queue);  return 0;}
开发者ID:76765357,项目名称:node,代码行数:9,


示例16: uv_prepare_init

int uv_prepare_init(uv_loop_t* loop, uv_prepare_t* prepare) {  uv__handle_init(loop, (uv_handle_t*)prepare, UV_PREPARE);  loop->counters.prepare_init++;  ev_prepare_init(&prepare->prepare_watcher, uv__prepare);  prepare->prepare_cb = NULL;  return 0;}
开发者ID:Maxence,项目名称:node,代码行数:9,


示例17: uv_check_init

int uv_check_init(uv_loop_t* loop, uv_check_t* check) {  uv__handle_init(loop, (uv_handle_t*)check, UV_CHECK);  loop->counters.check_init++;  ev_check_init(&check->check_watcher, uv__check);  check->check_cb = NULL;  return 0;}
开发者ID:Maxence,项目名称:node,代码行数:9,


示例18: uv_idle_init

int uv_idle_init(uv_loop_t* loop, uv_idle_t* idle) {  uv__handle_init(loop, (uv_handle_t*)idle, UV_IDLE);  loop->counters.idle_init++;  ev_idle_init(&idle->idle_watcher, uv__idle);  idle->idle_cb = NULL;  return 0;}
开发者ID:Maxence,项目名称:node,代码行数:9,


示例19: uv_timer_init

int uv_timer_init(uv_timer_t* timer) {  uv__handle_init((uv_handle_t*)timer, UV_TIMER);  uv_counters()->timer_init++;  ev_init(&timer->timer_watcher, uv__timer_cb);  timer->timer_watcher.data = timer;  return 0;}
开发者ID:markuskopf,项目名称:node,代码行数:9,


示例20: uv_prepare_init

int uv_prepare_init(uv_handle_t* handle, uv_close_cb close_cb, void* data) {    uv__handle_init(handle, UV_PREPARE, close_cb, data);    ev_prepare_init(&handle->prepare_watcher, uv__prepare);    handle->prepare_watcher.data = handle;    handle->prepare_cb = NULL;    return 0;}
开发者ID:nekedos,项目名称:node,代码行数:10,


示例21: uv_idle_init

int uv_idle_init(uv_handle_t* handle, uv_close_cb close_cb, void* data) {    uv__handle_init(handle, UV_IDLE, close_cb, data);    ev_idle_init(&handle->idle_watcher, uv__idle);    handle->idle_watcher.data = handle;    handle->idle_cb = NULL;    return 0;}
开发者ID:nekedos,项目名称:node,代码行数:10,


示例22: uv_check_init

int uv_check_init(uv_handle_t* handle, uv_close_cb close_cb, void* data) {    uv__handle_init(handle, UV_CHECK, close_cb, data);    ev_check_init(&handle->check_watcher, uv__check);    handle->check_watcher.data = handle;    handle->check_cb = NULL;    return 0;}
开发者ID:nekedos,项目名称:node,代码行数:10,


示例23: uv_udp_init

int uv_udp_init(uv_loop_t* loop, uv_udp_t* handle) {  memset(handle, 0, sizeof *handle);  uv__handle_init(loop, (uv_handle_t*)handle, UV_UDP);  handle->fd = -1;  ngx_queue_init(&handle->write_queue);  ngx_queue_init(&handle->write_completed_queue);  return 0;}
开发者ID:wynnw,项目名称:libuv,代码行数:10,


示例24: uv_poll_init

int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd) {  uv__handle_init(loop, (uv_handle_t*) handle, UV_POLL);  loop->counters.poll_init++;  handle->fd = fd;  handle->poll_cb = NULL;  uv__io_init(&handle->io_watcher, uv__poll_io, fd, 0);  return 0;}
开发者ID:4rejin,项目名称:node,代码行数:10,


示例25: uv_async_init

int uv_async_init(uv_loop_t* loop, uv_async_t* handle, uv_async_cb async_cb) {  uv__handle_init(loop, (uv_handle_t*) handle, UV_ASYNC);  handle->async_sent = 0;  handle->async_cb = async_cb;  QUEUE_INSERT_TAIL(&loop->async_handles, &handle->queue);  uv__handle_start(handle);  return 0;}
开发者ID:JuliaLang,项目名称:libuv,代码行数:10,


示例26: uv_udp_init

int uv_udp_init(uv_loop_t* loop, uv_udp_t* handle) {  uv__handle_init(loop, (uv_handle_t*)handle, UV_UDP);  handle->alloc_cb = NULL;  handle->recv_cb = NULL;  handle->send_queue_size = 0;  handle->send_queue_count = 0;  uv__io_init(&handle->io_watcher, uv__udp_io, -1);  QUEUE_INIT(&handle->write_queue);  QUEUE_INIT(&handle->write_completed_queue);  return 0;}
开发者ID:Muraad,项目名称:harmony,代码行数:11,


示例27: uv_prepare_init

int uv_prepare_init(uv_prepare_t* prepare) {  uv__handle_init((uv_handle_t*)prepare, UV_PREPARE);  uv_counters()->prepare_init++;  ev_prepare_init(&prepare->prepare_watcher, uv__prepare);  prepare->prepare_watcher.data = prepare;  prepare->prepare_cb = NULL;  return 0;}
开发者ID:markuskopf,项目名称:node,代码行数:11,


示例28: uv_idle_init

int uv_idle_init(uv_idle_t* idle) {  uv__handle_init((uv_handle_t*)idle, UV_IDLE);  uv_counters()->idle_init++;  ev_idle_init(&idle->idle_watcher, uv__idle);  idle->idle_watcher.data = idle;  idle->idle_cb = NULL;  return 0;}
开发者ID:markuskopf,项目名称:node,代码行数:11,


示例29: uv_check_init

int uv_check_init(uv_check_t* check) {  uv__handle_init((uv_handle_t*)check, UV_CHECK);  uv_counters()->check_init++;  ev_check_init(&check->check_watcher, uv__check);  check->check_watcher.data = check;  check->check_cb = NULL;  return 0;}
开发者ID:markuskopf,项目名称:node,代码行数:11,


示例30: uv_poll_init

int uv_poll_init(uv_loop_t* loop, uv_poll_t* handle, int fd) {  int err;  err = uv__nonblock(fd, 1);  if (err)    return err;  uv__handle_init(loop, (uv_handle_t*) handle, UV_POLL);  uv__io_init(&handle->io_watcher, uv__poll_io, fd);  handle->poll_cb = NULL;  return 0;}
开发者ID:cwz920716,项目名称:tail.js,代码行数:12,



注:本文中的uv__handle_init函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ uv__handle_start函数代码示例
C++ uv__free函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。