-/* Global initializers */
-
-/* GSocket_Init() must be called at the beginning */
-bool GSocket_Init();
-/* GSocket_Cleanup() must be called at the ending */
-void GSocket_Cleanup();
-
-/* Constructors / Destructors */
-
-GSocket *GSocket_new();
-void GSocket_destroy(GSocket *socket);
-
-/* This will disable all further IO calls to this socket */
-void GSocket_Shutdown(GSocket *socket);
-
-/* Address handling */
-
-GSocketError GSocket_SetLocal(GSocket *socket, GAddress *address);
-GSocketError GSocket_SetPeer(GSocket *socket, GAddress *address);
-GAddress *GSocket_GetLocal(GSocket *socket);
-GAddress *GSocket_GetPeer(GSocket *socket);
-
-/* Non-oriented connections handlers */
-
-GSocketError GSocket_SetNonOriented(GSocket *socket);
-
-/* Server specific parts */
-
-/* GSocket_SetServer:
- * Sets up the socket as a server. It uses the "Local" field of GSocket.
- * "Local" must be set by GSocket_SetLocal() before GSocket_SetServer()
- * is called. Possible error codes are: GSOCK_INVSOCK if socket has not
- * been initialized, GSOCK_INVADDR if the local address has not been
- * defined and GSOCK_IOERR for other internal errors.
- */
-GSocketError GSocket_SetServer(GSocket *socket);
-
-/* GSocket_WaitConnection:
- * Waits for an incoming client connection.
- */
-GSocket *GSocket_WaitConnection(GSocket *socket);
-
-/* Client specific parts */
-
-/* GSocket_Connect:
- * Establishes a client connection to a server using the "Peer"
- * field of GSocket. "Peer" must be set by GSocket_SetPeer() before
- * GSocket_Connect() is called. Possible error codes are GSOCK_INVSOCK,
- * GSOCK_INVADDR, GSOCK_TIMEDOUT, GSOCK_WOULDBLOCK and GSOCK_IOERR.
- * If a socket is nonblocking and Connect() returns GSOCK_WOULDBLOCK,
- * the connection request can be completed later. Use GSocket_Select()
- * to check it, or wait for a GSOCK_CONNECTION event.
- */
-GSocketError GSocket_Connect(GSocket *socket, GSocketStream stream);
+/* Functions tables for internal use by GSocket code: */
+
+/* Actually this is a misnomer now, but reusing this name means I don't
+ have to ifdef app traits or common socket code */
+class GSocketGUIFunctionsTable
+{
+public:
+ virtual bool OnInit() = 0;
+ virtual void OnExit() = 0;
+ virtual bool CanUseEventLoop() = 0;
+ virtual bool Init_Socket(GSocket *socket) = 0;
+ virtual void Destroy_Socket(GSocket *socket) = 0;
+#ifndef __WINDOWS__
+ virtual void Install_Callback(GSocket *socket, GSocketEvent event) = 0;
+ virtual void Uninstall_Callback(GSocket *socket, GSocketEvent event) = 0;
+#endif
+ virtual void Enable_Events(GSocket *socket) = 0;
+ virtual void Disable_Events(GSocket *socket) = 0;
+};