42_cube3D/map/parsing_meta.c

33 lines
1.2 KiB
C
Raw Permalink Normal View History

2023-05-16 13:12:54 -04:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* parsing_meta.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/05/16 16:28:39 by cchauvet #+# #+# */
/* Updated: 2023/05/16 16:28:41 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
2023-05-03 07:09:06 -04:00
#include "./parsing_private.h"
static int name_check(const char *path)
{
size_t len;
len = ft_strlen(path);
2023-05-03 10:33:57 -04:00
if (len < 4
|| (ft_strcmp(".cub", path + len - 4) != 0))
2023-05-03 07:09:06 -04:00
{
2023-05-16 08:47:04 -04:00
ft_eprintf("map: name doesn't finish by .cub");
2023-05-03 07:09:06 -04:00
return (1);
}
2023-05-03 10:33:57 -04:00
return (0);
2023-05-03 07:09:06 -04:00
}
int parsing_meta(const char *path)
{
return (name_check(path));
}