Exemplo n.º 1
0
char		*parser(char *tab, t_env *env)
{
  char		**command;
  int		*pipe_fd;
  t_command	*tmp;
  t_list	list;
  int		nb_exec;
  char		*error;

  nb_exec = 0;
  init_list(&list);
  command = separe_wordtab(tab, '|');
  if ((error = list_command(&list, command, &pipe_fd)) != 0)
    return (error);
  tmp = list.first;
  while (tmp != NULL)
    {
      if (my_execve(tmp, tmp->redirection,
		    env, pipe_fd) != 42)
	nb_exec += 1;
      tmp = tmp->next;
    }
  close_fd(pipe_fd);
  loop_wait(nb_exec);
  return (0);
}
void ShellXcb::run() {
    create_window();
    xcb_map_window(c_, win_);
    xcb_flush(c_);

    create_context();
    resize_swapchain(settings_.initial_width, settings_.initial_height);

    quit_ = false;
    if (settings_.animate)
        loop_poll();
    else
        loop_wait();

    destroy_context();

    xcb_destroy_window(c_, win_);
    xcb_flush(c_);
}