Concord - C Discord API library
A Discord API wrapper library written in C
discord Struct Reference

The Discord client handler. More...

#include <discord-internal.h>

Collaboration diagram for discord:
[legend]

Data Fields

struct logconf conf
 
bool is_original
 
char * token
 
struct io_poller * io_poller
 
struct discord_message_commands commands
 
struct discord_refcounter refcounter
 
struct discord_rest rest
 
struct discord_gateway gw
 
struct discord_user self
 
struct discord_cache cache
 
struct {
   struct discord_timers   internal
 
   struct discord_timers   user
 
timers
 
struct {
   void(*   cb )(struct discord *client)
 
   unsigned   id
 
wakeup_timer
 
void(* on_idle )(struct discord *client)
 
void(* on_cycle )(struct discord *client)
 
void * data
 
struct {
   int   count
 
   pthread_mutex_t   lock
 
   pthread_cond_t   cond
 
} * workers
 

Detailed Description

Field Documentation

◆ conf

struct logconf discord::conf

DISCORD logging module

◆ is_original

bool discord::is_original

whether this is the original client or a clone

◆ token

char* discord::token

the bot token

◆ io_poller

struct io_poller* discord::io_poller

the io poller for listening to file descriptors

◆ commands

struct discord_message_commands discord::commands

the user's message commands

See also
discord_set_on_command()

◆ refcounter

struct discord_refcounter discord::refcounter

user's data reference counter for automatic cleanup

◆ rest

struct discord_rest discord::rest

the handle for interfacing with Discord's REST API

◆ gw

struct discord_gateway discord::gw

the handle for interfacing with Discord's Gateway API

◆ self

struct discord_user discord::self

the client's user structure

◆ cache

struct discord_cache discord::cache

the handle for registering and retrieving Discord data

◆ internal

struct discord_timers discord::internal

◆ user

struct discord_timers discord::user

◆ 

struct { ... } discord::timers

◆ cb

void(* discord::cb) (struct discord *client)

callback to be triggered on timer's timeout

◆ id

unsigned discord::id

the id of the wake timer

◆ 

struct { ... } discord::wakeup_timer

wakeup timer handle

◆ on_idle

void(* discord::on_idle) (struct discord *client)

triggers when idle

◆ on_cycle

void(* discord::on_cycle) (struct discord *client)

triggers once per loop cycle

◆ data

void* discord::data

user arbitrary data

See also
discord_set_data()

◆ count

int discord::count

amount of worker-threads currently being used by client

◆ lock

pthread_mutex_t discord::lock

synchronize count between workers

◆ cond

pthread_cond_t discord::cond

notify of count decrement

◆ 

struct { ... } * discord::workers

keep tab of amount of worker threads being used by client


The documentation for this struct was generated from the following file: