Lines Matching refs:hook

372     LoopHook*  hook = l->hooks;  in looper_find()  local
373 LoopHook* end = hook + l->num_fds; in looper_find()
375 for ( ; hook < end; hook++ ) { in looper_find()
376 if (hook->fd == fd) in looper_find()
377 return hook; in looper_find()
397 LoopHook* hook = l->hooks + n; in looper_grow() local
399 ev.events = hook->wanted; in looper_grow()
400 ev.data.ptr = hook; in looper_grow()
401 epoll_ctl( l->epoll_fd, EPOLL_CTL_MOD, hook->fd, &ev ); in looper_grow()
412 LoopHook* hook; in looper_add() local
417 hook = l->hooks + l->num_fds; in looper_add()
419 hook->fd = fd; in looper_add()
420 hook->ev_user = user; in looper_add()
421 hook->ev_func = func; in looper_add()
422 hook->state = 0; in looper_add()
423 hook->wanted = 0; in looper_add()
424 hook->events = 0; in looper_add()
429 ev.data.ptr = hook; in looper_add()
440 LoopHook* hook = looper_find( l, fd ); in looper_del() local
442 if (!hook) { in looper_del()
447 hook->state |= HOOK_CLOSING; in looper_del()
459 LoopHook* hook = looper_find( l, fd ); in looper_enable() local
461 if (!hook) { in looper_enable()
466 if (events & ~hook->wanted) { in looper_enable()
469 hook->wanted |= events; in looper_enable()
470 ev.events = hook->wanted; in looper_enable()
471 ev.data.ptr = hook; in looper_enable()
484 LoopHook* hook = looper_find( l, fd ); in looper_disable() local
486 if (!hook) { in looper_disable()
491 if (events & hook->wanted) { in looper_disable()
494 hook->wanted &= ~events; in looper_disable()
495 ev.events = hook->wanted; in looper_disable()
496 ev.data.ptr = hook; in looper_disable()
527 LoopHook* hook = l->events[n].data.ptr; in looper_loop() local
528 hook->state = HOOK_PENDING; in looper_loop()
529 hook->events = l->events[n].events; in looper_loop()
535 LoopHook* hook = l->hooks + n; in looper_loop() local
536 if (hook->state & HOOK_PENDING) { in looper_loop()
537 hook->state &= ~HOOK_PENDING; in looper_loop()
538 hook->ev_func( hook->ev_user, hook->events ); in looper_loop()
546 LoopHook* hook = l->hooks + n; in looper_loop() local
548 if (!(hook->state & HOOK_CLOSING)) { in looper_loop()
553 hook[0] = l->hooks[l->num_fds-1]; in looper_loop()
555 ev.events = hook->wanted; in looper_loop()
556 ev.data.ptr = hook; in looper_loop()
557 epoll_ctl( l->epoll_fd, EPOLL_CTL_MOD, hook->fd, &ev ); in looper_loop()