-/*
- Only one fallback is possible for each event (INPUT, OUTPUT, CONNECTION, LOST)
- INPUT: The function is called when there is at least a byte in the
- input buffer
- OUTPUT: The function is called when the system is sure the next write call
- will not block
- CONNECTION: Two cases is possible:
- Client socket -> the connection is established
- Server socket -> a client request a connection
- LOST: the connection is lost
-
- SetCallback accepts a combination of these flags so a same callback can
- receive different events.
-
- An event is generated only once and its state is reseted when the relative
- IO call is requested.
- For example: INPUT -> GSocket_Read()
- CONNECTION -> GSocket_Accept()
-*/
-void GSocket_SetCallback(GSocket *socket, GSocketEventFlags event,
+/* Only one callback is possible for each event (INPUT, OUTPUT, CONNECTION
+ * and LOST). The callbacks are called in the following situations:
+ *
+ * INPUT: There is at least one byte in the input buffer
+ * OUTPUT: The system is sure that the next write call will not block
+ * CONNECTION: Two cases are possible:
+ * Client socket -> the connection is established
+ * Server socket -> a client requests a connection
+ * LOST: The connection is lost
+ *
+ * An event is generated only once and its state is reseted when the
+ * relative IO call is requested.
+ * For example: INPUT -> GSocket_Read()
+ * CONNECTION -> GSocket_Accept()
+ */
+
+/* GSocket_SetCallback:
+ * Enables the callbacks specified by 'flags'. Note that 'flags'
+ * may be a combination of flags OR'ed toghether, so the same
+ * callback function can be made to accept different events.
+ * The callback function must have the following prototype:
+ *
+ * void function(GSocket *socket, GSocketEvent event, char *cdata)
+ */
+void GSocket_SetCallback(GSocket *socket, GSocketEventFlags flags,