Generic macros for initializing a discord_attributes.
More...
Go to the source code of this file.
Generic macros for initializing a discord_attributes.
- Author
- Cogmasters
◆ _RET_COPY_TYPED
| #define _RET_COPY_TYPED |
( |
|
_dest, |
|
|
|
_src |
|
) |
| |
Value: do { \
(_dest).has_type = true; \
(_dest).sync = (_src).sync; \
} while (0)
void(* cast_done_typed)(struct discord *, struct discord_response *, const void *)
Definition: discord-request.h:12
Definition: discord-request.h:20
◆ _RET_COPY_TYPELESS
| #define _RET_COPY_TYPELESS |
( |
|
_dest, |
|
|
|
_src |
|
) |
| |
Value: do { \
(_dest).has_type = false; \
(_dest).done.typeless = (_src).done; \
(_dest).sync = (void *)(_src).sync; \
} while (0)
◆ DISCORD_ATTR_INIT
| #define DISCORD_ATTR_INIT |
( |
|
_attr, |
|
|
|
_type, |
|
|
|
_ret, |
|
|
|
_reason |
|
) |
| |
Value: do { \
(_attr).response.size = sizeof(struct _type); \
(_attr).response.init = (
cast_init)reflectc_from_##_type; \
(_attr).reason = _reason; \
} while (0)
struct reflectc_wrap *(* cast_init)(struct reflectc *, void *, struct reflectc_wrap *)
Definition: discord-request.h:15
#define _RET_COPY_TYPED(_dest, _src)
Definition: discord-request.h:24
Helper for setting attributes for a specs-generated return struct.
- Parameters
-
| [out] | _attr | discord_attributes handler to be initialized |
| [in] | _type | datatype of the struct |
| [in] | _ret | dispatch attributes |
| [in] | _reason | reason for request (if available) |
◆ DISCORD_ATTR_BLANK_INIT
| #define DISCORD_ATTR_BLANK_INIT |
( |
|
_attr, |
|
|
|
_ret, |
|
|
|
_reason |
|
) |
| |
Value: do { \
(_attr).reason = _reason; \
} while (0)
#define _RET_COPY_TYPELESS(_dest, _src)
Definition: discord-request.h:32
Helper for setting attributes for attributes that don't have a response object.
- Parameters
-
| [out] | _attr | discord_attributes handler to be initialized |
| [in] | _ret | dispatch attributes |
| [in] | _reason | reason for request (if available) |
◆ DISCORD_ATTACHMENTS_IDS_INIT
| #define DISCORD_ATTACHMENTS_IDS_INIT |
( |
|
_attchs | ) |
|
Value: do { \
for (int i = 0; i < (_attchs)->size; ++i) { \
} \
} while (0)
uint64_t u64snowflake
Snowflake datatype.
Definition: types.h:28
Helper for initializing attachments ids.
- Parameters
-
| [in,out] | attchs | a discord_attachments to have its IDs initialized |
◆ cast_done_typed
◆ cast_init
| typedef struct reflectc_wrap *(* cast_init) (struct reflectc *, void *, struct reflectc_wrap *) |