00001 /* F B S E R V _ O B J . H 00002 * BRL-CAD 00003 * 00004 * Copyright (c) 2004-2006 United States Government as represented by 00005 * the U.S. Army Research Laboratory. 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public License 00009 * as published by the Free Software Foundation; either version 2.1 of 00010 * the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, but 00013 * WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Library General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this file; see the file named COPYING for more 00019 * information. 00020 */ 00021 /** @addtogroup libfb */ 00022 /*@{*/ 00023 /** @file fbserv_obj.h 00024 * 00025 */ 00026 #ifndef __FBSERV_OBJ_H__ 00027 #define __FBSERV_OBJ_H__ 00028 00029 #include "fb.h" 00030 #include "pkg.h" 00031 00032 #define NET_LONG_LEN 4 /**< @brief # bytes to network long */ 00033 #define MAX_CLIENTS 32 00034 #define MAX_PORT_TRIES 100 00035 #define FBS_CALLBACK_NULL (void (*)())NULL 00036 00037 struct fbserv_listener { 00038 int fbsl_fd; /**< @brief socket to listen for connections */ 00039 int fbsl_port; /**< @brief port number to listen on */ 00040 int fbsl_listen; /**< @brief !0 means listen for connections */ 00041 struct fbserv_obj *fbsl_fbsp; /**< @brief points to its fbserv object */ 00042 }; 00043 00044 struct fbserv_client { 00045 int fbsc_fd; 00046 struct pkg_conn *fbsc_pkg; 00047 struct fbserv_obj *fbsc_fbsp; /**< @brief points to its fbserv object */ 00048 }; 00049 00050 struct fbserv_obj { 00051 FBIO *fbs_fbp; /**< @brief framebuffer pointer */ 00052 struct fbserv_listener fbs_listener; /**< @brief data for listening */ 00053 struct fbserv_client fbs_clients[MAX_CLIENTS]; /**< @brief connected clients */ 00054 void (*fbs_callback)(); /**< @brief callback function */ 00055 genptr_t fbs_clientData; 00056 }; 00057 00058 FB_EXPORT extern int fbs_open(); 00059 FB_EXPORT extern int fbs_close(); 00060 00061 #endif /* __FBSERV_OBJ_H__ */ 00062 /*@}*/ 00063 /* 00064 * Local Variables: 00065 * mode: C 00066 * tab-width: 8 00067 * c-basic-offset: 4 00068 * indent-tabs-mode: t 00069 * End: 00070 * ex: shiftwidth=4 tabstop=8 00071 */ 00072