]> git.sesse.net Git - freerainbowtables/blob - BOINC software/BOINC server apps/distrrtgen_validator/validate_util.h
initial
[freerainbowtables] / BOINC software / BOINC server apps / distrrtgen_validator / validate_util.h
1 // This file is part of BOINC.
2 // http://boinc.berkeley.edu
3 // Copyright (C) 2008 University of California
4 //
5 // BOINC is free software; you can redistribute it and/or modify it
6 // under the terms of the GNU Lesser General Public License
7 // as published by the Free Software Foundation,
8 // either version 3 of the License, or (at your option) any later version.
9 //
10 // BOINC is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 // See the GNU Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public License
16 // along with BOINC.  If not, see <http://www.gnu.org/licenses/>.
17
18 #ifndef H_VALIDATE_UTIL
19 #define H_VALIDATE_UTIL
20
21 #include <vector>
22 #include <string>
23
24 #include "boinc_db.h"
25 #include "parse.h"
26
27 // bit of a misnomer - this actually taken from the <file_ref> elements
28 // of result.xml_doc_in
29 //
30 struct FILE_INFO {
31     std::string name;
32     std::string path;
33     bool optional;
34     bool no_validate;
35
36     int parse(XML_PARSER&);
37 };
38
39 extern int get_output_file_info(RESULT& result, FILE_INFO&);
40 extern int get_output_file_infos(RESULT& result, std::vector<FILE_INFO>&);
41 extern int get_output_file_path(RESULT& result, std::string&);
42 extern int get_output_file_paths(RESULT& result, std::vector<std::string>&);
43 extern int get_logical_name(
44     RESULT& result, std::string& path, std::string& name
45 );
46
47 extern double median_mean_credit(WORKUNIT&, std::vector<RESULT>& results);
48 extern int get_credit_from_wu(WORKUNIT&, std::vector<RESULT>& results, double&);
49 extern double stddev_credit(WORKUNIT&, std::vector<RESULT>& results);
50 extern double two_credit(WORKUNIT&, std::vector<RESULT>& results);
51 extern int update_credit_per_cpu_sec(
52     double credit, double cpu_time, double& credit_per_cpu_sec
53 );
54 #endif