blob: 9f09250c991ced35840f7eb00f8bbcf9d9f17292 (
plain)
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
|
#include "codexion.h"
# include <stdlib.h> // for atoi(), malloc()
# include <string.h> // for strlen()
# include <stdio.h> // for printf()
int valid_params(char **argv)
{
int i;
if (atoi(argv[1]) < 1)
{
printf("Not enough philos\n");
return (0);
}
i = 2;
while (i <= 7)
{
if (atoi(argv[i++]) < 0)
{
printf("Input cannot be negative\n");
return (0);
}
}
if (strcmp(argv[8], "fifo") != 0 && strcmp(argv[8], "edf") != 0)
{
printf("Scheduler must be either 'fifo' or 'edf'\n");
return (0);
}
return (1);
}
|