From 660cdace5cb444b3695ba6f9cf96de98aff1cd17 Mon Sep 17 00:00:00 2001 From: lcsmuller Date: Mon, 3 Oct 2022 13:57:57 -0300 Subject: [PATCH] docs(discord-caching): add doxygen group Add doxygen group, make comments consistent to other headers --- include/discord-cache.h | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/include/discord-cache.h b/include/discord-cache.h index d8b6b950a..d0f32887f 100644 --- a/include/discord-cache.h +++ b/include/discord-cache.h @@ -1,6 +1,17 @@ +/** + * @file discord-cache.h + * @author Cogmasters + * @brief Caching of Discord resources + */ + #ifndef DISCORD_CACHE_H #define DISCORD_CACHE_H +/** @defgroup DiscordClientCache Caching + * @ingroup DiscordClient + * @brief Caching API supported by Concord + * @{ */ + enum discord_cache_options { DISCORD_CACHE_MESSAGES = 1 << 0, DISCORD_CACHE_GUILDS = 1 << 1, @@ -10,26 +21,31 @@ void discord_cache_enable(struct discord *client, enum discord_cache_options options); /** - * @brief get a message from cache, only if locally available in RAM - * @note you must call discord_unclaim(client, message) when done - * + * @brief Get a message from cache, only if locally available in RAM + * @note When done, discord_unclaim() must be called on the message resource + * * @param client the client initialized with discord_init() * @param channel_id the channel id the message is in * @param message_id the id of the message - * @return NULL if not found, or the message from the cache + * @return `NULL` if not found, or a cache'd message */ const struct discord_message *discord_cache_get_channel_message( struct discord *client, u64snowflake channel_id, u64snowflake message_id); /** - * @brief get a guild from cache, only if locally available in RAM - * @note you must call discord_unclaim(client, guild) when done - * + * @brief Get a guild from cache, only if locally available in RAM + * @note When done, discord_unclaim() must be called on the guild resource + * * @param client the client initialized with discord_init() * @param guild_id the id of the guild - * @return NULL if not found, or the guild from the cache + * @return `NULL` if not found, or a cache'd guild */ -const struct discord_guild *discord_cache_get_guild( - struct discord *client, u64snowflake guild_id); +const struct discord_guild *discord_cache_get_guild(struct discord *client, + u64snowflake guild_id); + +/** @example cache.c + * Demonstrates cache usage */ + +/** @} DiscordClientCache */ -#endif // !DISCORD_CACHE_H +#endif /* DISCORD_CACHE_H */