NAG Library Manual, Mark 27.2
Interfaces:  FL   CL   CPP   AD 

NAG CL Interface Introduction
Example description
/* nag_info_impl_details_separate (a00adc) Example Program.
 *
 * Copyright 2021 Numerical Algorithms Group.
 *
 * Mark 27.2, 2021.
 */

#include <nag.h>
#include <stdio.h>
#include <string.h>
#include <time.h>

int main(void) {
  int exit_status = 0;
  int max_char_len = 200;
  char *impl = 0, *prec = 0, *pcode = 0, *mkmaj = 0, *mkmin = 0, *hdware = 0,
       *opsys = 0, *ccomp = 0, *fcomp = 0, *vend = 0;
  Nag_Boolean licval;
  time_t t;

  printf("nag_info_impl_details_separate (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_info_impl_details_separate(impl, prec, pcode, mkmaj, mkmin, hdware, opsys,
                                 ccomp, fcomp, vend, &licval);

  /* Print implementation details. */
  printf("*** Start of NAG 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 Library implementation details ***\n");

  printf("\n This program was run on the following date:\n");
  t = time(NULL);
  printf("   %s", ctime(&t));

END:

  NAG_FREE(impl);
  NAG_FREE(prec);
  NAG_FREE(pcode);
  NAG_FREE(mkmaj);
  NAG_FREE(mkmin);
  NAG_FREE(hdware);
  NAG_FREE(opsys);
  NAG_FREE(ccomp);
  NAG_FREE(fcomp);
  NAG_FREE(vend);

  return exit_status;
}