Esempio n. 1
0
char			*older_time(char *s_time, t_stat *buf)
{
	int		end;
	char	*ret;
	int		end_tmp;
	int		loop;
	char	*tmp;

	loop = 0;
	init_ret(&ret, s_time);
	tmp = ctime(&buf->st_mtimespec.tv_sec);
	end_tmp = ft_strlen(tmp) - 1;
	end = ft_strlen(ret) - 1;
	while (ret[end] != ' ')
		--end;
	ret[end++] = ' ';
	while (loop < 5)
	{
		--end_tmp;
		++loop;
	}
	while (tmp[end_tmp] != '\n')
		ret[end++] = tmp[end_tmp++];
	ret[end] = '\0';
	return (ret);
}
Esempio n. 2
0
int			*det_paths(int nant, int **paths, t_l_data *d)
{
	int	ibck;

	d->plen = init_ret(paths);
	d->i = 0;
	ibck = 0;
	while (paths[d->i] && nant)
	{
		nant = det_paths2(nant, d, paths, ibck);
	}
	d->i = 0;
	while (nant)
	{
		d->i = d->plen[d->i] == -1 ? 0 : d->i;
		d->plen[d->i]++;
		nant--;
		d->i++;
	}
	return (d->plen);
}