/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* main.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: jtorrez- +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/03/18 20:15:26 by jtorrez- #+# #+# */ /* Updated: 2023/03/19 02:05:14 by tischmid ### ########.fr */ /* */ /* ************************************************************************** */ #include "include/ft_lib.h" #include "include/arghandle.h" #include "include/rush0X.h" int main(int argc, char *argv[]) { int width; int max_width; int height; int max_height; if (argc != 3) { wrong_argc(2, argc - 1); usage(argv[0]); return (1); } max_width = get_dim("cols", g_default_max_width); max_height = get_dim("lines", g_default_max_height); width = ft_atoi(argv[1]); height = ft_atoi(argv[2]); if (width > max_width) return (wrong_dimension("width", max_width, width)); else if (height > max_height) return (wrong_dimension("height", max_height - 3, height)); rush(width, height); return (0); }