aboutsummaryrefslogtreecommitdiff
path: root/libft/src/lst/ft_lstpush_front_node.c
blob: f6ff694e093c311d974495c15b03bd432c919f64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   ft_lstpush_front_node.c                            :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: charles <me@cacharle.xyz>                  +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/08/20 14:38:18 by charles           #+#    #+#             */
/*   Updated: 2020/08/20 14:41:14 by charles          ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include "libft_lst.h"

t_ftlst	*ft_lstpush_front_node(t_ftlst **lst, void *data)
{
	t_ftlst	*pushed;

	if (data == NULL || (pushed = ft_lstnew(data)) == NULL)
		return (NULL);
	ft_lstpush_front(lst, pushed);
	return (*lst);
}