feat: added maps, added readfile to parsing

This commit is contained in:
Baptiste GOULARD 2024-11-12 11:30:30 +01:00
parent 4db733648e
commit e4d2dfda21
19 changed files with 282 additions and 41 deletions

View file

@ -24,11 +24,11 @@
void parse_args(char *arg, t_info *inf)
{
if (arg == NULL && inf->cli_ctx.file == NULL)
return (inf->last_error = MISSING_FILE_ERROR, (void)0);
return (inf->last_error = ERROR_MISSING_FILE, (void)0);
if (arg && ft_strlen(arg) < 5)
return (inf->last_error = NAME_FILE_ERROR, (void)0);
return (inf->last_error = ERROR_NAME_FILE, (void)0);
if (arg && ft_strend_with(arg, FILE_EXTENSION) == false)
return (inf->last_error = EXTENSION_FILE_ERROR, (void)0);
return (inf->last_error = ERROR_EXTENSION_FILE, (void)0);
if (arg && inf->cli_ctx.file == NULL)
inf->cli_ctx.file = ft_strdup(arg);
inf->last_error = NO_ERROR;