CrIS Code Collection
Functions
doy2day.c File Reference
#include "libcris.h"

Go to the source code of this file.

Functions

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

Function Documentation

◆ main()

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

Definition at line 3 of file doy2day.c.

5 {
6
7 int day, mon;
8
9 /* Check arguments... */
10 if (argc < 3)
11 ERRMSG("Give parameters: <year> <doy>");
12
13 /* Read arguments... */
14 const int year = atoi(argv[1]);
15 const int doy = atoi(argv[2]);
16
17 /* Convert... */
18 doy2day(year, doy, &mon, &day);
19 printf("%d %d %d\n", year, mon, day);
20
21 return EXIT_SUCCESS;
22}
#define ERRMSG(...)
Print error message and quit program.
Definition: jurassic.h:237
void doy2day(const int year, const int doy, int *mon, int *day)
Get date from day of year.
Definition: libcris.c:298
Here is the call graph for this function: