diff options
author | Mattias Andrée <m@maandree.se> | 2025-02-10 17:50:58 +0100 |
---|---|---|
committer | Mattias Andrée <m@maandree.se> | 2025-02-10 17:52:46 +0100 |
commit | ec1bcdcd0dd6e196303e8d9a30b3b2740e32c502 (patch) | |
tree | dcc759aaf897c915827659e00644f12503cf1268 /libcoopgamma_get_crtcs_send.c | |
parent | Improve makefile (diff) | |
download | libcoopgamma-ec1bcdcd0dd6e196303e8d9a30b3b2740e32c502.tar.gz libcoopgamma-ec1bcdcd0dd6e196303e8d9a30b3b2740e32c502.tar.bz2 libcoopgamma-ec1bcdcd0dd6e196303e8d9a30b3b2740e32c502.tar.xz |
Minor code improvements and split into multiple c files
Signed-off-by: Mattias Andrée <m@maandree.se>
Diffstat (limited to 'libcoopgamma_get_crtcs_send.c')
-rw-r--r-- | libcoopgamma_get_crtcs_send.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libcoopgamma_get_crtcs_send.c b/libcoopgamma_get_crtcs_send.c new file mode 100644 index 0000000..6c740b7 --- /dev/null +++ b/libcoopgamma_get_crtcs_send.c @@ -0,0 +1,37 @@ +/* See LICENSE file for copyright and license details. */ +#include "common.h" + + +/* Silence falls warning for `memcpy(&msg__[n__], (payload), (payload_size))` + * in `SEND_MESSAGE` where `payload` is assumed to be `NULL` despite being + * inside `if (payload)` */ +#if defined(__GNUC__) +# pragma GCC diagnostic ignored "-Wnonnull" +#endif + + +/** + * List all available CRTC:s, send request part + * + * Cannot be used before connecting to the server + * + * @param ctx The state of the library, must be connected + * @param async Information about the request, that is needed to + * identify and parse the response, is stored here + * @return Zero on success, -1 on error + */ +int +libcoopgamma_get_crtcs_send(libcoopgamma_context_t *restrict ctx, libcoopgamma_async_context_t *restrict async) +{ + async->message_id = ctx->message_id; + SEND_MESSAGE(ctx, NULL, (size_t)0, + "Command: enumerate-crtcs\n" + "Message ID: %" PRIu32 "\n" + "\n", + ctx->message_id); + + return 0; +fail: + copy_errno(ctx); + return -1; +} |