Concord - C Discord API library
A Discord API wrapper library written in C
discord-response.h File Reference

Generic macros for initializing a discord_response and return handles. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  discord_response
 The response for the completed request. More...
 
struct  discord_ret
 Request's return context. More...
 
struct  discord_ret_application
 Request's return context. More...
 
struct  discord_ret_auth_response
 Request's return context. More...
 
struct  discord_ret_audit_log
 Request's return context. More...
 
struct  discord_ret_auto_moderation_rule
 Request's return context. More...
 
struct  discord_ret_auto_moderation_rules
 Request's return context. More...
 
struct  discord_ret_channel
 Request's return context. More...
 
struct  discord_ret_channels
 Request's return context. More...
 
struct  discord_ret_message
 Request's return context. More...
 
struct  discord_ret_messages
 Request's return context. More...
 
struct  discord_ret_followed_channel
 Request's return context. More...
 
struct  discord_ret_thread_members
 Request's return context. More...
 
struct  discord_ret_thread_response_body
 Request's return context. More...
 
struct  discord_ret_emoji
 Request's return context. More...
 
struct  discord_ret_emojis
 Request's return context. More...
 
struct  discord_ret_guild
 Request's return context. More...
 
struct  discord_ret_guilds
 Request's return context. More...
 
struct  discord_ret_guild_preview
 Request's return context. More...
 
struct  discord_ret_guild_member
 Request's return context. More...
 
struct  discord_ret_guild_members
 Request's return context. More...
 
struct  discord_ret_guild_widget
 Request's return context. More...
 
struct  discord_ret_guild_widget_settings
 Request's return context. More...
 
struct  discord_ret_ban
 Request's return context. More...
 
struct  discord_ret_bans
 Request's return context. More...
 
struct  discord_ret_role
 Request's return context. More...
 
struct  discord_ret_roles
 Request's return context. More...
 
struct  discord_ret_welcome_screen
 Request's return context. More...
 
struct  discord_ret_integrations
 Request's return context. More...
 
struct  discord_ret_prune_count
 Request's return context. More...
 
struct  discord_ret_guild_scheduled_event
 Request's return context. More...
 
struct  discord_ret_guild_scheduled_events
 Request's return context. More...
 
struct  discord_ret_guild_scheduled_event_users
 Request's return context. More...
 
struct  discord_ret_guild_template
 Request's return context. More...
 
struct  discord_ret_guild_templates
 Request's return context. More...
 
struct  discord_ret_invite
 Request's return context. More...
 
struct  discord_ret_invites
 Request's return context. More...
 
struct  discord_ret_stage_instance
 Request's return context. More...
 
struct  discord_ret_sticker
 Request's return context. More...
 
struct  discord_ret_stickers
 Request's return context. More...
 
struct  discord_ret_list_nitro_sticker_packs
 Request's return context. More...
 
struct  discord_ret_user
 Request's return context. More...
 
struct  discord_ret_users
 Request's return context. More...
 
struct  discord_ret_connections
 Request's return context. More...
 
struct  discord_ret_voice_regions
 Request's return context. More...
 
struct  discord_ret_webhook
 Request's return context. More...
 
struct  discord_ret_webhooks
 Request's return context. More...
 
struct  discord_ret_application_command
 Request's return context. More...
 
struct  discord_ret_application_commands
 Request's return context. More...
 
struct  discord_ret_application_command_permission
 Request's return context. More...
 
struct  discord_ret_application_command_permissions
 Request's return context. More...
 
struct  discord_ret_guild_application_command_permissions
 Request's return context. More...
 
struct  discord_ret_interaction_response
 Request's return context. More...
 

Macros

#define DISCORD_RET_DEFAULT_FIELDS
 Macro containing common fields for struct discord_ret* datatypes. More...
 
#define DISCORD_RETURN(_type)
 
#define DISCORD_SYNC_FLAG   ((void *)-1)
 flag for enabling sync mode without expecting a datatype return More...
 

Detailed Description

Generic macros for initializing a discord_response and return handles.

Author
Cogmasters

Macro Definition Documentation

◆ DISCORD_RET_DEFAULT_FIELDS

#define DISCORD_RET_DEFAULT_FIELDS
Value:
\
void *data; \ \
void (*cleanup)(struct discord * client, void *data); \ \
const void *keep; \ \
bool high_priority; \ \
void (*fail)(struct discord * client, struct discord_response * resp)
The response for the completed request.
Definition: discord-response.h:12
The Discord client handler.
Definition: discord-internal.h:1190
void * data
Definition: discord-internal.h:1236

Macro containing common fields for struct discord_ret* datatypes.

Note
this exists for alignment purposes

◆ DISCORD_RETURN

#define DISCORD_RETURN (   _type)
Value:
\
struct discord_ret_##_type { \
DISCORD_RET_DEFAULT_FIELDS; \ \
void (*done)(struct discord * client, \
struct discord_response *resp, \
const struct discord_##_type *ret); \ \
struct discord_##_type *sync; \
}

◆ DISCORD_SYNC_FLAG

#define DISCORD_SYNC_FLAG   ((void *)-1)

flag for enabling sync mode without expecting a datatype return

Examples
manual-dm.c, and webhook.c.