00001 /* $Id: sock_select.h 3553 2011-05-05 06:14:19Z nanang $ */00002 /* 00003 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)00004 * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>00005 *00006 * This program is free software; you can redistribute it and/or modify00007 * it under the terms of the GNU General Public License as published by00008 * the Free Software Foundation; either version 2 of the License, or00009 * (at your option) any later version.00010 *00011 * This program is distributed in the hope that it will be useful,00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the00014 * GNU General Public License for more details.00015 *00016 * You should have received a copy of the GNU General Public License00017 * along with this program; if not, write to the Free Software00018 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 */00020 #ifndef __PJ_SELECT_H__00021 #define __PJ_SELECT_H__00022
00028 #include <pj/types.h>00029
00030 PJ_BEGIN_DECL00031
00056typedefstruct pj_fd_set_t00057 {
00058pj_sock_tdata[PJ_IOQUEUE_MAX_HANDLES+ 4];
00059 } pj_fd_set_t;
00060
00061
00067 PJ_DECL(void) PJ_FD_ZERO(pj_fd_set_t *fdsetp);
00068
00069
00082 PJ_DECL(pj_size_t) PJ_FD_COUNT(const pj_fd_set_t *fdsetp);
00083
00084
00093 PJ_DECL(void) PJ_FD_SET(pj_sock_t fd, pj_fd_set_t *fdsetp);
00094
00103 PJ_DECL(void) PJ_FD_CLR(pj_sock_t fd, pj_fd_set_t *fdsetp);
00104
00105
00115 PJ_DECL(pj_bool_t) PJ_FD_ISSET(pj_sock_t fd, const pj_fd_set_t *fdsetp);
00116
00117
00138 PJ_DECL(int) pj_sock_select( int n,
00139 pj_fd_set_t *readfds,
00140 pj_fd_set_t *writefds,
00141 pj_fd_set_t *exceptfds,
00142 const pj_time_val *timeout);
00143
00144
00150 PJ_END_DECL00151
00152 #endif /* __PJ_SELECT_H__ */
PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.