bool CompilerFactory::find_tool_type (const char* argv0,bool option,const std::string &appli_path,std::string &option_tool_name, bool &profile_inactive) { FUNCTION_TRACE; DEBUG4("find_tool_type (argv0=%s,option=%s,appli_path=%s)\n",argv0,(option?"true":"false"),appli_path.c_str()); std::string exe_param=System::appendExecSuffix(argv0); if (name_check(exe_param,std::string(),!option)) { std::string name; profile_inactive=false; if (option) name=exe_param; else extract_tool_name(exe_param,name,true,profile_inactive); option_tool_name=name; struct stat info; DEBUG2("option_tool_name=%s\n",option_tool_name.c_str()); std::string pf=profile_name(option_tool_name,appli_path); DEBUG2("pf=%s\n",pf.c_str()); if (stat(pf.c_str(),&info)!=0) { option_tool_name=findFileInPath(name); DEBUG2("option_tool_name=%s\n",option_tool_name.c_str()); std::string pf=profile_name(option_tool_name,appli_path); DEBUG2("pf=%s\n",pf.c_str()); if (pf.length()>0 && (stat(pf.c_str(),&info)!=0) ) { DEBUG2("profile (%s) not found\n",option_tool_name.c_str()); option_tool_name.clear(); } } return true; } return false; }
int result_of_eviction(int* floor, int num_set_hostel, struct settled* students_list, struct queue **tail, struct departure* stud_list, int kol_departure) { int name_size = SIZE(stud_list[kol_departure].name); if(name_check(floor, num_set_hostel, stud_list, kol_departure,students_list) == 2) { printf("Hostel is empty\n\n"); return 0; } printf("Enter surname of the student "); gets_s(stud_list[kol_departure].name,name_size); if(name_check(floor, num_set_hostel, stud_list, kol_departure,students_list) == 1) { printf(" Student with that name does not live here\n"); return 0; } if(name_check(floor, num_set_hostel, stud_list, kol_departure,students_list) == 0) { num_set_hostel = remove_from_the_list(num_set_hostel,floor, students_list); puts(" The man was successfully evicted by out of the hostel\n"); } return num_set_hostel; }