LCOV - code coverage report
Current view: top level - atnf/rpfits - utdate.c (source / functions) Hit Total Coverage
Test: casacpp_coverage.info Lines: 0 7 0.0 %
Date: 2024-10-29 13:38:20 Functions: 0 1 0.0 %

          Line data    Source code
       1             : /*============================================================================
       2             : *   Fortran wrapper for the unix library functions time(2) and gmtime(3) to
       3             : *   get the current UTC year, month and day.  Replaces the non-standard
       4             : *   Fortran intrinsics TIME and GMTIME for use by DATFIT.
       5             : *
       6             : *   Author: Mark Calabretta, Australia Telescope National Facility
       7             : *   $Id: utdate.c,v 1.1 2006/10/25 01:50:07 cal103 Exp $
       8             : *===========================================================================*/
       9             : 
      10             : #include <time.h>
      11             : 
      12           0 : void utdate_(int *year, int *month, int *day)
      13             : 
      14             : {
      15             :   time_t now;
      16             :   struct tm *utc;
      17             : 
      18           0 :   time(&now);
      19           0 :   utc = gmtime(&now);
      20             : 
      21           0 :   *year  = 1900 + utc->tm_year;
      22           0 :   *month =    1 + utc->tm_mon;
      23           0 :   *day   = utc->tm_mday;
      24             : 
      25           0 :   return;
      26             : }

Generated by: LCOV version 1.16