/* * bronx_listener.c -- File route handling. * * Copyright (C) 2007 Groundwork Open Source * Written by Daniel Emmanuel Feinsmith * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor * Boston, MA 02110-1301, USA. * * Change Log: * DEF Created on September 17, 2007, 1:00 PM */ #ifndef _BRONX_LISTENER_H #define _BRONX_LISTENER_H #define BRONX_LISTENER_POLL_TIMEOUT 30000 extern void* APR_THREAD_FUNC thread_listener(apr_thread_t *thread, void *data); // The regime for a handler's return code is as follows. // * If the file descriptor is to remain open for more i/o, return BRONX_OK. // * If the file descriptor is to be closed, return BRONX_ERROR. // If it sees a return code other than BRONX_OK, the calling code must then close // the file descriptor and clean up whatever other data structures are involved at // its own level. The handler is responsible for cleaning up whatever companion // data structures are involved at that level, before returning the non-BRONX_OK // return value. struct handler_entry { int (*handler)(int, void *); void *data; int fd; }; #endif /* _BRONX_LISTENER_H */