/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* b_sqb_str.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rbousset +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */ /* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */ /* */ /* ************************************************************************** */ #include #include "d_define.h" static t_bool b_sqb_str_comp(unsigned char id, const char s1[], const char s2[]) { if (id == B_ID_SQB_EQUA && ft_strncmp(s1, s2, ft_strlen(s1) + 1) == 0) return (TRUE); else if (id == B_ID_SQB_EQUA && ft_strncmp(s1, s2, ft_strlen(s1) + 1) != 0) return (TRUE); return (FALSE); } unsigned char b_sqb_str(unsigned char id, char *argv[]) { if (id == B_ID_SQB_N) { if (argv[1][0] != '\0') return (0); else return (1); } else if (id == B_ID_SQB_Z) { if (argv[1][0] == '\0') return (0); else return (1); } if (b_sqb_str_comp(id, argv[0], argv[2]) == TRUE) return (0); return (1); }