예제 #1
0
void	core(t_opt arg, t_list *path, int multidir)
{
	DIR		*dir;
	t_list	*file;
	t_list	*directory;
	t_list	*cur;

	file = NULL;
	directory = NULL;
	cur = path;
	while (cur)
	{
		if ((dir = opendir(cur->content)) == NULL)
			errno != ENOTDIR ? basicerror("ft_ls: ", cur->content, 0) : \
				ft_lstpushback(&file, cur->content, cur->content_size);
		else
		{
			ft_lstpushback(&directory, cur->content, cur->content_size);
			if (closedir(dir) == -1)
				basicerror("ft_ls: ", cur->content, 0);
		}
		cur = cur->next;
	}
	file ? do_ls_file(arg, file) : NULL;
	file && directory ? ft_putchar('\n') : NULL;
	directory ? do_ls_dir(arg, directory, multidir) : NULL;
}
예제 #2
0
void generror(int n, int data)
/*
 * most errors come here
 */
{
	if (inputFile)
	    basicerror(n, (void*)data);
}
예제 #3
0
파일: rcerr.c 프로젝트: doniexun/OrangeC
void generror(int n, int data)
/*
 * most errors come here
 */
{

    basicerror(n, (void*)data);
}
예제 #4
0
void Error(char *string)
/*
 * some of the library functions required a generic error function
 *
 * we are remapping it to the C/C++ error routines
 */
{
    basicerror(ERR_INTERP, (void*)string);
}
예제 #5
0
void gensymerror(int n, char *data)
/*
 * errors come here if the error has a symbol name
 */
{
    char buf[100];
    if (data)
        strcpy(buf, data);
    else
        buf[0] = 0;
    basicerror(n, (void*)rcStrdup(buf));
}
예제 #6
0
void	do_recursion(t_opt arg, char *path)
{
	t_elem	*files;
	DIR		*dir;

	files = NULL;
	ft_putchar('\n');
	ft_putstr(path);
	ft_putstr(":\n");
	if ((dir = opendir(path)) != NULL)
	{
		while (elemget(&files, readdir(dir), \
					ft_strjoin(path, "/"), arg) != 0)
			;
		closedir(dir);
		if (files)
			display_file(arg, files, 1);
		files = NULL;
	}
	else
		basicerror("ft_ls: ", path, 0);
}
예제 #7
0
void gensymerrorexp(int n, char *data)
{
    basicerror(n, (void*)rcStrdup(data));
}
예제 #8
0
void generrorexp(int n, int data)
{
    basicerror(n, (void*)data);
}