Search
SailfishOS Open Build Service
>
Projects
>
sailfishos
:
chum
:
testing
>
ddate
> PR12.diff
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File PR12.diff of Package ddate
diff --git a/README.org b/README.org index 6a14e38..604488b 100644 --- a/README.org +++ b/README.org @@ -52,7 +52,7 @@ Occurs once every four years (1 + 4 = 5) and is inserted between the 59th and 60th days of the Season of Chaos. ** THE YEAR -| | | | | | | | ST | BT | PD | PP | SO | | | | | | | | | SM | BT | PD | PP | SO | | +| | | | | | | | SM | BT | PD | PP | SO | | | | | | | | | SM | BT | PD | PP | SO | | |-----+----+----+----+----+-----+---+----+----+----+----+----+-----+-----+----+----+----+----+----+---+----+----+----+----+----+-----| | Jan | 1 | 2 | 3 | 4 | 5 | | 1 | 2 | 3 | 4 | 5 | Chs | Jul | 5 | 6 | 7 | 8 | 9 | | 40 | 41 | 42 | 43 | 44 | Cfn | | | 6 | 7 | 8 | 9 | 10 | | 6 | 7 | 8 | 9 | 10 | | | 10 | 11 | 12 | 13 | 14 | | 45 | 46 | 47 | 48 | 49 | | diff --git a/ddate.c b/ddate.c index c0a6bf3..3e34fd4 100644 --- a/ddate.c +++ b/ddate.c @@ -43,6 +43,9 @@ 15th of Confusion, 3180: - call out adherents of the wrong fruit + 3181-Afm-51 Jim Wisniewski <wisnij+ddate@gmail.com> + - added ISO_FORMAT option + FIVE TONS OF FLAX */ @@ -54,6 +57,12 @@ #define OLD_IMMEDIATE_FMT +/* If you wish to use the ISO 8601 format for aneristic dates (y-m-d), as + * opposed to the Commonwealth format, define ISO_FORMAT. + */ + +/* #define ISO_FORMAT */ + /* If you wish to use the US format for aneristic dates (m-d-y), as opposed to * the Commonwealth format, define US_FORMAT. */ @@ -214,12 +223,17 @@ main (int argc, char *argv[]) { if (argc-pi==3){ int moe=atoi(argv[pi]), larry=atoi(argv[pi+1]), curly=atoi(argv[pi+2]); hastur=makeday( -#ifdef US_FORMAT - moe,larry, +#ifdef ISO_FORMAT + larry,curly,moe #else +# ifdef US_FORMAT + moe,larry, +# else larry,moe, +# endif + curly #endif - curly); + ); if (hastur.season == -1) { printf("Invalid date -- out of range\n"); return -1; @@ -227,7 +241,15 @@ main (int argc, char *argv[]) { fnord=fnord?fnord:default_fmt; } else if (argc!=pi) { usage: - fprintf(stderr,("usage: %s [+format] [day month year]\n"), argv[0]); + fprintf(stderr,("usage: %s [+format] [" +#if defined(ISO_FORMAT) + "year month day" +#elif defined(US_FORMAT) + "month day year" +#else + "day month year" +#endif + "]\n"), argv[0]); exit(1); } else { t= time(NULL);