diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-11 17:45:49 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-11 17:45:49 +0200 |
commit | 6e74d376f1a888f4730b9fa39df1b34b251eb3f5 (patch) | |
tree | eb602453b996ca6c67dbe2d281b8252b1e1ed429 /src/u_alias.c | |
parent | Better (diff) | |
download | 42-minishell-6e74d376f1a888f4730b9fa39df1b34b251eb3f5.tar.gz 42-minishell-6e74d376f1a888f4730b9fa39df1b34b251eb3f5.tar.bz2 42-minishell-6e74d376f1a888f4730b9fa39df1b34b251eb3f5.tar.xz 42-minishell-6e74d376f1a888f4730b9fa39df1b34b251eb3f5.tar.zst 42-minishell-6e74d376f1a888f4730b9fa39df1b34b251eb3f5.zip |
Aliases list in progress
Diffstat (limited to 'src/u_alias.c')
-rw-r--r-- | src/u_alias.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/u_alias.c b/src/u_alias.c new file mode 100644 index 0000000..6253d60 --- /dev/null +++ b/src/u_alias.c @@ -0,0 +1,43 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* u_alias.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include <libft.h> +#include <stddef.h> + +#include "d_define.h" +#include "s_struct.h" + +void + u_get_alias_value(char str[], const char name[], size_t dstsize, t_msh *msh) +{ + t_lalias *ptr; + + str[0] = C_NUL; + ptr = msh->alias; + while (ptr != NULL && ft_strncmp(tmp->name, name, ft_strlen(name)) != 0) + { + ptr = ptr->next; + } + if (ptr != NULL) + { + ft_strlcpy(str, tmp->value, dstsize); + } +} + +void + u_set_alias_value(const char name[], const char value[], t_msh *msh) +{ + t_lalias *tmp; + + tmp = msh->alias; + while (tmp) +} |