client.h 764 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * File: client.h
  3. * Author: Arthur Brandao
  4. *
  5. * Created on 21 novembre 2018
  6. */
  7. #ifndef CLIENT_H
  8. #define CLIENT_H
  9. /* --- Include --- */
  10. #include "constante.h"
  11. #include "server.h"
  12. /* --- Strcutures --- */
  13. typedef struct{
  14. int id; //Id unique du client
  15. Server main; //Connexion principale entre le client et le serveur
  16. Server notify; //Connexion pour notifier le client
  17. }Client;
  18. typedef struct ClientNode ClientNode;
  19. struct ClientNode{
  20. boolean empty;
  21. Client* cli;
  22. ClientNode* next;
  23. };
  24. typedef struct{
  25. int length;
  26. ClientNode* tab;
  27. }ClientList;
  28. /* --- Fonctions --- */
  29. int add_client(Server, Server);
  30. Client* get_client(int);
  31. void remove_client(int);
  32. void clean_clientlist();
  33. int get_number_client();
  34. #endif /* CLIENT_H */