refactored main; monitoring & scheduling not done yet

This commit is contained in:
Semere M. Mebrahtom 2026-03-26 10:54:24 +01:00
parent 7748a53eb2
commit f08c635390
Signed by: semere
GPG key ID: 7FC937214DF30488
4 changed files with 93 additions and 77 deletions

View file

@ -38,18 +38,14 @@ t_args *parse_arguments(int count, char **args)
data = malloc(sizeof(t_args));
if (!data)
return (NULL);
i = 0;
while (i < 7)
i = -1;
while (++i < 7)
{
if (!isnumeric(args[i]))
return (NULL);
args_int[i] = atoi(args[i]);
i++;
}
if (!strcmp(args[7], "fifo"))
data->scheduler = "fifo";
else if (!strcmp(args[7], "edf"))
data->scheduler = "edf";
data->scheduler = args[7];
data->number_of_coders = args_int[0];
data->time_to_burnout = args_int[1];
data->time_to_compile = args_int[2];