Lines Matching defs:cpcx
45 custom_poll_find_fd(custom_poll_ctx_t *cpcx, lws_sockfd_type fd)
49 for (n = 0; n < cpcx->count_pollfds; n++)
50 if (cpcx->pollfds[n].fd == fd)
51 return &cpcx->pollfds[n];
57 custom_poll_add_fd(custom_poll_ctx_t *cpcx, lws_sockfd_type fd, int events)
63 pfd = custom_poll_find_fd(cpcx, fd);
69 if (cpcx->count_pollfds == LWS_ARRAY_SIZE(cpcx->pollfds)) {
74 pfd = &cpcx->pollfds[cpcx->count_pollfds++];
83 custom_poll_del_fd(custom_poll_ctx_t *cpcx, lws_sockfd_type fd)
89 pfd = custom_poll_find_fd(cpcx, fd);
95 if (cpcx->count_pollfds > 1)
96 *pfd = cpcx->pollfds[cpcx->count_pollfds - 1];
98 cpcx->count_pollfds--;
104 custom_poll_change_fd(custom_poll_ctx_t *cpcx, lws_sockfd_type fd,
112 pfd = custom_poll_find_fd(cpcx, fd);
122 custom_poll_run(custom_poll_ctx_t *cpcx)
139 n = poll(cpcx->pollfds, (nfds_t)cpcx->count_pollfds, n);
146 for (n = 0; n < cpcx->count_pollfds; n++) {
147 lws_sockfd_type fd = cpcx->pollfds[n].fd;
150 if (!cpcx->pollfds[n].revents)
153 m = lws_service_fd(context, &cpcx->pollfds[n]);
157 if (m && cpcx->pollfds[n].fd != fd)