// The contents of this file are subject to the BOINC Public License // Version 1.0 (the "License"); you may not use this file except in // compliance with the License. You may obtain a copy of the License at // http://boinc.berkeley.edu/license_1.0.txt // // Software distributed under the License is distributed on an "AS IS" // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the // License for the specific language governing rights and limitations // under the License. // // The Original Code is the Berkeley Open Infrastructure for Network Computing. // // The Initial Developer of the Original Code is the SETI@home project. // Portions created by the SETI@home project are Copyright (C) 2002 // University of California at Berkeley. All Rights Reserved. // // Contributor(s): // // Functions to check the integrity of core client data structures. // Not currently used, but might be handy if *0 type crashes occur #include "cpp.h" #ifdef _WIN32 #include "stdafx.h" #endif #ifndef _WIN32 #include #endif #include "client_state.h" void CLIENT_STATE::check_project_pointer(PROJECT* p) { unsigned int i; for (i=0; ipers_file_xfers.size(); i++) { if (p == pers_file_xfers->pers_file_xfers[i]) return; } assert(0); } void CLIENT_STATE::check_file_xfer_pointer(FILE_XFER* p) { unsigned int i; for (i=0; ifile_xfers.size(); i++) { if (p == file_xfers->file_xfers[i]) return; } assert(0); } void CLIENT_STATE::check_app(APP& p) { check_project_pointer(p.project); } void CLIENT_STATE::check_file_info(FILE_INFO& p) { if (p.pers_file_xfer) check_pers_file_xfer_pointer(p.pers_file_xfer); if (p.result) check_result_pointer(p.result); check_project_pointer(p.project); } void CLIENT_STATE::check_file_ref(FILE_REF& p) { check_file_info_pointer(p.file_info); } void CLIENT_STATE::check_app_version(APP_VERSION& p) { unsigned int i; check_app_pointer(p.app); check_project_pointer(p.project); for (i=0; ipers_file_xfers.size(); i++) { check_pers_file_xfer(*pers_file_xfers->pers_file_xfers[i]); } for (i=0; ifile_xfers.size(); i++) { check_file_xfer(*file_xfers->file_xfers[i]); } }