/* Global initializers */
/* GSocket_Init() must be called at the beginning */
-bool GSocket_Init();
+bool GSocket_Init(void);
/* GSocket_Cleanup() must be called at the end */
-void GSocket_Cleanup();
+void GSocket_Cleanup(void);
/* Constructors / Destructors */
-GSocket *GSocket_new();
+GSocket *GSocket_new(void);
void GSocket_destroy(GSocket *socket);
/* GAddress */
-GAddress *GAddress_new();
+GAddress *GAddress_new(void);
GAddress *GAddress_copy(GAddress *address);
void GAddress_destroy(GAddress *address);
#define SOCKLEN_T int
#endif
-#if defined(__BORLANDC__)
-GAddress *GAddress_new(void);
-GSocket *GSocket_new(void);
-#endif
-
#ifdef _MSC_VER
/* using FD_SET results in this warning */
#pragma warning(disable:4127) /* conditional expression is constant */
/* Constructors / Destructors for GSocket */
-GSocket *GSocket_new()
+GSocket *GSocket_new(void)
{
int i;
GSocket *socket;
} \
}
-GAddress *GAddress_new()
+GAddress *GAddress_new(void)
{
GAddress *address;
/* Global initialisers */
-bool GSocket_Init()
+bool GSocket_Init(void)
{
return TRUE;
}
-void GSocket_Cleanup()
+void GSocket_Cleanup(void)
{
}
/* Constructors / Destructors for GSocket */
-GSocket *GSocket_new()
+GSocket *GSocket_new(void)
{
int i;
GSocket *socket;
/* 10 minutes * 60 sec * 1000 millisec */
socket->m_establishing = FALSE;
- /* We initialize the GUI specific entries here */
- _GSocket_GUI_Init(socket);
+ /* Per-socket GUI-specific initialization */
+ if (!_GSocket_GUI_Init(socket))
+ {
+ free(socket);
+ return NULL;
+ }
return socket;
}
{
assert(socket != NULL);
+ /* Per-socket GUI-specific cleanup */
+ _GSocket_GUI_Destroy(socket);
+
/* Check that the socket is really shutdowned */
if (socket->m_fd != -1)
GSocket_Shutdown(socket);
- /* We destroy GUI specific variables */
- _GSocket_GUI_Destroy(socket);
-
/* Destroy private addresses */
if (socket->m_local)
GAddress_destroy(socket->m_local);
} \
}
-GAddress *GAddress_new()
+GAddress *GAddress_new(void)
{
GAddress *address;