diff options
author | fcolin | 2005-05-20 12:48:19 +0000 |
---|---|---|
committer | fcolin | 2005-05-20 12:48:19 +0000 |
commit | 216e4008069a5a1fe2c4270c6bd6209da27ba4bf (patch) | |
tree | 3ff404e89423481b387103083e5248bf4b653684 /src/ivysocket.h | |
parent | 2e89053faba944553881cfbbfffbcbf2a1a7cec5 (diff) | |
download | ivy-c-216e4008069a5a1fe2c4270c6bd6209da27ba4bf.zip ivy-c-216e4008069a5a1fe2c4270c6bd6209da27ba4bf.tar.gz ivy-c-216e4008069a5a1fe2c4270c6bd6209da27ba4bf.tar.bz2 ivy-c-216e4008069a5a1fe2c4270c6bd6209da27ba4bf.tar.xz |
elimination des tailles de buffer par utilisation de realloc
la plupart des fonctions utilisent un pointeur static pour eviter
de multiple malloc/free
ce qui veut dire que IvyC n'est pas reentrant !!!!
Diffstat (limited to 'src/ivysocket.h')
-rw-r--r-- | src/ivysocket.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ivysocket.h b/src/ivysocket.h index 4afde64..5dfdf0a 100644 --- a/src/ivysocket.h +++ b/src/ivysocket.h @@ -20,7 +20,9 @@ #ifdef __cplusplus extern "C" { #endif - + +#include <stdarg.h> + /* general Handle */ #define ANYPORT 0 @@ -46,6 +48,9 @@ extern "C" { /* General Init */ extern void SocketInit(); +/* utility fonction do make vsprintf without buffer limit */ +extern int make_message(char ** buffer, int *size, const char *fmt, va_list ap); + /* Forward def */ typedef struct _client *Client; typedef void (*SocketInterpretation) (Client client, void *data, char *ligne); @@ -63,6 +68,8 @@ extern void SocketServerClose( Server server ); extern void SocketClose( Client client ); extern void SocketSend( Client client, char *fmt, ... ); +extern void SocketSendBuffered (Client client, char *fmt, ... ); +extern void SocketFlush ( Client client ); extern void SocketSendRaw( Client client, char *buffer, int len ); extern char *SocketGetPeerHost( Client client ); extern void SocketSetData( Client client, void *data ); |