Commit Graph

24 Commits

Author SHA1 Message Date
FRIGN
8ffa06b3dc Add little estrtonum()-range-fix 2015-03-08 21:35:16 +01:00
FRIGN
76ad86b2a3 Audit cal(1)
1) Update manpage with the num-syntax.
2) Use size_t for years and derivatives.
3) Use putchar instead of printf wherever possible.
4) Update usage().
5) Style changes.
2015-03-08 21:28:32 +01:00
FRIGN
8c359daee3 Convert cal(1) to strtonum 2015-01-30 16:01:37 +01:00
FRIGN
40bbe91c9e Fix a small error in cal(1) manpage
The current implementation doesn't implement the day-variable.
2015-01-16 21:48:50 +00:00
FRIGN
f8177c8ca4 cal(1) cleanup
According to suckless coding guidelines.
2015-01-16 21:22:24 +00:00
Greg Reagle
efac15726b If only the year operand is given, cal shall produce a calendar for all twelve months in the given calendar year. 2015-01-16 16:26:42 +00:00
Greg Reagle
6c2074560e Use the Julian/Gregorian calendar
Use the Julian calendar for dates through September 2, 1752 and
the Gregorian calendar for dates from September 14, 1752.
2015-01-16 10:03:18 +00:00
Greg Reagle
83616df6fc cal: Removed unused "day" variable 2015-01-07 03:21:12 +00:00
Greg Reagle
c6f1e8aa20 Various cal(1) improvements
1) No limit on number of months (removed MONTHMAX)
2) Strings printed to stdout rather than copied to an internal buffer
3) Rewritten date calculation algorithms
2015-01-02 13:14:41 +00:00
Markus Wichmann
fea48eb229 Fix problem with multi month display spanning a year. 2014-12-16 10:56:13 +00:00
FRIGN
ec8246bbc6 Un-boolify sbase
It actually makes the binaries smaller, the code easier to read
(gems like "val == true", "val == false" are gone) and actually
predictable in the sense of that we actually know what we're
working with (one bitwise operator was quite adventurous and
should now be fixed).

This is also more consistent with the other suckless projects
around which don't use boolean types.
2014-11-14 10:54:20 +00:00
FRIGN
eee98ed3a4 Fix coding style
It was about damn time. Consistency is very important in such a
big codebase.
2014-11-13 18:08:43 +00:00
sin
0c5b7b9155 Stop using EXIT_{SUCCESS,FAILURE} 2014-10-02 23:46:59 +01:00
Willem van de Krol
f02f2190f0 fixed incorrect fday handling in dayofweek() function 2014-07-04 21:47:36 +01:00
Willem van de Krol
5721deb2c4 optimized isleap() function 2014-07-04 21:47:12 +01:00
Hiltjo Posthuma
953ebf3573 code style
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-06-01 18:02:30 +01:00
Hiltjo Posthuma
f7403ce6c6 style: whitespace fixes
Signed-off-by: Hiltjo Posthuma <hiltjo@codemadness.org>
2014-04-01 16:20:43 +01:00
sin
b5a511dacf Exit with EXIT_SUCCESS/EXIT_FAILURE instead of 0 and 1
Fixed for consistency purposes.
2013-10-07 16:44:22 +01:00
sin
af4af8a0d8 Change sprintf to snprintf
cal.c:40: warning: sprintf() is often misused, please use snprintf()
2013-07-20 00:54:49 -04:00
Christoph Lohmann
45f67c556b Another correction for the cal(1) usage. 2013-06-19 23:24:34 +02:00
Jesse Ogle
6442071c29 Updated cal usage()
Now usage matches cal.1

Signed-off-by: Christoph Lohmann <20h@r-36.net>
2013-06-19 23:23:59 +02:00
Jesse Ogle
8fc4858a3c Bugfix for cal when columns specified as 0
cal -c 0 caused an infinite loop. now the number of columns is set to
the number of months when 0 (i.e. the calendars never wrap).

Signed-off-by: Christoph Lohmann <20h@r-36.net>
2013-06-19 23:23:43 +02:00
Christoph Lohmann
b10b1da57d Make date(1) compatible to GNU date(1).
We have variable first day of weeks now! My week starts on Wednesday!
2013-06-19 22:10:26 +02:00
Jesse Ogle
0f523ec9c6 Added cal and updated Makefile
Signed-off-by: Christoph Lohmann <20h@r-36.net>
2013-06-19 21:13:28 +02:00