80 lines
2.3 KiB
C
80 lines
2.3 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/>.
|
|
*/
|
|
|
|
#ifndef UIRC_GUARD_CAPABILITIES
|
|
#define UIRC_GUARD_CAPABILITIES
|
|
|
|
/*!
|
|
* \brief List of capabilities to be used as a bitmask
|
|
*
|
|
* \sa CAPBIT
|
|
* \sa https://ircv3.net/registry#capabilities
|
|
*/
|
|
enum caps {
|
|
CAP_ACCOUNT_NOTIFY = 1,
|
|
CAP_ACCOUNT_TAG = 2,
|
|
CAP_AWAY_NOTIFY = 3,
|
|
CAP_BATCH = 4,
|
|
CAP_CAP_NOTIFY = 5,
|
|
CAP_CHANNEL_RENAME = 6,
|
|
CAP_CHGHOST = 7,
|
|
CAP_ECHO_MESSAGE = 8,
|
|
CAP_EXTENDED_JOIN = 9,
|
|
CAP_INVITE_NOTIFY = 10,
|
|
CAP_LABELED_RESPONSE = 11,
|
|
CAP_MESSAGE_TAGS = 12,
|
|
CAP_MONITOR = 13,
|
|
CAP_MULTI_PREFIX = 14,
|
|
CAP_MULTILINE = 15,
|
|
CAP_SASL = 16,
|
|
CAP_SERVER_TIME = 17,
|
|
CAP_SETNAME = 18,
|
|
CAP_TLS = 19,
|
|
CAP_USERHOST_IN_NAMES = 20,
|
|
};
|
|
/*!
|
|
* \brief Converts capability to bitmask value
|
|
*
|
|
* \param[in] cap Capability bit from \link caps \endlink
|
|
*/
|
|
#define CAPBIT(cap) (1 << (cap))
|
|
|
|
#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 */
|
|
|