Esempio n. 1
0
static t_uint	my_calc_len_tab(const char *str, const char *delim)
{
  t_uint	i;

  i = 0;
  while (*str != '\0')
    {
      while (my_char_in_str(*str, delim) != -1)
	str++;
      if (*str != '\0')
	i++;
      while (my_char_in_str(*str, delim) == -1 && *str != '\0')
	str++;
    }
  return (sizeof(char *) * (i + 1));
}
Esempio n. 2
0
static t_uint	my_calc_len_word(const char *str, const char *delim)
{
  t_uint	i;

  i = 0;
  while (my_char_in_str(*str, delim) == -1 && str[i] != '\0')
    i++;
  return (sizeof(char) * (i + 1));
}
Esempio n. 3
0
File: alias.c Progetto: Stifyz/42sh
int		check_print_alias(t_application *app, int ac, char **av)
{
  t_alias	*tmp;

  tmp = app->alias_list;
  if (ac == 1 && (my_strcmp(av[0], "alias") == 0))
    {
      while (tmp)
	{
	  if ((my_char_in_str(tmp->cmd, ' ')))
	    my_printf("%s\t(%s)\n", tmp->name, tmp->cmd);
	  else
	    my_printf("%s\t%s\n", tmp->name, tmp->cmd);
	  tmp = tmp->next;
	}
      return (0);
    }
  return (-1);
}