static void write_srsieve_file(const char *file_name, uint64_t p) { FILE *file; uint32_t seq, count; if ((file = xfopen(file_name, "w", warning)) == NULL) return; fprintf(file, "pmin=%"PRIu64"\n", p); for (count = 0, seq = 0; seq < seq_count; seq++) { fprintf(file, "%s\n", seq_str(seq)); count += seq_for_each_term(seq,(kcn_app_t)write_n,file); } report_wrote(count, seq_count, "srsieve", file_name); xfclose(file,file_name); }
void ClientComm::SendQuery(std::vector<std::string> descrip, char* seq, int length) { assert(started_ == true); assert(ended_ == false); std::string seq_str(seq, length); client_socket_->Send(descrip[QUERY_NAME_FIELD]); client_socket_->Send(" "); client_socket_->Send(seq_str); client_socket_->Send(" "); client_socket_->Send(descrip[REF_NAME_FIELD]); client_socket_->Send(" "); client_socket_->Send(descrip[REF_START_FIELD]); client_socket_->Send(" "); client_socket->_Send(descrip[REF_END_FIELD]); client_socket->_Send(" "); client_socket->_Send(descrip[THRESHOLD_FIELD]); client_socket->_Send("\n"); }
static void write_newpgen_files(uint64_t p) { FILE *file; char file_name[FILENAME_MAX+1]; int t; uint32_t i, count, total; for (total = 0, i = 0; i < seq_count; i++) { assert(ABS(SEQ[i].c) == 1 || SEQ[i].k == 1); t = npg_format_index(SEQ[i].c); if (t == 0 || t == 1) snprintf(file_name, FILENAME_MAX, "t%d_b%" PRIu32 "_k%" PRIu64 ".%s", npg_formats[t].sieve_type, base, SEQ[i].k, NEWPGEN_EXT); else snprintf(file_name, FILENAME_MAX, "t%d_b%" PRIu32 "_k%" PRIu64 ".%s", npg_formats[t].sieve_type, base, ABS(SEQ[i].c), NEWPGEN_EXT); file_name[FILENAME_MAX] = '\0'; if ((file = xfopen(file_name, "w", warning)) == NULL) continue; fprintf(file, "%"PRIu64":%c:1:%"PRIu32":%d\n", p, npg_formats[t].mode_char, base, npg_formats[t].mode_bits); count = seq_for_each_term(i,npg_formats[t].write_fun,file); if (seq_count == 1 || verbose > 1) report("Wrote %"PRIu32" term%s for sequence %s to NewPGen format file" " `%s'.", count, plural(count), seq_str(i), file_name); xfclose(file,file_name); total += count; } if (seq_count > 1 && verbose == 1) /* don't report twice */ report("Wrote %"PRIu32" term%s for %"PRIu32" sequence%s to NewPGen format" " files t*_b%"PRIu32"_k*.%s.", total, plural(total), seq_count, plural(seq_count), base, NEWPGEN_EXT); }