JURASSIC
Functions
doy2day.c File Reference

Convert day of year to date. More...

#include "jurassic.h"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Detailed Description

Convert day of year to date.

Definition in file doy2day.c.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 39 of file doy2day.c.

41 {
42
43 int day, mon;
44
45 /* Print usage information... */
46 USAGE;
47
48 /* Check arguments... */
49 if (argc < 3)
50 ERRMSG("Missing or invalid command-line arguments.\n\n"
51 "Usage: doy2day <year> <doy>\n\n" "Use -h for full help.");
52
53 /* Read arguments... */
54 const int year = atoi(argv[1]);
55 const int doy = atoi(argv[2]);
56
57 /* Convert... */
58 doy2day(year, doy, &mon, &day);
59 printf("%d %d %d\n", year, mon, day);
60
61 return EXIT_SUCCESS;
62}
void doy2day(int year, int doy, int *mon, int *day)
Convert a day-of-year value to a calendar date.
Definition: jurassic.c:3378
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
Definition: jurassic.h:1325
#define USAGE
Print usage information on -h or --help.
Definition: jurassic.h:1206
Here is the call graph for this function: