Skip to content

Commit

Permalink
feat(discord-client): add discord_get_io_poller() to allow user to li…
Browse files Browse the repository at this point in the history
…sten for events to their own file descriptors
  • Loading branch information
Anotra committed Mar 13, 2022
1 parent 2397f0a commit a85e7d8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/discord.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "error.h"
#include "types.h"
#include "concord-once.h"
#include "io_poller.h"

#define DISCORD_API_BASE_URL "https://discord.com/api/v9"
#define DISCORD_GATEWAY_URL_SUFFIX "?v=9&encoding=json"
Expand Down Expand Up @@ -265,6 +266,14 @@ uint64_t discord_timestamp(struct discord *client);
*/
struct logconf *discord_get_logconf(struct discord *client);

/**
* @brief get the io_poller used by the discord client
*
* @param client the client created with discord_init()
* @return struct io_poller*
*/
struct io_poller *discord_get_io_poller(struct discord *client);

/** @} Discord */

#endif /* DISCORD_H */
6 changes: 6 additions & 0 deletions src/discord-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -690,3 +690,9 @@ discord_get_logconf(struct discord *client)
{
return &client->conf;
}

struct io_poller *
discord_get_io_poller(struct discord *client)
{
return client->io_poller;
}

0 comments on commit a85e7d8

Please sign in to comment.