2020-07-17 13:49:59 +00:00
|
|
|
/*
|
|
|
|
* 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/>.
|
2020-10-10 10:30:05 +00:00
|
|
|
*/
|
2020-09-26 21:22:05 +00:00
|
|
|
|
2020-07-07 21:17:28 +00:00
|
|
|
#include <stdbool.h>
|
2021-01-02 22:20:06 +00:00
|
|
|
|
2020-12-16 14:22:25 +00:00
|
|
|
#ifndef UIRC_GUARD_TYPES
|
|
|
|
#define UIRC_GUARD_TYPES
|
2020-07-11 21:52:50 +00:00
|
|
|
|
2021-01-03 23:34:57 +00:00
|
|
|
/*!
|
|
|
|
*/
|
2021-01-02 22:20:06 +00:00
|
|
|
typedef unsigned short IRC_Command;
|
|
|
|
|
2020-07-11 21:52:50 +00:00
|
|
|
#ifdef UIRC_IRCV3
|
2020-07-22 16:57:59 +00:00
|
|
|
typedef struct {
|
2021-01-02 22:20:06 +00:00
|
|
|
char* value; /* if present, it isn't NULL and if it has no value, it is "" */
|
2020-12-16 14:22:25 +00:00
|
|
|
bool clientbound;
|
2020-07-04 15:43:30 +00:00
|
|
|
} IRC_Tag;
|
2020-07-22 16:57:59 +00:00
|
|
|
typedef struct {
|
2020-07-07 21:17:28 +00:00
|
|
|
/* See https://ircv3.net/registry#tags for more information */
|
2020-12-16 14:22:25 +00:00
|
|
|
IRC_Tag account, batch, label, msgid, multiline_concat, time, typing, react, reply;
|
2020-07-07 21:17:28 +00:00
|
|
|
} IRC_Tags;
|
2020-12-16 14:22:25 +00:00
|
|
|
#endif /* UIRC_IRCV3 */
|
2020-07-22 16:57:59 +00:00
|
|
|
|
2020-09-26 21:22:05 +00:00
|
|
|
typedef struct {
|
2021-01-02 22:20:06 +00:00
|
|
|
char *nick, *user, *host, *orig, *real;
|
2020-09-26 21:22:05 +00:00
|
|
|
} IRC_User;
|
2020-07-22 16:57:59 +00:00
|
|
|
typedef struct {
|
2020-07-11 21:52:50 +00:00
|
|
|
#ifdef UIRC_IRCV3
|
2020-07-07 21:17:28 +00:00
|
|
|
IRC_Tags tags;
|
2020-12-16 14:22:25 +00:00
|
|
|
#endif /* UIRC_IRCV3 */
|
|
|
|
IRC_User name;
|
|
|
|
char* args[16]; /* 0-13 + trailing + NULL */
|
|
|
|
bool trailing; /* Tells if the last argument is trailing */
|
2020-09-26 21:22:05 +00:00
|
|
|
IRC_Command cmd;
|
2020-07-04 15:43:30 +00:00
|
|
|
} IRC_Message;
|
2020-12-16 14:22:25 +00:00
|
|
|
|
|
|
|
#endif /* UIRC_GUARD_TYPES */
|
2020-09-26 21:22:05 +00:00
|
|
|
|