Exemplo n.º 1
0
void	my_left(t_tools tool, t_list **list, int buff, struct winsize argp)
{
  int	cmpt;
  int	nbr;

  nbr = 1;
  if (buff == LEFT)
    {
      cmpt = (*list)->cmpt;
      (*list) = (*list)->next;
      while ((*list)->cmpt != cmpt)
	{
	  (*list) = (*list)->next;
	  ++nbr;
	}
      if ((*list)->cmpt - argp.ws_row + 2 >= 0)
	{
	  (*list)->pos = 0;
	  while (argp.ws_row - 2 > 0)
	    {
	      (*list) = (*list)->prev;
	      --argp.ws_row;
	    }
	  (*list)->pos = 1;
	  my_show_list(*list, tool, tool.command);
	}
    }
}
Exemplo n.º 2
0
void	my_conditions(t_tools tool, t_list **list, int buff)
{
  if (buff == DOWN || buff == 9)
    {
      (*list)->pos = 0;
      (*list) = (*list)->next;
      (*list)->pos = 1;
      my_show_list(*list, tool, tool.command);
    }
  else if (buff == UP)
    {
      (*list)->pos = 0;
      *list = (*list)->prev;
      (*list)->pos = 1;
      my_show_list(*list, tool, tool.command);
    }
}
Exemplo n.º 3
0
int		key_other(t_link *link, unsigned char buff[5])
{
  if (buff[0] >= 32 && buff[1] == 0)
    {
      link->line = put_in_list(link->line, buff[0]);
      del_one();
      my_show_list(link->line, link);
    }
  return (TRUE);
}
Exemplo n.º 4
0
void	print_my_list_right(t_list **list, struct winsize argp, t_tools tool)
{
  (*list)->pos = 0;
  while (argp.ws_row - 2 > 0)
    {
      (*list) = (*list)->next;
      --argp.ws_row;
    }
  (*list)->pos = 1;
  my_show_list(*list, tool, tool.command);
}
Exemplo n.º 5
0
int             main(int ac, char **av)
{
  t_list        *l_a;
  t_list        *l_b;

  l_a = NULL;
  l_b = NULL;
  ac = ac - 1;
  if (ac == 0)
    return (0);
  while (ac != 0)
    {
      add_elem(&l_a, my_getnbr(av[ac]));
      ac--;
    }
  sort_out(&l_a, &l_b);
  my_putchar('\n');
  my_show_list(l_a);
  my_putchar('\n');
}
Exemplo n.º 6
0
static int	disp_lvar(t_shenv *shenv)
{
  my_show_list(shenv->lvar);
  return (EXIT_SUCCESS);
}