vmdsock.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *cr
00003  *cr            (C) Copyright 1995-2008 The Board of Trustees of the
00004  *cr                        University of Illinois
00005  *cr                         All Rights Reserved
00006  *cr
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  * RCS INFORMATION:
00011  *
00012  *      $RCSfile: vmdsock.h,v $
00013  *      $Author: johns $        $Locker:  $             $State: Exp $
00014  *      $Revision: 1.12 $      $Date: 2008/03/27 19:36:52 $
00015  *
00016  ***************************************************************************
00017  * DESCRIPTION:
00018  *   socket interface layer, abstracts platform-dependent routines/APIs
00019  ***************************************************************************/
00020 
00021 #if defined(VMDSOCKINTERNAL)
00022 
00023 #if !defined(_MSC_VER)
00024 #include <unistd.h>
00025 #include <sys/types.h>
00026 #include <sys/socket.h>
00027 #include <sys/time.h>
00028 #include <netinet/in.h>
00029 #include <sys/file.h>
00030 #endif
00031 
00032 typedef struct {
00033   struct sockaddr_in addr; /* address of socket provided by bind() */
00034   int addrlen;             /* size of the addr struct */
00035   int sd;                  /* socket file descriptor */
00036 } vmdsocket;
00037 
00038 #endif /* VMDSOCKINTERNAL */
00039 
00040 #ifdef WIN32
00041     #if defined(SimTK_MOLMODEL_BUILDING_SHARED_LIBRARY)
00042         #define SimTK_MOLMODEL_EXPORT __declspec(dllexport)
00043     #elif defined(SimTK_MOLMODEL_BUILDING_STATIC_LIBRARY) || defined(SimTK_USE_STATIC_LIBRARIES)
00044         #define SimTK_MOLMODEL_EXPORT
00045     #else
00046         #define SimTK_MOLMODEL_EXPORT __declspec(dllimport)   // i.e., a client of a shared library
00047     #endif
00048 #else
00049     #define SimTK_MOLMODEL_EXPORT // Linux, Mac
00050 #endif
00051 
00052 #ifdef __cplusplus
00053 extern "C" {
00054 #endif
00055 
00056 int  SimTK_MOLMODEL_EXPORT  vmdsock_init(void);
00057 void SimTK_MOLMODEL_EXPORT *vmdsock_create(void);
00058 int  SimTK_MOLMODEL_EXPORT  vmdsock_bind(void *, int);
00059 int  SimTK_MOLMODEL_EXPORT  vmdsock_listen(void *);
00060 void SimTK_MOLMODEL_EXPORT *vmdsock_accept(void *);  /* return new socket */
00061 int  SimTK_MOLMODEL_EXPORT  vmdsock_connect(void *, const char *, int);
00062 int  SimTK_MOLMODEL_EXPORT  vmdsock_write(void *, const void *, int);
00063 int  SimTK_MOLMODEL_EXPORT  vmdsock_read(void *, void *, int);
00064 int  SimTK_MOLMODEL_EXPORT  vmdsock_selread(void *, int);
00065 int  SimTK_MOLMODEL_EXPORT  vmdsock_selwrite(void *, int);
00066 void SimTK_MOLMODEL_EXPORT  vmdsock_shutdown(void *);
00067 void SimTK_MOLMODEL_EXPORT  vmdsock_destroy(void *);
00068 
00069 #ifdef __cplusplus
00070 }
00071 #endif
00072 

Generated on Fri Sep 26 07:44:19 2008 for SimTKcore by  doxygen 1.5.6