Concord - C Discord API library
A Discord API wrapper library written in C
voice.h
Go to the documentation of this file.
1
6#ifndef API_VOICE_H
7#define API_VOICE_H
8/* Allow symbols usage without GENCODECS_ prefix */
9#include <stddef.h>
10#include <stdbool.h>
11#include <inttypes.h>
12#include "carray.h"
13#include "cog-utils.h"
14#include "types.h"
15/* Custom JSON encoding macros */
16/* Custom JSON decoding macros */
17/* Custom field macros */
18/* if GENCODECS_READ is not specified then generate for all files */
19/*****************************************************************************
20 * Voice Datatypes
21 * **************************************************************************/
33 char * session_id;
35 bool deaf;
37 bool mute;
48 /* TODO: nullable */
52
53};
56 struct discord_voice_state *array; int realsize; };
60 char * id;
62 char * name;
64 bool optimal;
68 bool custom;
69};
72 struct discord_voice_region *array; int realsize; };
74#include <stddef.h>
75#include <stdbool.h>
76#define JSMN_STRICT
77#define JSMN_HEADER
78#include "jsmn.h"
79#include "jsmn-find.h"
80#define JSONB_HEADER
81#include "json-build.h"
82#include <inttypes.h>
83#include "carray.h"
84#include "cog-utils.h"
85#include "types.h"
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
104
105
106
107
108
109
110
111
112
114
115
116long discord_voice_state_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_voice_state *self); size_t discord_voice_state_from_json(const char buf[], size_t size, struct discord_voice_state *self);
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133long discord_voice_states_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_voice_states *self); size_t discord_voice_states_from_json(const char buf[], size_t size, struct discord_voice_states *self);
134
135
136
137
138
139
140
141
142
143long discord_voice_regions_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_voice_regions *self); size_t discord_voice_regions_from_json(const char buf[], size_t size, struct discord_voice_regions *self);
144
145
146jsonbcode discord_voice_state_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_voice_state *self); size_t discord_voice_state_to_json(char buf[], size_t size, const struct discord_voice_state *self);
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163jsonbcode discord_voice_states_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_voice_states *self); size_t discord_voice_states_to_json(char buf[], size_t size, const struct discord_voice_states *self);
164
165
166
167
168
169
170
171
172
173jsonbcode discord_voice_regions_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_voice_regions *self); size_t discord_voice_regions_to_json(char buf[], size_t size, const struct discord_voice_regions *self);
174
175
176#endif /* API_VOICE_H */
void discord_voice_states_cleanup(struct discord_voice_states *self)
void discord_voice_regions_cleanup(struct discord_voice_regions *self)
size_t discord_voice_regions_to_json(char buf[], size_t size, const struct discord_voice_regions *self)
size_t discord_voice_states_to_json(char buf[], size_t size, const struct discord_voice_states *self)
size_t discord_voice_states_from_json(const char buf[], size_t size, struct discord_voice_states *self)
void discord_voice_state_init(struct discord_voice_state *self)
size_t discord_voice_regions_from_json(const char buf[], size_t size, struct discord_voice_regions *self)
jsonbcode discord_voice_regions_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_voice_regions *self)
long discord_voice_state_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_voice_state *self)
jsonbcode discord_voice_state_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_voice_state *self)
long discord_voice_states_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_voice_states *self)
size_t discord_voice_state_to_json(char buf[], size_t size, const struct discord_voice_state *self)
jsonbcode discord_voice_states_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_voice_states *self)
void discord_voice_state_cleanup(struct discord_voice_state *self)
long discord_voice_regions_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_voice_regions *self)
size_t discord_voice_state_from_json(const char buf[], size_t size, struct discord_voice_state *self)
uint64_t u64snowflake
Snowflake datatype.
Definition: types.h:28
uint64_t u64unix_ms
Unix time in milliseconds.
Definition: types.h:22
jsonbcode
json-builder return codes
Definition: json-build.h:34
Definition: guild.h:290
Definition: voice.h:58
char * id
Definition: voice.h:60
bool deprecated
Definition: voice.h:66
bool custom
Definition: voice.h:68
char * name
Definition: voice.h:62
bool optimal
Definition: voice.h:64
Definition: voice.h:71
int size
Definition: voice.h:71
struct discord_voice_region * array
Definition: voice.h:72
Definition: voice.h:23
u64snowflake channel_id
Definition: voice.h:27
bool self_deaf
Definition: voice.h:39
bool self_video
Definition: voice.h:45
bool mute
Definition: voice.h:37
bool self_mute
Definition: voice.h:41
u64unix_ms request_to_speak_timestamp
Definition: voice.h:51
bool suppress
Definition: voice.h:47
bool deaf
Definition: voice.h:35
u64snowflake user_id
Definition: voice.h:29
bool self_stream
Definition: voice.h:43
char * session_id
Definition: voice.h:33
struct discord_guild_member * member
Definition: voice.h:31
u64snowflake guild_id
Definition: voice.h:25
Definition: voice.h:55
struct discord_voice_state * array
Definition: voice.h:56
int size
Definition: voice.h:55
Handle for building a JSON string.
Definition: json-build.h:61