#include #include #include "mag_snapshot.h" void snapcall(istat, string, snapdat, nrec) int *istat; struct dsc$descriptor_s *string; struct MagSnapSet *snapdat; int *nrec; { int j; int snapcnt; char c; char newstring[100] = ""; /* Convert Fortran character string to C character string */ for (j = 0; j < string->dsc$w_length; ++j) { c = string->dsc$a_pointer[j]; /* extract Fortran string characters */ if ( c != ' ' ) strcat(newstring,&c); /* build C character string */ } /* retrieve MAG Snapshot records */ *istat = rd_snap(newstring,snapdat,&snapcnt); if ( *istat < 0 ) { printf("SNAPCALL: No MAG snapshot data"); *nrec = 0; return; } printf("Number of MAG Snapshot records is %d\n",snapcnt); *nrec = snapcnt; /* j = *nrec; printf("C MAG SNAP values, record # %d\n",*nrec); printf("sc clock = %8d\n", snapdat[j].sctime_readout); */ }