48 ERRMSG(
"Missing or invalid command-line arguments.\n\n"
49 "Usage: doy2day <year> <doy>\n\n" "Use -h for full help.");
52 const int year = atoi(argv[1]);
53 const int doy = atoi(argv[2]);
58 printf(
"%d %d %d\n", year, mon, day);
69 printf(
"\nMPTRAC doy2day tool.\n\n");
70 printf(
"Convert year and day of year to calendar date.\n");
73 printf(
" doy2day <year> <doy>\n");
75 printf(
"Arguments:\n");
76 printf(
" <year> Year.\n");
77 printf(
" <doy> Day of year.\n");
78 printf(
"\nFurther information:\n");
79 printf(
" Manual: https://slcs-jsc.github.io/mptrac/\n");
int main(int argc, char *argv[])
void usage(void)
Print command-line help.
void doy2day(const int year, const int doy, int *mon, int *day)
Converts a given day of the year (DOY) to a date (month and day).
MPTRAC library declarations.
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
#define USAGE
Print usage information on -h or --help.