// This file is part of BOINC. // http://boinc.berkeley.edu // Copyright (C) 2013 University of California // // BOINC is free software; you can redistribute it and/or modify it // under the terms of the GNU Lesser General Public License // as published by the Free Software Foundation, // either version 3 of the License, or (at your option) any later version. // // BOINC is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // See the GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . #include #include #include #include using std::string; using std::vector; using std::map; struct INFILE { char src_path[256]; char dst_path[256]; }; struct JOB { char job_name[256]; string cmdline_args; vector infiles; bool all_output_files; vector outfiles; }; struct LOCAL_FILE { char md5[64]; double nbytes; }; struct SUBMIT_REQ { char batch_name[256]; char app_name[256]; vector jobs; map local_files; // maps local path to info about file int batch_id; }; struct QUERY_BATCH_JOB { string job_name; string status; QUERY_BATCH_JOB(){} }; struct QUERY_BATCH_REPLY { vector jobs; }; struct FETCH_OUTPUT_REQ { char job_name[256]; char dir[256]; vector file_names; }; ////////////////////////// extern int query_files( const char* project_url, const char* authenticator, vector &paths, vector &md5s, int batch_id, vector &absent_files ); extern int upload_files ( const char* project_url, const char* authenticator, vector &paths, vector &md5s, int batch_id ); extern int create_batch( const char* project_url, const char* authenticator, const char* batch_name, const char* app_name, int &batch_id ); extern int submit_jobs( const char* project_url, const char* authenticator, SUBMIT_REQ &req ); extern int query_batch( const char* project_url, const char* authenticator, int batch_id, QUERY_BATCH_REPLY& reply ); extern int get_output_file( const char* project_url, const char* authenticator, const char* job_name, int file_num, const char* dst_path );