Zappy - Year end project 2
This is a project that Epitech asked us to create in order to allow us to reveiw the notions of the current year.
Loading...
Searching...
No Matches
utils.h
Go to the documentation of this file.
1/*
2** EPITECH PROJECT, 2023
3** my_zappy
4** File description:
5** utils.h
6*/
7
8#ifndef SERVER_UTILS_H
9 #define SERVER_UTILS_H
10
11 #include "arg_parse.h"
12 #include "server_handler.h"
13
15
21int write_error_msg(const char *str);
22
29int write_to_client(const int fd, const char *str);
30
32
40void *find_value_by_param(const struct arg_s **arguments, char *param);
41
50int find_index_by_param(const struct arg_s **arguments, char *param);
51
53
59size_t get_array_len(char **array);
60
62
67void free_array(void *to_free);
68
74void free_args(struct arg_s **args, const size_t size);
75
76// FILL
77
82void refill_map(game_data_t *game_data);
83
88void fill_map(server_handler_t *server);
89
96void free_array_size_n(void *to_free, const size_t n);
97
104char **str_to_word_array(const char *str, const char delim);
105
112char *array_to_str(int ac, const char **av);
113
114#endif //SERVER_UTILS_H
A structure to store the game data.
A structure to store server general data.
void * find_value_by_param(const struct arg_s **arguments, char *param)
! FINDER !!
void refill_map(game_data_t *game_data)
Refill the map with ressources (use in runtime)
Definition fill.c:63
int find_index_by_param(const struct arg_s **arguments, char *param)
Find the index where a parameter is in the arg_s structure by his parameter.
int write_to_client(const int fd, const char *str)
Write any message to a specific file descriptor.
Definition writer.c:17
void free_args(struct arg_s **args, const size_t size)
Free struct args_s of lenght size.
Definition free.c:35
void free_array(void *to_free)
! FREE !!
Definition free.c:13
size_t get_array_len(char **array)
! GETTER !!
Definition array_utils.c:13
void free_array_size_n(void *to_free, const size_t n)
Free any ** array up to n.
Definition free.c:26
char * array_to_str(int ac, const char **av)
Turn an array of string into a simple string.
char ** str_to_word_array(const char *str, const char delim)
Turn string to char **.
Definition array_utils.c:62
void fill_map(server_handler_t *server)
Fill the map with ressources (use in initialization)
Definition fill.c:68
int write_error_msg(const char *str)
! WRITTER !!
Definition writer.c:11