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
Functions
client_management.h File Reference
#include "server_handler.h"
Include dependency graph for client_management.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void init_client (cli_t client[MAX_CLIENT])
 The function to initialize the cli_t structure.
 
int get_client (cli_t client[MAX_CLIENT], const int fd)
 The function to get the client index in the structure by the fd.
 
int delete_client (cli_t client[MAX_CLIENT], const int fd)
 The function to delete a specific client from the cli_t structure by the fd.
 
void delete_all_client (cli_t client[MAX_CLIENT])
 The function to delete a every client from the cli_t structure.
 

Function Documentation

◆ delete_all_client()

void delete_all_client ( cli_t client[MAX_CLIENT])

The function to delete a every client from the cli_t structure.

Parameters
clintThe cli_t structure

Definition at line 45 of file client_management.c.

◆ delete_client()

int delete_client ( cli_t client[MAX_CLIENT],
const int fd )

The function to delete a specific client from the cli_t structure by the fd.

Parameters
clintThe cli_t structure
fdThe file descriptor of the client
Returns
(0) if the client is founded and deleted successfully, (-1) if not

Definition at line 29 of file client_management.c.

◆ get_client()

int get_client ( cli_t client[MAX_CLIENT],
const int fd )

The function to get the client index in the structure by the fd.

Parameters
clientThe cli_t structure
fdThe file descriptor of the client
Returns
int: The index where the fd is stored

Definition at line 19 of file client_management.c.

◆ init_client()

void init_client ( cli_t client[MAX_CLIENT])

The function to initialize the cli_t structure.

Parameters
clientThe cli_t structure to initialize

Definition at line 12 of file client_management.c.