JURASSIC
Functions
day2doy.c File Reference

Convert date to day of year. More...

#include "jurassic.h"

Go to the source code of this file.

Functions

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

Detailed Description

Convert date to day of year.

Definition in file day2doy.c.

Function Documentation

◆ main()

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

Definition at line 39 of file day2doy.c.

41 {
42
43 int doy;
44
45 /* Print usage information... */
46 USAGE;
47
48 /* Check arguments... */
49 if (argc < 4)
50 ERRMSG("Missing or invalid command-line arguments.\n\n"
51 "Usage: day2doy <year> <mon> <day>\n\n" "Use -h for full help.");
52
53 /* Read arguments... */
54 const int year = atoi(argv[1]);
55 const int mon = atoi(argv[2]);
56 const int day = atoi(argv[3]);
57
58 /* Convert... */
59 day2doy(year, mon, day, &doy);
60 printf("%d %d\n", year, doy);
61
62 return EXIT_SUCCESS;
63}
void day2doy(int year, int mon, int day, int *doy)
Convert a calendar date to day-of-year.
Definition: jurassic.c:3358
#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: