-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClients.h
60 lines (48 loc) · 1.26 KB
/
Clients.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*****************************************************************//**
* \file Clients.h
* \brief
*
* \author Diogo Pinto & Ricardo Cruz
* \date March 2023
*********************************************************************/
#include <stdbool.h>
#pragma region CONSTANTS
#define NAME_SIZE 50
#define ADDRESS_SIZE 50
#define PHONE_SIZE 12
#define EMAIL_SIZE 50
#define MAX_LINE_SIZE 100
#pragma endregion
#pragma region CLIENT_STRUCT
typedef struct Client
{
char name[NAME_SIZE];
float balance;
int nif;
char address[ADDRESS_SIZE];
char phone[PHONE_SIZE];
char email[EMAIL_SIZE];
} Client;
#pragma endregion
#pragma region CLIENTS_STRUCT
typedef struct Clients
{
Client c;
struct Clients* next;
struct Clients* prev;
} Clients;
#pragma endregion
#pragma region INSERT_CLIENT
Clients* add_client(Clients* clients_head, Client new_client);
bool create_node(Clients** new_node, Client new_client);
bool add_node(Clients** clients_head, Clients* new_node);
#pragma endregion
#pragma region LIST_CLIENTS
void print_clients(Clients* clients_head);
#pragma endregion
#pragma region READ_CLIENTS
Clients* read_clients_from_file();
#pragma endregion
#pragma region FREE_DLL
void free_clients_list(Clients* clients_head);
#pragma endregion