From 09f82d4e1e6dd1672b272c314c42d5cf30c91ea8 Mon Sep 17 00:00:00 2001 From: bustico Date: Mon, 19 May 2008 15:31:30 +0000 Subject: * make the lib and api more robust by adding const where they should be * compile with -Wall and eliminate remaining warnings --- src/ivysocket.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/ivysocket.h') diff --git a/src/ivysocket.h b/src/ivysocket.h index 551ec52..df43303 100644 --- a/src/ivysocket.h +++ b/src/ivysocket.h @@ -54,14 +54,14 @@ extern void SocketInit(); /* Forward def */ typedef struct _client *Client; -typedef void (*SocketInterpretation) (Client client, void *data, char *ligne); +typedef void (*SocketInterpretation) (Client client, const void *data, char *ligne); /* Server Part */ typedef struct _server *Server; extern Server SocketServer(unsigned short port, void*(*create)(Client client), - void(*handle_delete)(Client client, void *data), - void(*handle_decongestion)(Client client, void *data), + void(*handle_delete)(Client client, const void *data), + void(*handle_decongestion)(Client client, const void *data), SocketInterpretation interpretation); extern unsigned short SocketServerGetPort( Server server ); extern void SocketServerClose( Server server ); @@ -73,21 +73,21 @@ extern SendState SocketSend( Client client, char *fmt, ... ); extern SendState SocketSendRaw( const Client client, const char *buffer, const int len ); extern SendState SocketSendRawWithId( const Client client, const char *id, const char *buffer, const int len ); extern char *SocketGetPeerHost( Client client ); -extern void SocketSetData( Client client, void *data ); -extern void *SocketGetData( Client client ); +extern void SocketSetData( Client client, const void *data ); +extern const void *SocketGetData( Client client ); extern void SocketBroadcast( char *fmt, ... ); extern Client SocketConnect( char * host, unsigned short port, void *data, SocketInterpretation interpretation, - void (*handle_delete)(Client client, void *data), - void(*handle_decongestion)(Client client, void *data) + void (*handle_delete)(Client client, const void *data), + void(*handle_decongestion)(Client client, const void *data) ); extern Client SocketConnectAddr( struct in_addr * addr, unsigned short port, void *data, SocketInterpretation interpretation, - void (*handle_delete)(Client client, void *data), - void(*handle_decongestion)(Client client, void *data) + void (*handle_delete)(Client client, const void *data), + void(*handle_decongestion)(Client client, const void *data) ); extern int SocketWaitForReply( Client client, char *buffer, int size, int delai); -- cgit v1.1