summaryrefslogtreecommitdiffstats
path: root/src/u_alias.c
blob: 6253d60aaf38d243f180a568b932bff4972a13d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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)
}