main.cpp (557B)
1 #include "boinc_api.h" 2 #include "filesys.h" 3 4 using namespace std; 5 FILE* fp; 6 7 int main() { 8 int retval; 9 char buf[256]; 10 fp = fopen("out.txt", "a"); 11 12 BOINC_OPTIONS options; 13 boinc_options_defaults(options); 14 options.normal_thread_priority = true; 15 16 retval = boinc_init_options(&options); 17 if (retval) { 18 fprintf(stderr, "%s boinc_init returned %d\n", 19 boinc_msg_prefix(buf, sizeof(buf)), retval 20 ); 21 exit(retval); 22 } 23 24 fprintf(fp, "test\n"); 25 fflush(fp); 26 boinc_finish(0); 27 return 0; 28 }