This repository has been archived by the owner on Jun 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefinitions.h
135 lines (102 loc) · 2.45 KB
/
definitions.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#ifndef FUNCTIONS_H
#define FUNCTIONS_H
#include <stdbool.h>
#define SC 25
extern int NC;
extern int NA;
extern int NE;
#pragma region Structs
typedef struct
{
int codCliente;
char nome[SC];
int nif;
char pais[SC];
bool estado;
} Clientes;
typedef struct {
int codArtigo;
char artigo[SC];
double maoObra;
double custosFixos;
double margemLucro;
int tamanhos[2];
double defaultPreco;
double incrementoPreco;
bool estado;
double tamanhoPreco[15][2];
} Artigos;
typedef struct {
int codEncomenda;
int codCliente;
int codArtigo;
int tamanho;
int horaminuto;
int dia;
int mes;
int ano;
int quantidade;
double total;
bool estado;
} Encomendas;
typedef struct {
int currentClient;
char stringDesconto[7];
double percentageDesconto;
} Runtime;
extern Clientes *cliente;
extern Artigos *artigo;
extern Encomendas *encomenda;
extern Runtime *runtime;
#pragma endregion
#pragma region Functions
/// Ficheiro main.c
int main();
/// Ficheiro util.c
int numberOfDigits(int num);
void clearScreen();
void pressEnter(bool alsoClearScreen);
int getDateInfo(int info);
bool checkString(const char* string);
bool checkNumber(double number);
bool checkCodPromo(char* codPromo);
bool availableForOperation(int op, int codArtigo, int parameter);
int getArtigoIndex(int codArtigo);
bool loggedClient();
void reallocStruct(int st);
void freeMemory(bool alsoStopTheProgram);
// Ficheiro queries.c
void listEncomendas(int queryType);
void statisticsEncomendas();
double getTotalEncomenda();
void listClientes(int queryType);
void listArtigos(int queryType);
char* getArtigoName(int codArtigo);
void printDataEncomenda(int enc);
void printDataArtigo(int art, bool query);
void printDataCliente(int cli);
// Ficheiro clientes.c
void addCliente();
bool getEstadoCliente(int codCliente);
char* getClientName(int codCliente);
void updateClient(int clienteToChange, int via);
// Ficheiro administrador.c
void updateArtigo();
void addArtigo();
void updateDesconto();
// Ficheiro data.c
void importData();
void exportData();
void importDefaultData();
void exportDefaultData();
void deleteData();
void exportEncomendas();
// Ficheiro shopping.c
void loginClient(), logoutClient();
void doShopping();
char *getEstadoEncomenda(int estado);
void cancelEncomenda();
// Ficheiro colors.c
void white(), red(), green(), blue(), yellow(), purple(), cyan(), bold(), boldRed();
#pragma endregion
#endif