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

65 lines
1.6 KiB
C
Raw Normal View History

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/>.
*/
#include <stdbool.h>
2020-07-22 16:57:59 +00:00
#ifndef _UIRC_INCLUDED_TYPES
#define _UIRC_INCLUDED_TYPES
#ifdef UIRC_IRCV3
2020-07-22 16:57:59 +00:00
typedef struct {
char* value; /* if present, it isn't NULL and if it has no value, it is "" (aka '\0') */
bool clientbound;
} IRC_Tag;
#endif
2020-07-22 16:57:59 +00:00
typedef struct {
char* nick;
char* user;
char* host;
char* orig;
char* 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 */
2020-07-22 16:57:59 +00:00
#ifdef UIRC_IRCV3
2020-07-22 16:57:59 +00:00
typedef struct {
/* 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;
#endif
2020-07-22 16:57:59 +00:00
typedef struct {
#ifdef UIRC_IRCV3
IRC_Tags tags;
#endif
IRC_User name;
signed short cmd;
char* args[15]; /* 0-13 + NULL */
char* trailing;
} IRC_Message;
#endif