2021-01-03 23:34:57 +00:00
|
|
|
/*
|
|
|
|
* This file is part of uIRC. (https://git.redxen.eu/caskd/uIRC)
|
2021-03-11 22:52:30 +00:00
|
|
|
* Copyright (c) 2019-2021 Alex-David Denes
|
2021-01-03 23:34:57 +00:00
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2021-01-23 15:07:55 +00:00
|
|
|
/*! \file */
|
|
|
|
|
2021-02-22 17:09:41 +00:00
|
|
|
#include "types.h" // IRC_User
|
2021-01-03 23:34:57 +00:00
|
|
|
|
2021-02-15 11:39:25 +00:00
|
|
|
#include <corelibs/llist.h> // llist_t
|
|
|
|
#include <stdbool.h> // bool
|
2021-01-03 23:34:57 +00:00
|
|
|
|
2021-02-15 11:39:25 +00:00
|
|
|
#ifndef UIRC_GUARD_PUBLIC_TOKENIZERS
|
|
|
|
#define UIRC_GUARD_PUBLIC_TOKENIZERS
|
2021-01-03 23:34:57 +00:00
|
|
|
|
2021-02-15 11:39:25 +00:00
|
|
|
#ifdef UIRC_FEATURE_IRCV3
|
2021-01-03 23:34:57 +00:00
|
|
|
/*!
|
|
|
|
* \brief Tokenize IRCv3 tags
|
|
|
|
*
|
|
|
|
* This function parses IRCv3 tags according to the specification at
|
|
|
|
* \param[in] str String containing a IRC source with or without the ':' prefix
|
|
|
|
*/
|
2021-02-15 15:57:29 +00:00
|
|
|
llist_t* uirc_tokenizer_tag_list(const char* str);
|
|
|
|
IRC_Tag* uirc_tokenizer_tag(const char* str);
|
2021-02-15 11:39:25 +00:00
|
|
|
#endif /* UIRC_FEATURE_IRCV3 */
|
2021-01-03 23:34:57 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Tokenize a IRC message source.
|
|
|
|
*
|
|
|
|
* This function takes the source part of a message, pointing struct elements to parts of it.
|
2021-01-23 15:07:55 +00:00
|
|
|
* \param[in] str String containing a IRC source with or without the ':' prefix
|
2021-01-03 23:34:57 +00:00
|
|
|
*/
|
2021-02-15 11:39:25 +00:00
|
|
|
IRC_User* uirc_tokenizer_user(const char* str);
|
2021-01-03 23:34:57 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Tokenize a IRC message string.
|
|
|
|
*
|
|
|
|
* This function takes a IRC Message and attempts to tokenize/parse it, pointing every element found to it's respective struct element
|
2021-01-23 15:07:55 +00:00
|
|
|
* \param[in] str String containing a IRC message without the ending '\\r\\n'
|
2021-01-03 23:34:57 +00:00
|
|
|
*/
|
2021-02-15 11:39:25 +00:00
|
|
|
IRC_Message* uirc_tokenizer_message(const char* str);
|
2021-01-03 23:34:57 +00:00
|
|
|
|
2021-02-15 11:39:25 +00:00
|
|
|
#endif /* UIRC_GUARD_PUBLIC_TOKENIZERS */
|
2021-01-03 23:34:57 +00:00
|
|
|
|