コード例 #1
0
ファイル: colle3.c プロジェクト: Neoblih/Francois_Guergadic
int	what_is_this_glue(char *buff)
{
  int	i;
  int	total;
  int	ref;

  i = 1;
  while (i <= 5)
    {
      total = total + match(recup_colle(i), str_to_tab(buff, tab_height(buff), tab_length(buff)),
			    tab_height(buff), tab_length(buff)), i, tab_height(buff), tab_length(buff);
      i = i + 1;
    }
  if (total == 0)
    no_result();
  i = 1;
  while (i <= 5)
    {
      ref = total;
      aff_result(match(recup_colle(i), str_to_tab(buff, tab_height(buff), tab_length(buff)),
		       tab_height(buff), tab_length(buff)), i, tab_height(buff), tab_length(buff));
      total = total - match(recup_colle(i), str_to_tab(buff, tab_height(buff), tab_length(buff)),
                            tab_height(buff), tab_length(buff)), i, tab_height(buff), tab_length(buff);
      if (total != ref && total != 0)
	double_result();
      i = i + 1;
    }
}
コード例 #2
0
ファイル: leminpipes.c プロジェクト: elominp/lem-in
int	createpipe(t_lid *data)
{
  t_pip	*pipe;
  char	**tab;
  char	*line;

  if (data == NULL || (line = get_last_line(data->file)) == NULL)
    return (FALSE);
  if (line[0] == '#')
    return (TRUE);
  if ((tab = my_strtok(line, "-")) == NULL || tab_length(tab) != 2 ||
      (pipe = create_pipe(tab[0], tab[1])) == NULL ||
      data->existPipe(data, pipe))
    return (FALSE);
  data->addPipe(data, pipe);
  gbgc_free(NULL, line);
  free_strtab(tab);
  return (TRUE);
}