8 //Need to code for BOINC, because the old SETI@Home does not use xml to store data.
9 //Perhaps in the .conkyrc file there could be an option for BOINC or old SETI.
11 /*static float seti_get_float (FILE *fp, const char *name)
16 while (!feof(fp) && !ferror (fp))
18 fgets(buffer, 80, fp);
19 token = strtok(buffer, ">");
21 if (strcmp(token, name) == 0)
23 token = strtok(NULL, "<");
32 float seti_get_data(FILE * fp, const char *name)
38 while (fgets(token, 1000, fp) != NULL) //read the file
39 if (strncmp(token, name, strlen(name)) == 0) { //and search for the data in name
40 strcpy(buffer, strchr(token, '=') + 1); //copy just the number
54 struct information *current_info = &info;
56 current_info->seti_prog = current_info->seti_credit = 0.0f;
58 /* read total user credit */
60 /*FILE *fp = fopen(filename, "r");
64 seti_credit = seti_get_float(fp, "<user_total_credit");
68 snprintf(filename, 80, "%s/user_info.sah", seti_dir);
70 FILE *fp = fopen(filename, "r");
76 current_info->seti_credit = seti_get_data(fp, "nresults");
80 /* read current progress */
82 /*snprintf(filename, 80, "%s/slots/0/state.sah", seti_dir);
83 fp = fopen(filename, "r");
87 seti_prog = seti_get_float(fp, "<prog");
91 snprintf(filename, 80, "%s/slots/0/init_data.xml", seti_dir); */
93 snprintf(filename, 80, "%s/state.sah", seti_dir);
95 fp = fopen(filename, "r");
99 current_info->seti_prog = seti_get_data(fp, "prog");