diff --git a/samples/condor/Makefile b/samples/condor/Makefile index 1256089580..4d2a595b47 100644 --- a/samples/condor/Makefile +++ b/samples/condor/Makefile @@ -1,10 +1,11 @@ all: boinc_gahp -boinc_gahp: boinc_gahp.cpp boinc_gahp.h curl.cpp curl.h +boinc_gahp: boinc_gahp.cpp job_rpc.cpp job_rpc.h g++ -g -O0 -I../../lib \ - -o boinc_gahp boinc_gahp.cpp curl.cpp \ + -o boinc_gahp boinc_gahp.cpp job_rpc.cpp \ -L../../lib -lboinc -lpthread -lcurl -test: test.cpp curl.cpp +test: test.cpp job_rpc.cpp g++ -g -o test -I../../lib \ - test.cpp curl.cpp -lcurl + test.cpp job_rpc.cpp \ + -L../../lib -lboinc -lcurl diff --git a/samples/condor/boinc_gahp.cpp b/samples/condor/boinc_gahp.cpp index f78d2182eb..c248e61fe3 100644 --- a/samples/condor/boinc_gahp.cpp +++ b/samples/condor/boinc_gahp.cpp @@ -33,7 +33,7 @@ #include "md5_file.h" #include "parse.h" -#include "curl.h" +#include "job_rpc.h" using std::map; using std::pair; diff --git a/samples/condor/curl.cpp b/samples/condor/job_rpc.cpp similarity index 99% rename from samples/condor/curl.cpp rename to samples/condor/job_rpc.cpp index 21065774b7..d478903068 100644 --- a/samples/condor/curl.cpp +++ b/samples/condor/job_rpc.cpp @@ -23,7 +23,7 @@ #include "parse.h" -#include "curl.h" +#include "job_rpc.h" using std::vector; using std::string; diff --git a/samples/condor/boinc_gahp.h b/samples/condor/job_rpc.h similarity index 62% rename from samples/condor/boinc_gahp.h rename to samples/condor/job_rpc.h index a38063cbd2..9396ba5bb1 100644 --- a/samples/condor/boinc_gahp.h +++ b/samples/condor/job_rpc.h @@ -15,13 +15,14 @@ // You should have received a copy of the GNU Lesser General Public License // along with BOINC. If not, see . -#include +#include #include #include +#include -using std::map; using std::string; using std::vector; +using std::map; struct INFILE { char src_path[256]; @@ -65,3 +66,52 @@ struct FETCH_OUTPUT_REQ { char dir[256]; vector file_names; }; + +////////////////////////// + + +extern int query_files( + const char* project_url, + const char* authenticator, + int batch_id, + vector &md5s, + vector &paths, + vector &absent_files +); + +extern int upload_files ( + const char* project_url, + const char* authenticator, + int batch_id, + vector &md5s, + vector &paths +); + +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 +);