Skip to content

Commit

Permalink
docs(discord-caching): add doxygen group
Browse files Browse the repository at this point in the history
Add doxygen group, make comments consistent to other headers
  • Loading branch information
lcsmuller committed Oct 15, 2022
1 parent 1b77780 commit 660cdac
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions include/discord-cache.h
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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 */

0 comments on commit 660cdac

Please sign in to comment.