my_teams
logger_error.h
Go to the documentation of this file.
1 /*
2 ** EPITECH PROJECT, 2024
3 ** teams [WSL: Arch]
4 ** File description:
5 ** logger_error
6 */
7 
8 #ifndef LOGGER_ERROR_H_
9  #define LOGGER_ERROR_H_
10 
11  #include "protocol.h"
12  #include "client.h"
13  #include "logging_client.h"
14  #include "events_structures.h"
15  #include "unused.h"
16 
17  #include <string.h>
18 
19 static inline void mt_error_unknown_team(const p_packet_t *payload,
21 {
22  team_uuid_t team_uuid = {0};
23 
24  memcpy(&team_uuid, payload->data, sizeof(team_uuid_t));
26 }
27 
28 static inline void mt_error_unknown_channel(const p_packet_t *payload,
30 {
31  team_uuid_t team_uuid = {0};
32 
33  memcpy(&team_uuid, payload->data, sizeof(team_uuid_t));
35 }
36 
37 static inline void mt_error_unknown_thread(const p_packet_t *payload,
39 {
40  team_uuid_t team_uuid = {0};
41 
42  memcpy(&team_uuid, payload->data, sizeof(team_uuid_t));
44 }
45 
46 static inline void mt_error_unknown_user(const p_packet_t *payload,
48 {
49  team_uuid_t user_uuid = {0};
50 
51  memcpy(&user_uuid, payload->data, sizeof(team_uuid_t));
53 }
54 
55 static inline void mt_error_unauthorized(UNUSED const p_packet_t *payload,
57 {
59 }
60 
61 static inline void mt_already_exist(UNUSED const p_packet_t *payload,
63 {
65 }
66 
67 #endif /* !LOGGER_ERROR_H_ */
int client(int ac, char **av)
main function for the client is only used by main (is returned by the main function)
Definition: client.c:176
int client_error_unknown_thread(char const *thread_uuid)
Must be called when the user try to do an action with a thread that does not exist (list replies,...
int client_error_unknown_user(char const *user_uuid)
Must be called when the user try to do an action with a user that does not exist (send private messag...
int client_error_unauthorized(void)
Must be called when the user try to do an action he is not allowed to perform. Ex: create a thread in...
int client_error_already_exist(void)
Must be called when the user try to do an action and the resource already exist. Ex: create a team wi...
int client_error_unknown_channel(char const *channel_uuid)
Must be called when the user try to do an action with a channel that does not exist (list threads,...
int client_error_unknown_team(char const *team_uuid)
Must be called when the user try to do an action with a team that does not exist (list channels,...
Definition: client.h:32
Represents a packet with type and data.
Definition: protocol.h:31
uint8_t data[DATA_SIZE]
Definition: protocol.h:33
Definition: events_structures.h:82
char uuid[UUID_LENGTH]
Definition: events_structures.h:83
#define UNUSED
Definition: unused.h:12