libpurple/purpleprotocolmanager.h

Sat, 09 Aug 2025 17:37:27 +0800

author
Gong Zhile <gongzl@stu.hebust.edu.cn>
date
Sat, 09 Aug 2025 17:37:27 +0800
branch
bird-header-fix
changeset 43304
2599d35e9750
parent 43038
82d93d93f1d2
permissions
-rw-r--r--

Fix the birb header path

The birb header referred would only work with birb provided by wrap casuing
build to fail because of system-installed birb dependency. The commit points
it to the correct path <birb.h>.

See: https://keep.imfreedom.org/birb/birb/file/5bf00c7d7f80/birb/meson.build#l77

/*
 * 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_PROTOCOL_MANAGER_H
#define PURPLE_PROTOCOL_MANAGER_H

#include <glib.h>
#include <glib-object.h>

#include "purpleprotocol.h"
#include "purpleversion.h"

G_BEGIN_DECLS

/**
 * PURPLE_PROTOCOL_MANAGER_DOMAIN:
 *
 * A #GError domain for errors from #PurpleProtocolManager.
 *
 * Since: 3.0
 */
#define PURPLE_PROTOCOL_MANAGER_DOMAIN \
	g_quark_from_static_string("purple-protocol-manager") \
	PURPLE_AVAILABLE_MACRO_IN_3_0

#define PURPLE_TYPE_PROTOCOL_MANAGER (purple_protocol_manager_get_type())

PURPLE_AVAILABLE_IN_3_0
G_DECLARE_FINAL_TYPE(PurpleProtocolManager, purple_protocol_manager, PURPLE,
                     PROTOCOL_MANAGER, GObject)

/**
 * PurpleProtocolManager:
 *
 * #PurpleProtocolManager keeps track of all protocols and emits signals when
 * protocols are added and removed.
 *
 * Since: 3.0
 */

/**
 * purple_protocol_manager_add:
 * @manager: The #PurpleProtocolManager instance.
 * @protocol: The #PurpleProtocol to add.
 * @error: Return address for a #GError, or %NULL.
 *
 * Adds @protocol to @manager.
 *
 * Returns: %TRUE if @protocol was successfully added with @manager, %FALSE
 *          otherwise.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
gboolean purple_protocol_manager_add(PurpleProtocolManager *manager, PurpleProtocol *protocol, GError **error);

/**
 * purple_protocol_manager_get_default:
 *
 * Gets the default #PurpleProtocolManager instance.
 *
 * Returns: (transfer none): The default #PurpleProtocolManager instance.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
PurpleProtocolManager *purple_protocol_manager_get_default(void);

/**
 * purple_protocol_manager_find:
 * @manager: The #PurpleProtocolManager instance.
 * @id: The id of the #PurpleProtocol to find.
 *
 * Gets the #PurpleProtocol identified by @id if found, otherwise %NULL.
 *
 * Returns: (transfer none): The #PurpleProtocol identified by @id or %NULL.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
PurpleProtocol *purple_protocol_manager_find(PurpleProtocolManager *manager, const gchar *id);

/**
 * purple_protocol_manager_remove:
 * @manager: The #PurpleProtocolManager instance.
 * @protocol: The #PurpleProtocol to remove.
 * @error: Return address for a #GError, or %NULL.
 *
 * Removes @protocol from @manager.
 *
 * Returns: %TRUE if @protocol was successfully removed from @manager, %FALSE
 *          otherwise.
 *
 * Since: 3.0
 */
PURPLE_AVAILABLE_IN_3_0
gboolean purple_protocol_manager_remove(PurpleProtocolManager *manager, PurpleProtocol *protocol, GError **error);

G_END_DECLS

#endif /* PURPLE_PROTOCOL_MANAGER_H */

mercurial