Concord - C Discord API library
A Discord API wrapper library written in C
emoji.h
Go to the documentation of this file.
1
6#ifndef API_EMOJI_H
7#define API_EMOJI_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 * Emoji Datatypes
21 * **************************************************************************/
27 char * name;
30 struct snowflakes * roles;
31
35
39 bool managed;
45};
47struct discord_emojis { int size;
48 struct discord_emoji *array; int realsize; };
50/*****************************************************************************
51 * Emoji REST parameters
52 * **************************************************************************/
56 char * reason;
58 char * name;
59 /* TODO: implement base64 encoding */
61 char * image;
64 struct snowflakes * roles;
65
66};
70 char * reason;
72 char * name;
73 /* TODO: implement base64 encoding */
75 char * image;
78 struct snowflakes * roles;
79
80};
83 char * reason;
84};
85#include <stddef.h>
86#include <stdbool.h>
87#define JSMN_STRICT
88#define JSMN_HEADER
89#include "jsmn.h"
90#include "jsmn-find.h"
91#define JSONB_HEADER
92#include "json-build.h"
93#include <inttypes.h>
94#include "carray.h"
95#include "cog-utils.h"
96#include "types.h"
98
99
100
101
102
103
104
105
106
107
108
109
110
112
113
115
116
117
118
119
120
121
123
124
125
126
127
128
129
130
131
132
133long discord_emoji_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_emoji *self); size_t discord_emoji_from_json(const char buf[], size_t size, struct discord_emoji *self);
134
135
136
137
138
139
140
141
142
143
144
145
146
147long discord_emojis_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_emojis *self); size_t discord_emojis_from_json(const char buf[], size_t size, struct discord_emojis *self);
148
149
150long discord_create_guild_emoji_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_create_guild_emoji *self); size_t discord_create_guild_emoji_from_json(const char buf[], size_t size, struct discord_create_guild_emoji *self);
151
152
153
154
155
156
157long discord_modify_guild_emoji_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_modify_guild_emoji *self); size_t discord_modify_guild_emoji_from_json(const char buf[], size_t size, struct discord_modify_guild_emoji *self);
158
159
160
161
162
163
164jsonbcode discord_emoji_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_emoji *self); size_t discord_emoji_to_json(char buf[], size_t size, const struct discord_emoji *self);
165
166
167
168
169
170
171
172
173
174
175
176
177
178jsonbcode discord_emojis_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_emojis *self); size_t discord_emojis_to_json(char buf[], size_t size, const struct discord_emojis *self);
179
180
181jsonbcode discord_create_guild_emoji_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_create_guild_emoji *self); size_t discord_create_guild_emoji_to_json(char buf[], size_t size, const struct discord_create_guild_emoji *self);
182
183
184
185
186
187
188jsonbcode discord_modify_guild_emoji_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_modify_guild_emoji *self); size_t discord_modify_guild_emoji_to_json(char buf[], size_t size, const struct discord_modify_guild_emoji *self);
189
190
191
192
193
194
195#endif /* API_EMOJI_H */
size_t discord_emoji_from_json(const char buf[], size_t size, struct discord_emoji *self)
void discord_modify_guild_emoji_init(struct discord_modify_guild_emoji *self)
void discord_create_guild_emoji_cleanup(struct discord_create_guild_emoji *self)
size_t discord_modify_guild_emoji_to_json(char buf[], size_t size, const struct discord_modify_guild_emoji *self)
size_t discord_emojis_from_json(const char buf[], size_t size, struct discord_emojis *self)
jsonbcode discord_create_guild_emoji_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_create_guild_emoji *self)
size_t discord_emoji_to_json(char buf[], size_t size, const struct discord_emoji *self)
long discord_emojis_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_emojis *self)
size_t discord_create_guild_emoji_from_json(const char buf[], size_t size, struct discord_create_guild_emoji *self)
void discord_emoji_cleanup(struct discord_emoji *self)
jsonbcode discord_modify_guild_emoji_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_modify_guild_emoji *self)
void discord_emojis_cleanup(struct discord_emojis *self)
void discord_emoji_init(struct discord_emoji *self)
void discord_modify_guild_emoji_cleanup(struct discord_modify_guild_emoji *self)
jsonbcode discord_emoji_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_emoji *self)
size_t discord_emojis_to_json(char buf[], size_t size, const struct discord_emojis *self)
void discord_create_guild_emoji_init(struct discord_create_guild_emoji *self)
jsonbcode discord_emojis_to_jsonb(jsonb *b, char buf[], size_t size, const struct discord_emojis *self)
size_t discord_create_guild_emoji_to_json(char buf[], size_t size, const struct discord_create_guild_emoji *self)
long discord_emoji_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_emoji *self)
long discord_modify_guild_emoji_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_modify_guild_emoji *self)
size_t discord_modify_guild_emoji_from_json(const char buf[], size_t size, struct discord_modify_guild_emoji *self)
long discord_create_guild_emoji_from_jsmnf(jsmnf_pair *root, const char *js, struct discord_create_guild_emoji *self)
uint64_t u64snowflake
Snowflake datatype.
Definition: types.h:28
jsonbcode
json-builder return codes
Definition: json-build.h:34
Definition: emoji.h:54
char * image
Definition: emoji.h:61
struct snowflakes * roles
Definition: emoji.h:64
char * reason
Definition: emoji.h:56
char * name
Definition: emoji.h:58
Definition: emoji.h:81
char * reason
Definition: emoji.h:83
Definition: emoji.h:23
struct discord_user * user
Definition: emoji.h:34
u64snowflake id
Definition: emoji.h:25
char * name
Definition: emoji.h:27
struct snowflakes * roles
Definition: emoji.h:30
bool managed
Definition: emoji.h:39
bool require_colons
Definition: emoji.h:37
bool available
Definition: emoji.h:44
bool animated
Definition: emoji.h:41
Definition: emoji.h:47
struct discord_emoji * array
Definition: emoji.h:48
int size
Definition: emoji.h:47
Definition: emoji.h:68
struct snowflakes * roles
Definition: emoji.h:78
char * reason
Definition: emoji.h:70
char * image
Definition: emoji.h:75
char * name
Definition: emoji.h:72
Definition: user.h:69
Handle for building a JSON string.
Definition: json-build.h:61
Definition: custom.h:28