8#ifndef DISCORD_RESPONSE_H
9#define DISCORD_RESPONSE_H
34#define DISCORD_RET_DEFAULT_FIELDS \
39 void (*cleanup)(struct discord * client, void *data); \
46 void (*fail)(struct discord * client, struct discord_response * resp)
48#define DISCORD_RETURN(_type) \
50 struct discord_ret_##_type { \
51 DISCORD_RET_DEFAULT_FIELDS; \
53 void (*done)(struct discord * client, \
54 struct discord_response *resp, \
55 const struct discord_##_type *ret); \
60 struct discord_##_type *sync; \
73#define DISCORD_SYNC_FLAG ((void *)-1)
#define DISCORD_RETURN(_type)
Definition: discord-response.h:46
#define DISCORD_RET_DEFAULT_FIELDS
Macro containing common fields for struct discord_ret* datatypes.
Definition: discord-response.h:34
int CCORDcode
Concord error codes.
Definition: concord-error.h:11
Read-only generic sized buffer.
Definition: types.h:57
The response for the completed request.
Definition: discord-response.h:12
const void * keep
Definition: discord-response.h:16
void * data
Definition: discord-response.h:14
CCORDcode code
Definition: discord-response.h:18
struct ccord_szbuf_readonly json
Definition: discord-response.h:23
Request's return context.
Definition: discord-response.h:59
bool sync
Definition: discord-response.h:64
void(* done)(struct discord *client, struct discord_response *resp)
Definition: discord-response.h:62
The Discord client handler.
Definition: discord-internal.h:1206