2023-02-11 20:49:42 +00:00
|
|
|
// This file Copyright © 2022-2023 Mnemosyne LLC.
|
2022-11-06 21:11:30 +00:00
|
|
|
// It may be used under GPLv2 (SPDX: GPL-2.0-only), GPLv3 (SPDX: GPL-3.0-only),
|
|
|
|
// or any future license endorsed by Mnemosyne LLC.
|
|
|
|
// License text can be found in the licenses/ folder.
|
|
|
|
|
|
|
|
#ifndef __TRANSMISSION__
|
|
|
|
#error only libtransmission should #include this header.
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2023-01-03 21:26:04 +00:00
|
|
|
struct evbuffer;
|
|
|
|
struct event;
|
|
|
|
struct event_base;
|
|
|
|
struct evhttp;
|
2022-11-06 21:11:30 +00:00
|
|
|
|
|
|
|
namespace libtransmission::evhelpers
|
|
|
|
{
|
|
|
|
|
|
|
|
struct BufferDeleter
|
|
|
|
{
|
2023-01-03 21:26:04 +00:00
|
|
|
void operator()(struct evbuffer* buf) const noexcept;
|
2022-11-06 21:11:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
using evbuffer_unique_ptr = std::unique_ptr<struct evbuffer, BufferDeleter>;
|
|
|
|
|
|
|
|
struct EventBaseDeleter
|
|
|
|
{
|
2023-01-03 21:26:04 +00:00
|
|
|
void operator()(struct event_base* evbase) const noexcept;
|
2022-11-06 21:11:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
using evbase_unique_ptr = std::unique_ptr<struct event_base, EventBaseDeleter>;
|
|
|
|
|
|
|
|
struct EventDeleter
|
|
|
|
{
|
2023-01-03 21:26:04 +00:00
|
|
|
void operator()(struct event* event) const;
|
2022-11-06 21:11:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
using event_unique_ptr = std::unique_ptr<struct event, EventDeleter>;
|
|
|
|
|
2022-11-28 14:07:04 +00:00
|
|
|
struct EvhttpDeleter
|
|
|
|
{
|
2023-01-03 21:26:04 +00:00
|
|
|
void operator()(struct evhttp* evh) const noexcept;
|
2022-11-28 14:07:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
using evhttp_unique_ptr = std::unique_ptr<struct evhttp, EvhttpDeleter>;
|
|
|
|
|
2022-11-06 21:11:30 +00:00
|
|
|
} // namespace libtransmission::evhelpers
|