-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
36 lines (29 loc) · 811 Bytes
/
main.c
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
#include <stdio.h>
#include <stdlib.h>
#include "file.h"
#include "validation.h"
#include "merge.h"
#include "quicksort.h"
int main(int argc, char *argv[])
{
int result;
tArguments arguments;
//Realiza validação dos argumentos
result = validateArguments(argc, &argv, &arguments);
if (result > 0)
{
puts("Erro na validacao dos argumentos");
}
else
{
/*Identifica qual dos arquivos de entrada será utilizado*/
identifyProperInputFile(arguments.situation);
if (arguments.method != 4)
/*Chama função responsável pelos métodos de intercalação*/
result = merge(arguments.method, arguments.quantity);
else
/*Chama função responsável pelo método quicksort externo*/
result = externalQuickSort(arguments.quantity);
}
return result;
}