pidgin/pidgin

c5d992e0ee08
Parents 84cf660ed9ec
Children 7bc670f89e02
Remove the remaining event loop API as it is no longer used

Testing Done:
Called in the world's most fearsome fighting team.

Reviewed at https://reviews.imfreedom.org/r/3092/
--- a/ChangeLog.API Thu Apr 11 21:36:18 2024 -0500
+++ b/ChangeLog.API Thu Apr 11 21:39:52 2024 -0500
@@ -452,6 +452,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()
--- a/libpurple/eventloop.c Thu Apr 11 21:36:18 2024 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -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;
-}
--- a/libpurple/eventloop.h Thu Apr 11 21:36:18 2024 -0500
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -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 */
--- a/libpurple/idle.c Thu Apr 11 21:36:18 2024 -0500
+++ b/libpurple/idle.c Thu Apr 11 21:39:52 2024 -0500
@@ -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"
--- a/libpurple/image-store.c Thu Apr 11 21:36:18 2024 -0500
+++ b/libpurple/image-store.c Thu Apr 11 21:39:52 2024 -0500
@@ -22,7 +22,6 @@
#include "image-store.h"
-#include "eventloop.h"
#include "util.h"
#define TEMP_IMAGE_TIMEOUT 5
--- a/libpurple/meson.build Thu Apr 11 21:36:18 2024 -0500
+++ b/libpurple/meson.build Thu Apr 11 21:39:52 2024 -0500
@@ -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',
--- a/libpurple/proxy.c Thu Apr 11 21:36:18 2024 -0500
+++ b/libpurple/proxy.c Thu Apr 11 21:39:52 2024 -0500
@@ -23,7 +23,6 @@
#include <glib/gi18n-lib.h>
#include "debug.h"
-#include "eventloop.h"
#include "notify.h"
#include "prefs.h"
#include "proxy.h"
--- a/po/POTFILES.in Thu Apr 11 21:36:18 2024 -0500
+++ b/po/POTFILES.in Thu Apr 11 21:39:52 2024 -0500
@@ -13,7 +13,6 @@
libpurple/core.c
libpurple/countingnode.c
libpurple/debug.c
-libpurple/eventloop.c
libpurple/group.c
libpurple/idle.c
libpurple/image.c