This repository has been archived on 2021-04-17. You can view files and clone it, but cannot push or open issues or pull requests.
uIRC/include/types.h

56 lines
1.7 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/>.
*/
#include <stdbool.h>
#ifndef UIRC_GUARD_TYPES
#define UIRC_GUARD_TYPES
#ifdef UIRC_IRCV3
typedef struct {
char* value; /* if present, it isn't NULL and if it has no value, it is "" (aka '\0') */
bool clientbound;
} IRC_Tag;
typedef struct {
/* See https://ircv3.net/registry#tags for more information */
IRC_Tag account, batch, label, msgid, multiline_concat, time, typing, react, reply;
} IRC_Tags;
#endif /* UIRC_IRCV3 */
typedef struct {
char* nick, *user, *host, *orig, *real;
} IRC_User;
/* 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 */
typedef unsigned short IRC_Command;
typedef struct {
#ifdef UIRC_IRCV3
IRC_Tags tags;
#endif /* UIRC_IRCV3 */
IRC_User name;
char* args[16]; /* 0-13 + trailing + NULL */
bool trailing; /* Tells if the last argument is trailing */
IRC_Command cmd;
} IRC_Message;
#endif /* UIRC_GUARD_TYPES */