42-archive/42sh/src/main/data_singleton.c
ariard@student.42.fr 8d23821d69 after mege
2017-02-20 21:05:12 +01:00

22 lines
1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* data_singleton.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/01/10 11:36:39 by jhalford #+# #+# */
/* Updated: 2017/02/20 20:57:52 by ariard ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
t_data *data_singleton()
{
static t_data *data = NULL;
if (data == NULL)
data = malloc(sizeof(t_data));
return (data);
}