CrIS Code Collection
Functions
day2doy.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 day2doy.c.

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