Main Page   Compound List   File List   Compound Members   File Members  

dicelib.h

Go to the documentation of this file.
00001 /* DICElib (DIstributed CAVE Engine library) 
00002  * Copyright (c) 2001 Bruno Barberi Gnecco <brunobg@lsi.usp.br>
00003  *
00004  * Permission is hereby granted, free of charge, to any person obtaining a copy
00005  * of this software and associated documentation files (the "Software"), to
00006  * deal in the Software without restriction, including without limitation the
00007  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
00008  * sell copies of the Software, and to permit persons to whom the Software is
00009  * furnished to do so, subject to the following conditions:
00010  *
00011  * The above copyright notice and this permission notice shall be included in
00012  * all copies of the Software, its documentation and marketing & publicity
00013  * materials, and acknowledgment shall be given in the documentation, materials
00014  * and software packages that this Software was used.
00015  *
00016  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00017  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00018  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00019  * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
00020  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
00021  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00022  */
00023 
00024 #ifndef DICELIB_H
00025 #define DICELIB_H
00026 
00035 extern int      DICE_init               ( int *argc, char **argv );
00036 extern void     DICE_close              ( void );
00045 enum dice_attributetype {
00046         LIBVERSION,             
00047         VERBOSE,                
00048         PORT,                   
00049         MAX_CONNECTIONS,        
00050         OUTPUT,                 
00051         COLOR                   
00052 };
00056 typedef enum dice_attributetype DICE_AttributeType;
00057 
00058 extern int      DICE_set_attribute      ( DICE_AttributeType t, void *value );
00059 extern void *   DICE_get_attribute      ( DICE_AttributeType t );
00060 extern int      DICE_is_original        ( void );
00067 struct dice_type {
00068         char                    *name;
00069         char *                  (*pack_func) (void *data, int *n);
00070         void *                  (*unpack_func) (char *data, int *n);
00071         void                    (*free_func) (void *data);
00072 };
00073 typedef struct dice_type DICE_Type;
00074 extern DICE_Type DICE_MyTypes[];
00075 
00076 #define DICE_no_types           DICE_Type DICE_MyTypes[] = { NULL, NULL, NULL, NULL };
00077 //extern int DICE_type_register                 ( DICE_Type *t );
00078 extern int DICE_type_free               ( char *type, void *data );
00079 extern char *DICE_type_pack             ( char *type, void *data, int *n );
00080 extern void *DICE_type_unpack           ( char *type, char *packet, int *n );
00088 extern int DICE_sync                    ( void );
00089 
00090 extern int DICE_sync_new                ( char *name, char *type, void *value );
00091 extern int DICE_sync_delete             ( char *name );
00092 extern int DICE_sync_update             ( char *name, void *value );
00093 extern void *DICE_sync_get              ( char *name );
00094 extern void *DICE_sync_get_next         ( char *name );
00101 extern int DICE_async_new               ( char *name, char *type, void *value );
00102 extern int DICE_async_delete            ( char *name );
00103 extern int DICE_async_update            ( char *name, void *value );
00104 extern void *DICE_async_get             ( char *name );
00105 
00106 extern int DICE_async_lock              ( char *name );
00107 extern int DICE_async_unlock            ( char *name );
00110 struct dice_func {
00111         char                    *name;
00112         int                     (*func) (void *);
00113 };
00114 typedef struct dice_func DICE_Function;
00115 
00116 #define DICE_no_functions       DICE_Function DICE_MyFunctions[] = { NULL, NULL };
00117 extern int DICE_function                ( void *data );
00118 extern DICE_Function DICE_MyFunctions[];
00119 #endif

Generated at Sun Dec 9 16:13:18 2001 for dicelib by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001