*
* See original copyright at the end of this file
*
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
/* BB_AUDIT SUSv3 compliant with -j and -y extensions (from util-linux). */
*
* Major size reduction... over 50% (>1.5k) on i386.
*/
+
+//usage:#define cal_trivial_usage
+//usage: "[-jy] [[MONTH] YEAR]"
+//usage:#define cal_full_usage "\n\n"
+//usage: "Display a calendar\n"
+//usage: "\n -j Use julian dates"
+//usage: "\n -y Display the entire year"
+
#include "libbb.h"
#include "unicode.h"
};
static const unsigned char sep1752[] ALIGN1 = {
- 1, 2, 14, 15, 16,
+ 1, 2, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23,
24, 25, 26, 27, 28, 29, 30
};
if (julian)
*hp++ = ' ';
{
- char *two_wchars = unicode_conv_to_printable_fixedwidth(NULL, buf, 2);
+ char *two_wchars = unicode_conv_to_printable_fixedwidth(/*NULL,*/ buf, 2);
strcpy(hp, two_wchars);
free(two_wchars);
}
day_array(month, year, dp);
len = sprintf(lineout, "%s %d", month_names[month - 1], year);
printf("%*s%s\n%s\n",
- ((7*julian + WEEK_LEN) - len) / 2, "",
- lineout, day_headings);
+ ((7*julian + WEEK_LEN) - len) / 2, "",
+ lineout, day_headings);
for (row = 0; row < 6; row++) {
build_row(lineout, dp)[0] = '\0';
dp += 7;
sprintf(lineout, "%u", year);
center(lineout,
- (WEEK_LEN * 3 + HEAD_SEP * 2)
- + julian * (J_WEEK_LEN * 2 + HEAD_SEP
- - (WEEK_LEN * 3 + HEAD_SEP * 2)),
- 0);
+ (WEEK_LEN * 3 + HEAD_SEP * 2)
+ + julian * (J_WEEK_LEN * 2 + HEAD_SEP
+ - (WEEK_LEN * 3 + HEAD_SEP * 2)),
+ 0
+ );
puts("\n"); /* two \n's */
for (i = 0; i < 12; i++) {
day_array(i + 1, year, days[i]);