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-07-07 21:17:28 +00:00
|
|
|
#include <stdbool.h>
|
2020-07-22 16:57:59 +00:00
|
|
|
#ifndef _UIRC_INCLUDED_TYPES
|
|
|
|
#define _UIRC_INCLUDED_TYPES
|
2020-07-11 21:52:50 +00:00
|
|
|
|
|
|
|
#ifdef UIRC_IRCV3
|
2020-07-22 16:57:59 +00:00
|
|
|
typedef struct {
|
2020-07-12 14:32:54 +00:00
|
|
|
char* value; /* if present, it isn't NULL and if it has no value, it is "" (aka '\0') */
|
2020-07-04 15:43:30 +00:00
|
|
|
bool clientbound;
|
|
|
|
} IRC_Tag;
|
2020-07-11 21:52:50 +00:00
|
|
|
#endif
|
2020-07-22 16:57:59 +00:00
|
|
|
|
|
|
|
typedef struct {
|
2020-07-12 14:32:54 +00:00
|
|
|
char* nick;
|
|
|
|
char* user;
|
|
|
|
char* host;
|
|
|
|
char* orig;
|
|
|
|
char* real;
|
2020-07-04 15:43:30 +00:00
|
|
|
} IRC_User;
|
2020-07-07 21:17:28 +00:00
|
|
|
/* This is how a full user source would look like
|
|
|
|
* NOTE: 'real (Real name)' may only be used in special contexts other than communication.
|
|
|
|
* nick!user%orig@host */
|
2020-07-22 16:57:59 +00:00
|
|
|
|
2020-07-11 21:52:50 +00:00
|
|
|
#ifdef UIRC_IRCV3
|
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 */
|
|
|
|
IRC_Tag account;
|
|
|
|
IRC_Tag batch;
|
|
|
|
IRC_Tag label;
|
|
|
|
IRC_Tag msgid;
|
|
|
|
IRC_Tag multiline_concat;
|
|
|
|
IRC_Tag time;
|
|
|
|
IRC_Tag typing;
|
|
|
|
IRC_Tag react;
|
|
|
|
IRC_Tag reply;
|
|
|
|
} IRC_Tags;
|
2020-07-11 21:52:50 +00:00
|
|
|
#endif
|
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-07-11 21:52:50 +00:00
|
|
|
#endif
|
2020-07-04 15:43:30 +00:00
|
|
|
IRC_User name;
|
|
|
|
signed short cmd;
|
2020-07-12 14:32:54 +00:00
|
|
|
char* args[15]; /* 0-13 + NULL */
|
|
|
|
char* trailing;
|
2020-07-04 15:43:30 +00:00
|
|
|
} IRC_Message;
|
|
|
|
#endif
|