/* nag_implementation_separated_details (a00adc) Example Program. * * Copyright 2009 Numerical Algorithms Group. * * Mark 9, 2009. */ #include #include #include #include #include int main(void) { int exit_status = 0; int max_char_len = 180; char *impl, *prec, *pcode, *mkmaj, *mkmin, *hdware, *opsys, *ccomp; char *fcomp, *vend; Nag_Boolean licval; printf("nag_implementation_separated_details (a00adc)" " Example Program Results\n\n"); if (!(impl = NAG_ALLOC(max_char_len, char)) || !(prec = NAG_ALLOC(max_char_len, char)) || !(pcode = NAG_ALLOC(max_char_len, char)) || !(mkmaj = NAG_ALLOC(max_char_len, char)) || !(mkmin = NAG_ALLOC(max_char_len, char)) || !(hdware = NAG_ALLOC(max_char_len, char)) || !(opsys = NAG_ALLOC(max_char_len, char)) || !(ccomp = NAG_ALLOC(max_char_len, char)) || !(fcomp = NAG_ALLOC(max_char_len, char)) || !(vend = NAG_ALLOC(max_char_len, char))) { printf("Allocation failure\n"); exit_status = -1; goto END; } nag_implementation_separated_details(impl, prec, pcode, mkmaj, mkmin, hdware, opsys, ccomp, fcomp, vend, &licval); /* Print implementation details. */ printf("*** Start of NAG C library implementation details ***\n\n"); printf(" Implementation title: %s\n", impl); printf(" Precision: %s\n", prec); printf(" Product Code: %s\n", pcode); printf(" Mark: %s.%s\n", mkmaj, mkmin); if (!strcmp(vend, "(self-contained)")) { printf(" Vendor library: None\n"); } else { printf(" Vendor library: %s\n", vend); } printf(" Applicable to:\n"); printf(" hardware: %s\n", hdware); printf(" operating system: %s\n", opsys); printf(" C compiler: %s\n", ccomp); printf(" FORTRAN compiler: %s\n", fcomp); printf(" and compatible systems.\n"); if (!licval) { printf(" Licence query: %s\n\n", "Unsuccessful"); } else { printf(" Licence query: %s\n\n", "Successful"); } printf(" *** End of NAG C Library implementation details ***\n"); END: if (impl) NAG_FREE(impl); if (prec) NAG_FREE(prec); if (pcode) NAG_FREE(pcode); if (mkmaj) NAG_FREE(mkmaj); if (mkmin) NAG_FREE(mkmin); if (hdware) NAG_FREE(hdware); if (opsys) NAG_FREE(opsys); if (ccomp) NAG_FREE(ccomp); if (fcomp) NAG_FREE(fcomp); if (vend) NAG_FREE(vend); return exit_status; }