82 lines
2.1 KiB
C
82 lines
2.1 KiB
C
/*
|
|
* This file is part of uIRC. (https://git.redxen.eu/caskd/uIRC)
|
|
* Copyright (c) 2019, 2020 Alex-David Denes
|
|
*
|
|
* uIRC 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 3 of the License, or
|
|
* any later version.
|
|
*
|
|
* uIRC 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 uIRC. If not, see <https://www.gnu.org/licenses/>.
|
|
*/
|
|
|
|
/*! \file */
|
|
|
|
#ifndef UIRC_GUARD_CAPABILITIES
|
|
#define UIRC_GUARD_CAPABILITIES
|
|
|
|
/*!
|
|
* \brief Converts capability to bitmask value
|
|
*
|
|
* \param[in] cap Capability bit from \link caps \endlink
|
|
*/
|
|
#define CAPBIT(cap) (1 << (cap))
|
|
|
|
/*!
|
|
* \brief List of capabilities to be used as a bitmask
|
|
*
|
|
* \sa CAPBIT
|
|
* \sa https://ircv3.net/registry#capabilities
|
|
*/
|
|
enum caps {
|
|
CAP_ACCOUNT_NOTIFY,
|
|
CAP_ACCOUNT_TAG,
|
|
CAP_AWAY_NOTIFY,
|
|
CAP_BATCH,
|
|
CAP_CAP_NOTIFY,
|
|
CAP_CHANNEL_RENAME,
|
|
CAP_CHGHOST,
|
|
CAP_ECHO_MESSAGE,
|
|
CAP_EXTENDED_JOIN,
|
|
CAP_INVITE_NOTIFY,
|
|
CAP_LABELED_RESPONSE,
|
|
CAP_MESSAGE_TAGS,
|
|
CAP_MONITOR,
|
|
CAP_MULTI_PREFIX,
|
|
CAP_MULTILINE,
|
|
CAP_SASL,
|
|
CAP_SERVER_TIME,
|
|
CAP_SETNAME,
|
|
CAP_TLS,
|
|
CAP_USERHOST_IN_NAMES,
|
|
};
|
|
#ifdef UIRC_HELPERS
|
|
/*!
|
|
* \brief Converts a string of capabilities to a bitmask
|
|
*
|
|
* This function converts all the capabilities from \link IRC_v3_Caps \endlink to a bitmask
|
|
* \param[in] caps String of capabilities separated by space
|
|
* \sa CAPBIT
|
|
* \sa caps
|
|
* \sa https://ircv3.net/registry#capabilities
|
|
*/
|
|
signed int Tok_CAPS(char* caps);
|
|
#endif /* UIRC_HELPERS */
|
|
|
|
/*!
|
|
* \brief String representations of IRCv3 capabilities
|
|
*
|
|
* This contains the capabilities from \link caps \endlink in their string form.
|
|
* \sa https://ircv3.net/registry#capabilities
|
|
*/
|
|
extern const char* const IRC_v3_Caps[];
|
|
|
|
#endif /* UIRC_GUARD_CAPABILITIES */
|
|
|