# HG changeset patch
# Node ID 3d99360558a0
# Parent  60f99b6d9fff
diff --git a/ChangeLog.API b/ChangeLog.API
--- a/ChangeLog.API
+++ b/ChangeLog.API
@@ -453,6 +453,9 @@
 		* purple_idle_get_ui_ops
 		* purple_idle_set_ui_ops
 		* purple_idle_ui_ops_get_type
+		* PurpleInputCondition
+		* PurpleInputFunction
+		* purple_input_add
 		* purple_input_remove
 		* purple_ip_address_is_valid, purple_ipv4_address_is_valid, and
 		  purple_ipv6_address_is_valid. Use g_hostname_is_ip_address()
diff --git a/libpurple/eventloop.h b/libpurple/eventloop.h
deleted file mode 100644
--- a/libpurple/eventloop.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- *
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this library; if not, see <https://www.gnu.org/licenses/>.
- */
-
-#if !defined(PURPLE_GLOBAL_HEADER_INSIDE) && !defined(PURPLE_COMPILATION)
-# error "only <purple.h> may be included directly"
-#endif
-
-#ifndef PURPLE_EVENTLOOP_H
-#define PURPLE_EVENTLOOP_H
-
-#include <glib.h>
-#include <glib-object.h>
-
-#include "purpleversion.h"
-
-/**
- * PurpleInputCondition:
- * @PURPLE_INPUT_READ:  A read condition.
- * @PURPLE_INPUT_WRITE: A write condition.
- *
- * An input condition.
- *
- * Since: 2.0
- */
-typedef enum
-{
-	PURPLE_INPUT_READ  = 1 << 0,
-	PURPLE_INPUT_WRITE = 1 << 1
-
-} PurpleInputCondition;
-
-/**
- * PurpleInputFunction:
- * @data: User specified data.
- * @fd: The input file descriptor.
- * @cond: The condition type.
- *
- * The type of callbacks to handle events on file descriptors, as passed to
- * purple_input_add().  The callback will receive the @user_data passed to
- * purple_input_add(), the file descriptor on which the event occurred, and the
- * condition that was satisfied to cause the callback to be invoked.
- *
- * Since: 2.0
- */
-typedef void (*PurpleInputFunction)(gpointer data, gint fd, PurpleInputCondition cond);
-
-G_BEGIN_DECLS
-
-/**************************************************************************/
-/* Event Loop API                                                         */
-/**************************************************************************/
-
-/**
- * purple_input_add:
- * @fd:        The input file descriptor.
- * @cond:      The condition type.
- * @func:      (scope call): The callback function for data.
- * @user_data: User-specified data.
- *
- * Adds an input handler.
- *
- * See g_io_add_watch_full().
- *
- * Returns: The resulting handle (will be greater than 0).
- *
- * Since: 2.0
- */
-PURPLE_AVAILABLE_IN_ALL
-guint purple_input_add(int fd, PurpleInputCondition cond, PurpleInputFunction func, gpointer user_data);
-
-G_END_DECLS
-
-#endif /* PURPLE_EVENTLOOP_H */
diff --git a/libpurple/eventloop.c b/libpurple/eventloop.c
deleted file mode 100644
--- a/libpurple/eventloop.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Purple - Internet Messaging Library
- * Copyright (C) Pidgin Developers <devel@pidgin.im>
- *
- * Purple is the legal property of its developers, whose names are too numerous
- * to list here. Please refer to the COPYRIGHT file distributed with this
- * source distribution.
- *
- * This library is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This library is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this library; if not, see <https://www.gnu.org/licenses/>.
- */
-
-#include "purpleconfig.h"
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include "eventloop.h"
-#ifdef _WIN32
-#include "win32/win32dep.h"
-#endif
-
-#define PURPLE_GLIB_READ_COND  (G_IO_IN | G_IO_HUP | G_IO_ERR)
-#define PURPLE_GLIB_WRITE_COND (G_IO_OUT | G_IO_HUP | G_IO_ERR | G_IO_NVAL)
-
-typedef struct {
-	PurpleInputFunction function;
-	guint result;
-	gpointer data;
-} PurpleIOClosure;
-
-static gboolean
-purple_io_invoke(GIOChannel *source, GIOCondition condition, gpointer data)
-{
-	PurpleIOClosure *closure = data;
-	PurpleInputCondition purple_cond = 0;
-
-	if (condition & PURPLE_GLIB_READ_COND)
-		purple_cond |= PURPLE_INPUT_READ;
-	if (condition & PURPLE_GLIB_WRITE_COND)
-		purple_cond |= PURPLE_INPUT_WRITE;
-
-#ifdef _WIN32
-	if(!purple_cond) {
-		return TRUE;
-	}
-#endif /* _WIN32 */
-
-	closure->function(closure->data, g_io_channel_unix_get_fd(source),
-			  purple_cond);
-
-	return TRUE;
-}
-
-guint
-purple_input_add(int source, PurpleInputCondition condition, PurpleInputFunction func, gpointer user_data)
-{
-	PurpleIOClosure *closure = g_new0(PurpleIOClosure, 1);
-	GIOChannel *channel;
-	GIOCondition cond = 0;
-
-	closure->function = func;
-	closure->data = user_data;
-
-	if (condition & PURPLE_INPUT_READ)
-		cond |= PURPLE_GLIB_READ_COND;
-	if (condition & PURPLE_INPUT_WRITE)
-		cond |= PURPLE_GLIB_WRITE_COND;
-
-#ifdef _WIN32
-	channel = g_io_channel_win32_new_socket(source);
-#else
-	channel = g_io_channel_unix_new(source);
-#endif
-
-	closure->result = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT,
-			cond, purple_io_invoke, closure, g_free);
-
-	g_io_channel_unref(channel);
-	return closure->result;
-}
diff --git a/libpurple/idle.c b/libpurple/idle.c
--- a/libpurple/idle.c
+++ b/libpurple/idle.c
@@ -25,7 +25,6 @@
 #include "connection.h"
 #include "conversations.h"
 #include "debug.h"
-#include "eventloop.h"
 #include "prefs.h"
 #include "purpleaccountmanager.h"
 #include "savedstatuses.h"
diff --git a/libpurple/image-store.c b/libpurple/image-store.c
--- a/libpurple/image-store.c
+++ b/libpurple/image-store.c
@@ -22,7 +22,6 @@
 
 #include "image-store.h"
 
-#include "eventloop.h"
 #include "util.h"
 
 #define TEMP_IMAGE_TIMEOUT 5
diff --git a/libpurple/meson.build b/libpurple/meson.build
--- a/libpurple/meson.build
+++ b/libpurple/meson.build
@@ -14,7 +14,6 @@
 	'core.c',
 	'countingnode.c',
 	'debug.c',
-	'eventloop.c',
 	'group.c',
 	'idle.c',
 	'image.c',
@@ -142,7 +141,6 @@
 	'core.h',
 	'countingnode.h',
 	'debug.h',
-	'eventloop.h',
 	'group.h',
 	'idle.h',
 	'image.h',
@@ -307,7 +305,6 @@
 	'buddyicon.h',
 	'connection.h',
 	'debug.h',
-	'eventloop.h',
 	'notify.h',
 	'plugins.h',
 	'purpleaccount.h',
diff --git a/libpurple/proxy.c b/libpurple/proxy.c
--- a/libpurple/proxy.c
+++ b/libpurple/proxy.c
@@ -23,7 +23,6 @@
 #include <glib/gi18n-lib.h>
 
 #include "debug.h"
-#include "eventloop.h"
 #include "notify.h"
 #include "prefs.h"
 #include "proxy.h"
