matchers: add matcher for a pipe

This commit is contained in:
Khaïs COLIN 2025-02-21 14:13:51 +01:00
parent 256a8f5f9b
commit 2b8bb859d1
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
3 changed files with 46 additions and 0 deletions

View file

@ -0,0 +1,24 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* pipe.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/21 15:04:48 by khais #+# #+# */
/* Updated: 2025/02/21 15:06:00 by khais ### ########.fr */
/* */
/* ************************************************************************** */
#include "pipe.h"
#include "libft.h"
/*
** return true if the given worddesc is a pipe operator "|"
*/
bool is_pipe(t_worddesc *word)
{
if (ft_strcmp("|", word->word) == 0)
return (true);
return (false);
}

View file

@ -0,0 +1,21 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* pipe.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: khais <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/02/21 15:03:37 by khais #+# #+# */
/* Updated: 2025/02/21 15:04:43 by khais ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef PIPE_H
# define PIPE_H
# include <stdbool.h>
# include "../worddesc/worddesc.h"
bool is_pipe(t_worddesc *word);
#endif