jabberd2  2.2.16
mio/mio.c
Go to the documentation of this file.
00001 /*
00002  * jabberd - Jabber Open Source Server
00003  * Copyright (c) 2002 Jeremie Miller, Thomas Muldowney,
00004  *                    Ryan Eatmon, Robert Norris, Christof Meerwald
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (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 of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA
00019  */
00020 
00021 /*
00022    MIO -- Managed Input/Output
00023    ---------------------------
00024 */
00025 
00026 #ifdef HAVE_CONFIG_H
00027 #   include <config.h>
00028 #endif
00029 
00030 #include "mio.h"
00031 
00032 mio_t mio_kqueue_new(int maxfd);
00033 mio_t mio_epoll_new(int maxfd);
00034 mio_t mio_poll_new(int maxfd);
00035 mio_t mio_select_new(int maxfd);
00036 mio_t mio_wsasync_new(int maxfd);
00037 
00038 mio_t mio_new(int maxfd)
00039 {
00040   mio_t m = NULL;
00041 
00042 #ifdef MIO_KQUEUE
00043   m = mio_kqueue_new(maxfd);
00044   if (m != NULL) return m;
00045 #endif
00046 
00047 #ifdef MIO_EPOLL
00048   m = mio_epoll_new(maxfd);
00049   if (m != NULL) return m;
00050 #endif
00051 
00052 #ifdef MIO_WSASYNC
00053   m = mio_wsasync_new(maxfd);
00054   if (m != NULL) return m;
00055 #endif
00056 
00057 #ifdef MIO_SELECT
00058   m = mio_select_new(maxfd);
00059   if (m != NULL) return m;
00060 #endif
00061 
00062 #ifdef MIO_POLL
00063   m = mio_poll_new(maxfd);
00064   if (m != NULL) return m;
00065 #endif
00066 
00067   return m;
00068 }