void comp_frame(FILE *fp, t_trxframe *fr1, t_trxframe *fr2, gmx_bool bRMSD, real ftol,real abstol) { fprintf(fp,"\n"); cmp_int(fp,"flags",-1,fr1->flags,fr2->flags); cmp_int(fp,"not_ok",-1,fr1->not_ok,fr2->not_ok); cmp_int(fp,"natoms",-1,fr1->natoms,fr2->natoms); cmp_real(fp,"t0",-1,fr1->t0,fr2->t0,ftol,abstol); if (cmp_bool(fp,"bTitle",-1,fr1->bTitle,fr2->bTitle)) cmp_str(fp,"title", -1, fr1->title, fr2->title); if (cmp_bool(fp,"bStep",-1,fr1->bStep,fr2->bStep)) cmp_int(fp,"step",-1,fr1->step,fr2->step); cmp_int(fp,"step",-1,fr1->step,fr2->step); if (cmp_bool(fp,"bTime",-1,fr1->bTime,fr2->bTime)) cmp_real(fp,"time",-1,fr1->time,fr2->time,ftol,abstol); if (cmp_bool(fp,"bLambda",-1,fr1->bLambda,fr2->bLambda)) cmp_real(fp,"lambda",-1,fr1->lambda,fr2->lambda,ftol,abstol); if (cmp_bool(fp,"bAtoms",-1,fr1->bAtoms,fr2->bAtoms)) cmp_atoms(fp,fr1->atoms,fr2->atoms,ftol,abstol); if (cmp_bool(fp,"bPrec",-1,fr1->bPrec,fr2->bPrec)) cmp_real(fp,"prec",-1,fr1->prec,fr2->prec,ftol,abstol); if (cmp_bool(fp,"bX",-1,fr1->bX,fr2->bX)) cmp_rvecs(fp,"x",min(fr1->natoms,fr2->natoms),fr1->x,fr2->x,bRMSD,ftol,abstol); if (cmp_bool(fp,"bV",-1,fr1->bV,fr2->bV)) cmp_rvecs(fp,"v",min(fr1->natoms,fr2->natoms),fr1->v,fr2->v,bRMSD,ftol,abstol); if (cmp_bool(fp,"bF",-1,fr1->bF,fr2->bF)) cmp_rvecs(fp,"f",min(fr1->natoms,fr2->natoms),fr1->f,fr2->f,bRMSD,ftol,abstol); if (cmp_bool(fp,"bBox",-1,fr1->bBox,fr2->bBox)) cmp_rvecs(fp,"box",3,fr1->box,fr2->box,FALSE,ftol,abstol); }
void cmp_top(FILE *fp, const t_topology *t1, const t_topology *t2, real ftol, real abstol) { fprintf(fp, "comparing top\n"); if (t2) { cmp_idef(fp, &(t1->idef), &(t2->idef), ftol, abstol); cmp_atoms(fp, &(t1->atoms), &(t2->atoms), ftol, abstol); cmp_block(fp, &t1->cgs, &t2->cgs, "cgs"); cmp_block(fp, &t1->mols, &t2->mols, "mols"); cmp_bool(fp, "bIntermolecularInteractions", -1, t1->bIntermolecularInteractions, t2->bIntermolecularInteractions); cmp_blocka(fp, &t1->excls, &t2->excls, "excls"); } else { cmp_idef(fp, &(t1->idef), NULL, ftol, abstol); cmp_atoms(fp, &(t1->atoms), NULL, ftol, abstol); } }
/** match all of the packet */ static int match_all(ldns_pkt* q, ldns_pkt* p) { if(ldns_pkt_get_opcode(q) != ldns_pkt_get_opcode(p)) { verbose(3, "allmatch: opcode different"); return 0;} if(ldns_pkt_get_rcode(q) != ldns_pkt_get_rcode(p)) { verbose(3, "allmatch: rcode different"); return 0;} if(ldns_pkt_id(q) != ldns_pkt_id(p)) { verbose(3, "allmatch: id different"); return 0;} if(cmp_bool(ldns_pkt_qr(q), ldns_pkt_qr(p)) != 0) { verbose(3, "allmatch: qr different"); return 0;} if(cmp_bool(ldns_pkt_aa(q), ldns_pkt_aa(p)) != 0) { verbose(3, "allmatch: aa different"); return 0;} if(cmp_bool(ldns_pkt_tc(q), ldns_pkt_tc(p)) != 0) { verbose(3, "allmatch: tc different"); return 0;} if(cmp_bool(ldns_pkt_rd(q), ldns_pkt_rd(p)) != 0) { verbose(3, "allmatch: rd different"); return 0;} if(cmp_bool(ldns_pkt_cd(q), ldns_pkt_cd(p)) != 0) { verbose(3, "allmatch: cd different"); return 0;} if(cmp_bool(ldns_pkt_ra(q), ldns_pkt_ra(p)) != 0) { verbose(3, "allmatch: ra different"); return 0;} if(cmp_bool(ldns_pkt_ad(q), ldns_pkt_ad(p)) != 0) { verbose(3, "allmatch: ad different"); return 0;} if(ldns_pkt_qdcount(q) != ldns_pkt_qdcount(p)) { verbose(3, "allmatch: qdcount different"); return 0;} if(ldns_pkt_ancount(q) != ldns_pkt_ancount(p)) { verbose(3, "allmatch: ancount different"); return 0;} if(ldns_pkt_nscount(q) != ldns_pkt_nscount(p)) { verbose(3, "allmatch: nscount different"); return 0;} if(ldns_pkt_arcount(q) != ldns_pkt_arcount(p)) { verbose(3, "allmatch: arcount different"); return 0;} if(!match_list(ldns_pkt_question(q), ldns_pkt_question(p))) { verbose(3, "allmatch: qd section different"); return 0;} if(!match_list(ldns_pkt_answer(q), ldns_pkt_answer(p))) { verbose(3, "allmatch: an section different"); return 0;} if(!match_list(ldns_pkt_authority(q), ldns_pkt_authority(p))) { verbose(3, "allmatch: ns section different"); return 0;} if(!match_list(ldns_pkt_additional(q), ldns_pkt_additional(p))) { verbose(3, "allmatch: ar section different"); return 0;} if(!match_edns(q, p)) { verbose(3, "edns different."); return 0;} return 1; }
SInt64 JSON::comparef(const JSON& a, const JSON& b) { switch (a.m_type) { case e_null: switch (b.m_type) { case e_null: return cmp_null(a,b); case e_bool: return cmp_bool(a,b); case e_integer: return cmp_integer(a,b); case e_real: return cmp_real(a,b); case e_string: return cmp_string(a,b); case e_array: return cmp_array(a,b); case e_object: return cmp_object(a,b); } case e_bool: switch (b.m_type) { case e_null: return cmp_bool(a,b); case e_bool: return cmp_bool(a,b); case e_integer: return cmp_integer(a,b); case e_real: return cmp_real(a,b); case e_string: return cmp_string(a,b); case e_array: return cmp_array(a,b); case e_object: return cmp_object(a,b); } case e_integer: switch (b.m_type) { case e_null: return cmp_integer(a,b); case e_bool: return cmp_integer(a,b); case e_integer: return cmp_integer(a,b); case e_real: return cmp_real(a,b); case e_string: return cmp_string(a,b); case e_array: return cmp_array(a,b); case e_object: return cmp_object(a,b); } case e_real: switch (b.m_type) { case e_null: return cmp_real(a,b); case e_bool: return cmp_real(a,b); case e_integer: return cmp_real(a,b); case e_real: return cmp_real(a,b); case e_string: return cmp_string(a,b); case e_array: return cmp_array(a,b); case e_object: return cmp_object(a,b); } case e_string: switch (b.m_type) { case e_null: return cmp_string(a,b); case e_bool: return cmp_string(a,b); case e_integer: return cmp_string(a,b); case e_real: return cmp_string(a,b); case e_string: return cmp_string(a,b); case e_array: return cmp_array(a,b); case e_object: return cmp_object(a,b); } case e_array: switch (b.m_type) { case e_null: return cmp_array(a,b); case e_bool: return cmp_array(a,b); case e_integer: return cmp_array(a,b); case e_real: return cmp_array(a,b); case e_string: return cmp_array(a,b); case e_array: return cmp_array(a,b); case e_object: return cmp_object(a,b); } case e_object: switch (b.m_type) { case e_null: return cmp_object(a,b); case e_bool: return cmp_object(a,b); case e_integer: return cmp_object(a,b); case e_real: return cmp_object(a,b); case e_string: return cmp_object(a,b); case e_array: return cmp_object(a,b); case e_object: return cmp_object(a,b); } } Check(); return -1; }