int ft_links_rooms(char *line, t_room **rooms) { t_room *tmp_room_one; t_room *tmp_room_two; char **tmp_link; tmp_link = init(&tmp_room_one, &tmp_room_two, line); if (!tmp_link) return (0); get_rooms(rooms, &tmp_room_one, &tmp_room_two, tmp_link); if (!final_cond(tmp_room_one, tmp_room_two, tmp_link)) return (0); return (1); }
int main() { int res = EXIT_SUCCESS; ews::set_up(); try { const auto env = ews::test::environment(); auto service = ews::service(env.server_uri, env.domain, env.username, env.password); auto room_lists = service.get_room_lists(); if (room_lists.empty()) { std::cout << "There are no room lists configured\n"; } else { for (const auto& room_list : room_lists) { std::cout << "The room list " << room_list.name() << " contains the following rooms:\n"; auto rooms = service.get_rooms(room_list); if (rooms.empty()) { std::cout << "This room list does not contain any rooms\n"; } else { for (const auto& room : rooms) { std::cout << room.name() << "\n"; } } } } } catch (std::exception& exc) { std::cout << exc.what() << std::endl; res = EXIT_FAILURE; } ews::tear_down(); return res; }