diff libpurple/eventloop.h @ 15695:79808b1a237f

merge of 'e57f2c0fb5b3a764c079b6991a8e68e23230b016' and 'fe52ccdd53046a7cef83ae2919b4f98960d8b416'
author Sean Egan <seanegan@gmail.com>
date Sun, 25 Feb 2007 01:09:40 +0000
parents c463709294f8
children 32c366eeeb99
line wrap: on
line diff
--- a/libpurple/eventloop.h	Sun Feb 25 01:09:27 2007 +0000
+++ b/libpurple/eventloop.h	Sun Feb 25 01:09:40 2007 +0000
@@ -71,6 +71,16 @@
 	 * @see gaim_input_remove, g_source_remove
 	 */
 	gboolean (*input_remove)(guint handle);
+	
+	
+	/**
+	 * Get the current error status for an input.
+	 * Implementation of this UI op is optional. Implement it if the UI's sockets
+	 * or event loop needs to customize determination of socket error status.
+	 * @see gaim_input_get_error, getsockopt
+	 */
+	int (*input_get_error)(int fd, int *error);
+
 };
 
 /**************************************************************************/
@@ -121,6 +131,21 @@
  */
 gboolean gaim_input_remove(guint handle);
 
+/**
+ * Get the current error status for an input.
+ * The return value and error follow getsockopt() with a level of SOL_SOCKET and an
+ * option name of SO_ERROR, and this is how the error is determined if the UI does not
+ * implement the input_get_error UI op.
+ *
+ * @param fd        The input file descriptor.
+ * @param errno		A pointer to an int which on return will have the error, or 0 if no error.
+ *
+ * @return 0 if there is no error; -1 if there is an error, in which case errno will be set.
+ */
+int
+gaim_input_get_error(int fd, int *error);
+
+
 /*@}*/