|
void | discord_timers_init (struct discord_timers *timers, struct io_poller *io) |
| Prepare timers for usage. More...
|
|
void | discord_timers_cleanup (struct discord *client, struct discord_timers *timers) |
| Cleanup timers and call cancel any running ones. More...
|
|
int64_t | discord_timers_get_next_trigger (struct discord_timers *const timers[], size_t n, int64_t now, int64_t max_time) |
| Get earliest trigger time from a group of timers. More...
|
|
void | discord_timers_run (struct discord *client, struct discord_timers *timers) |
| Run all timers that are due. More...
|
|
unsigned | _discord_timer_ctl (struct discord *client, struct discord_timers *timers, struct discord_timer *timer) |
| Modifies or creates a timer. More...
|
|
unsigned | discord_internal_timer_ctl (struct discord *client, struct discord_timer *timer) |
| Modifies or creates a timer. More...
|
|
unsigned | discord_internal_timer (struct discord *client, discord_ev_timer on_tick_cb, discord_ev_timer on_status_changed_cb, void *data, int64_t delay) |
| Creates a one shot timer that automatically deletes itself upon completion. More...
|
|
void | discord_ratelimiter_init (struct discord_ratelimiter *rl, struct logconf *conf) |
| Initialize ratelimiter handle. More...
|
|
void | discord_ratelimiter_cleanup (struct discord_ratelimiter *rl) |
| Cleanup all buckets that have been discovered. More...
|
|
void | discord_ratelimiter_build_key (enum http_method method, char key[256], const char endpoint_fmt[], va_list args) |
| Build unique key formed from the HTTP method and endpoint. More...
|
|
void | discord_ratelimiter_build (struct discord_ratelimiter *rl, struct discord_bucket *bucket, const char key[], struct ua_info *info) |
| Update the bucket with response header data. More...
|
|
void | discord_ratelimiter_set_global_timeout (struct discord_ratelimiter *rl, struct discord_bucket *bucket, u64unix_ms wait_ms) |
| Update global ratelimiting value. More...
|
|
void | discord_bucket_set_timeout (struct discord_bucket *bucket, u64unix_ms wait_ms) |
| Set bucket timeout. More...
|
|
struct discord_bucket * | discord_bucket_get (struct discord_ratelimiter *rl, const char key[]) |
| Get a struct discord_bucket assigned to key More...
|
|
void | discord_bucket_insert (struct discord_ratelimiter *rl, struct discord_bucket *b, struct discord_request *req, bool high_priority) |
| Insert into bucket's next requests queue. More...
|
|
void | discord_bucket_request_selector (struct discord_ratelimiter *rl, void *data, void(*iter)(void *data, struct discord_request *req)) |
| Iterate and select next requests. More...
|
|
void | discord_bucket_request_unselect (struct discord_ratelimiter *rl, struct discord_bucket *b, struct discord_request *req) |
| Unselect a request provided at discord_ratelimiter_request_selector() More...
|
|
void | discord_requestor_init (struct discord_requestor *rqtor, struct logconf *conf, const char token[]) |
| Initialize the request handler. More...
|
|
void | discord_requestor_cleanup (struct discord_requestor *rqtor) |
| Free the request handler. More...
|
|
CCORDcode | discord_requestor_start_pending (struct discord_requestor *rqtor) |
| Check for and start pending bucket's requests. More...
|
|
CCORDcode | discord_requestor_info_read (struct discord_requestor *rqtor) |
| Poll for request's completion. More...
|
|
void | discord_requestor_dispatch_responses (struct discord_requestor *rqtor) |
| Run pending callbacks from completed requests. More...
|
|
void | discord_request_cancel (struct discord_requestor *rqtor, struct discord_request *req) |
| Mark request as canceled and move it to the recycling queue. More...
|
|
CCORDcode | discord_request_begin (struct discord_requestor *rqtor, struct discord_attributes *req, struct ccord_szbuf *body, enum http_method method, char endpoint[512], char key[256]) |
| Begin a new request. More...
|
|
void | discord_rest_init (struct discord_rest *rest, struct logconf *conf, const char token[]) |
| Initialize an REST handle. More...
|
|
void | discord_rest_cleanup (struct discord_rest *rest) |
| Free an REST handle. More...
|
|
CCORDcode | discord_rest_run (struct discord_rest *rest, struct discord_attributes *req, struct ccord_szbuf *body, enum http_method method, char endpoint_fmt[],...) PRINTF_LIKE(5 |
| Perform a request to Discord. More...
|
|
CCORDcode void | discord_rest_stop_buckets (struct discord_rest *rest) |
| Stop all bucket's on-going, pending and timed-out requests. More...
|
|
void | discord_gateway_init (struct discord_gateway *gw, struct logconf *conf, const char token[]) |
| Initialize a Gateway handle. More...
|
|
void | discord_gateway_cleanup (struct discord_gateway *gw) |
| Free a Gateway handle. More...
|
|
CCORDcode | discord_gateway_start (struct discord_gateway *gw) |
| Initialize handle with the new session primitives. More...
|
|
bool | discord_gateway_end (struct discord_gateway *gw) |
| Cleanup and reset gw session primitives. More...
|
|
CCORDcode | discord_gateway_perform (struct discord_gateway *gw) |
| Check and manage on-going Gateway session. More...
|
|
void | discord_gateway_shutdown (struct discord_gateway *gw) |
| Gracefully shutdown a ongoing Discord connection over WebSockets. More...
|
|
void | discord_gateway_reconnect (struct discord_gateway *gw, bool resume) |
| Gracefully reconnect a ongoing Discord connection over WebSockets. More...
|
|
void | discord_gateway_send_identify (struct discord_gateway *gw, struct discord_identify *event) |
| Trigger the initial handshake with the gateway. More...
|
|
void | discord_gateway_send_resume (struct discord_gateway *gw, struct discord_resume *event) |
| Replay missed events when a disconnected client resumes. More...
|
|
void | discord_gateway_send_heartbeat (struct discord_gateway *gw, int seq) |
| Maintain an active gateway connection. More...
|
|
void | discord_gateway_send_request_guild_members (struct discord_gateway *gw, struct discord_request_guild_members *event) |
| Request all members for a guild or a list of guilds. More...
|
|
void | discord_gateway_send_update_voice_state (struct discord_gateway *gw, struct discord_update_voice_state *event) |
| Sent when a client wants to join, move or disconnect from a voice channel. More...
|
|
void | discord_gateway_send_presence_update (struct discord_gateway *gw, struct discord_presence_update *event) |
| Send client's presence status update payload. More...
|
|
void | discord_gateway_dispatch (struct discord_gateway *gw) |
| Dispatch user callback matched to event. More...
|
|
void | discord_refcounter_init (struct discord_refcounter *rc, struct logconf *conf) |
| Initialize reference counter handle. More...
|
|
void | discord_refcounter_add_internal (struct discord_refcounter *rc, void *data, void(*cleanup)(void *data), bool should_free) |
| Add a new internal reference to the reference counter. More...
|
|
void | discord_refcounter_add_client (struct discord_refcounter *rc, void *data, void(*cleanup)(struct discord *client, void *data), bool should_free) |
| Add a new client reference to the reference counter. More...
|
|
void | discord_refcounter_cleanup (struct discord_refcounter *rc) |
| Cleanup refcounter and all user data currently held. More...
|
|
CCORDcode | discord_refcounter_claim (struct discord_refcounter *rc, const void *data) |
| Claim ownership of data More...
|
|
CCORDcode | discord_refcounter_unclaim (struct discord_refcounter *rc, void *data) |
| Unclaim ownership of data More...
|
|
CCORDcode | discord_refcounter_incr (struct discord_refcounter *rc, void *data) |
| Increment the reference counter for ret->data More...
|
|
CCORDcode | discord_refcounter_decr (struct discord_refcounter *rc, void *data) |
| Decrement the reference counter for data More...
|
|
void | discord_message_commands_init (struct discord_message_commands *cmds, struct logconf *conf) |
| Initialize a Message Commands handle. More...
|
|
void | discord_message_commands_cleanup (struct discord_message_commands *cmds) |
| Free a Message Commands handle. More...
|
|
discord_ev_message | discord_message_commands_find (struct discord_message_commands *cmds, const char command[], size_t length) |
| Search for a callback matching the command. More...
|
|
void | discord_message_commands_append (struct discord_message_commands *cmds, const char command[], size_t length, discord_ev_message callback) |
| Add a new command/callback pair, or update an existing command. More...
|
|
void | discord_message_commands_set_prefix (struct discord_message_commands *cmds, const char prefix[], size_t length) |
| Set a mandatory prefix before commands. More...
|
|
bool | discord_message_commands_try_perform (struct discord_message_commands *cmds, struct discord_gateway_payload *payload) |
| Read the current DISCORD_EV_MESSAGE_CREATE payload and attempt to perform its matching callback. More...
|
|
Internal functions and datatypes.
- Author
- Cogmasters