#include <stdio.h>
#include <stdlib.h>
#include "dicelib.h"
Go to the source code of this file.
Compounds | |
| struct | _dice_data |
| Internal data. More... | |
| struct | _dice_data::_clients |
| union | _dice_packet |
| Packet structure. More... | |
Internal functions | |
| #define | dice_is_server() (dice_data.clientnum != -1) |
| int | dice_type_init_defaults (void) |
| void | dice_type_free_all (void) |
| int | dice_sync_init (void) |
| Initializes synchronous variables. | |
| void | dice_sync_end (void) |
| Frees synchronous variables. | |
| int | dice_async_init (void) |
| void | dice_async_end (void) |
| int | dice_init_client (void) |
| Initialize this machine as client ("server"). More... | |
| void | dice_sync_update_send (void) |
| Send all updates. More... | |
| int | dice_packet_send (dice_packet *p, int sock) |
| Sends a packet to a list of sockets. More... | |
| dice_packet | dice_packet_get (int sock) |
| int | dice_broadcast (dice_packet *packet, int except) |
| Broadcast packet. More... | |
| int | dice_control_loop (int argc, char **argv) |
| int | dice_type_register (DICE_Type *t) |
| Registers a new variable type. More... | |
| int | dice_control_hierarchy (int a, int b) |
| Which of the sockets has a higher patent. More... | |
| void | dice_free (void *data) |
| char * | dice_packet_name (dice_packet_type t) |
| void | dice_printf (char *function, char *format,...) |
| Our own printf. Formats a string to be printed with colors (using dice_data.color[]), sends to dice_data.error, etc. More... | |
| int | dice_type_is_valid (char *name) |
| char * | defaultpath |
Defines | |
| #define | _dice_debug(l, c) if ( l <= dice_data.verbose ) c |
| Debug macro. More... | |
Typedefs | |
| typedef enum _dice_packet_type | dice_packet_type |
| Typedef encapsulation. | |
| typedef _dice_packet | dice_packet |
| Typedef encapsulation. | |
Enumerations | |
| enum | _dice_packet_type { INVALID, SYNC, VARIABLE_ASYNC, VARIABLE_SYNC, VARIABLE_FREE_ASYNC, VARIABLE_FREE_SYNC, READY, CONTINUE, HELLO, GOODBYE } |
| Packet types. More... | |
Variables | |
| _dice_data | dice_data |
| Internal data structure declaration. | |
Definition in file _dicelib.h.
|
|
Debug macro.
Definition at line 46 of file _dicelib.h. |
|
|
Packet types.
Definition at line 83 of file _dicelib.h. |
|
|||||||||||||||
|
Broadcast packet.
Broadcasts a packet to all clients, or to all except one.
|
|
|||||||||||||||
|
Which of the sockets has a higher patent.
|
|
|
Initialize this machine as client ("server").
Automatically called by DICE_init.
|
|
|||||||||||||||
|
Sends a packet to a list of sockets.
Sends a packet to a list of sockets. All sockets must be already opened.
|
|
||||||||||||||||||||||
|
Our own printf. Formats a string to be printed with colors (using dice_data.color[]), sends to dice_data.error, etc.
|
|
|
Send all updates.
Long description |
|
|
Registers a new variable type.
This functions registers a new variable type name. You should have in your executable or some library it's linked to these three functions:
Variable types are case sensitive. You should (but don't have to) follow RFC 1014 (XDR: External Data Representation Standard) to pack and unpack data, assuring portability. DICE supports by default the following types:
|
1.2.9.1 written by Dimitri van Heesch,
© 1997-2001