static int analyse(char *line, t_env *e, int i) { char **str_p; char **str; int nb; if (line) { str = m_split(line); str_p = ft_strsplit(line, ' '); } if (i == 0) { nb = ft_atoi(line); if (nb < 0) return (-1); e->worms = nb; return (1); } else if (line && ft_strcmp(line, "##start") == 0 && e->start == 0) return (e->start = 1); else if (line && ft_strcmp(line, "##end") == 0 && e->end == 0) return (e->end = 1); else if (line && line[0] == '#' && (ft_strcmp(line, "##start") != 0 || ft_strcmp(line, "##end") != 0)) return (free_tab(&str, &str_p, 1)); return (analyse2(line, str, str_p, e)); }
void UnitManager::gather_build_data() { String::Vector file_list; VFS::Instance()->getFilelist( String(ta3dSideData.download_dir) << "*.tdf", file_list); for (String::Vector::const_iterator f = file_list.begin(); f != file_list.end(); ++f) // Cherche un fichier pouvant contenir des informations sur l'unité unit_name { File* file = VFS::Instance()->readFile(*f); // Lit le fichier if (file) { analyse2(file); delete file; } } }