Lines Matching +full:force +full:- +full:m1
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
113 switches + sizeof(switches) / sizeof(struct djswitch) - 2;
200 int flag_backward = 0; /* user called cal--backward compat. */ in main()
206 int flag_3months = 0; /* user wants 3 month display (-3) */ in main()
209 int flag_specifiedmonth = 0;/* user wants to see this month (-m) */ in main()
235 strcmp(locale, "US-ASCII") == 0) in main()
239 if ((cp = strstr(locale, p->cc)) != NULL && *(cp - 1) == '_') in main()
242 nswitch = ndaysj(&dftswitch->dt); in main()
244 nswitch = ndaysj(&p->dt); in main()
260 before = after = -1; in main()
262 while ((ch = getopt(argc, argv, "3A:B:Cd:eH:hjJm:Nops:wyM")) != -1) in main()
269 errx(EX_USAGE, "Double -A specified"); in main()
273 "Argument to -A must be positive"); in main()
277 errx(EX_USAGE, "Double -B specified"); in main()
281 "Argument to -B must be positive"); in main()
317 errx(EX_USAGE, "Double -m specified"); in main()
339 p != q && strcmp(p->cc, optarg) != 0; p++) in main()
344 nswitch = ndaysj(&(p->dt)); in main()
358 argc -= optind; in main()
386 y = tm->tm_year + 1900; in main()
387 m = tm->tm_mon + 1; in main()
404 * -3 with -A or -B in main()
405 * -3 displays 3 months, -A and -B change that behaviour. in main()
406 * -3 with -y in main()
407 * -3 displays 3 months, -y says display a whole year. in main()
408 * -3 with a given year but no given month or without -m in main()
409 * -3 displays 3 months, no month specified doesn't make clear in main()
411 * -m with a given month in main()
413 * -y with -m in main()
414 * -y displays the whole year, -m displays a single month. in main()
415 * -y with a given month in main()
416 * -y displays the whole year, the given month displays a single in main()
418 * -y with -A or -B in main()
419 * -y displays the whole year, -A and -B display extra months. in main()
422 /* -3 together with -A or -B. */ in main()
424 errx(EX_USAGE, "-3 together with -A and -B is not supported."); in main()
425 /* -3 together with -y. */ in main()
427 errx(EX_USAGE, "-3 together with -y is not supported."); in main()
428 /* -3 together with givenyear but no givenmonth. */ in main()
432 "-3 together with a given year but no given month is " in main()
434 /* -m together with xx xxxx. */ in main()
437 "-m together with a given month is not supported."); in main()
438 /* -y together with -m. */ in main()
440 errx(EX_USAGE, "-y together with -m is not supported."); in main()
441 /* -y together with xx xxxx. */ in main()
443 errx(EX_USAGE, "-y together a given month is not supported."); in main()
444 /* -y together with -A or -B. */ in main()
446 errx(EX_USAGE, "-y together a -A or -B is not supported."); in main()
474 if (after == -1) in main()
476 if (before == -1) in main()
490 dt.y = tm1->tm_year + 1900; in main()
491 dt.m = tm1->tm_mon + 1; in main()
492 dt.d = tm1->tm_mday; in main()
514 "Usage: cal [general options] [-hjy] [[month] year]\n" in usage()
515 " cal [general options] [-hj] [-m month] [year]\n" in usage()
516 " ncal [general options] [-hJjpwy] [-s country_code] [[month] year]\n" in usage()
517 " ncal [general options] [-hJeo] [year]\n" in usage()
518 "General options: [-NCM3] [-A months] [-B months]\n" in usage()
519 "For debug the highlighting: [-H yyyy-mm-dd] [-d yyyy-mm]\n", in usage()
532 #define FSTR "%c%s %-15s%4d-%02d-%02d" in printcc()
534 #define FSTRARG(p) DFLT(p), (p)->cc, (p)->nm, (p)->dt.y, (p)->dt.m, (p)->dt.d in printcc()
552 static int d_first = -1; in printeaster()
556 /* force orthodox easter for years before 1583 */ in printeaster()
569 tm.tm_year = dt.y - 1900; in printeaster()
570 tm.tm_mon = dt.m - 1; in printeaster()
578 if (--m == 0) { \
580 y--; \
590 /* Print all months for the period in the range [ before .. y-m .. after ]. */
602 int m1, m2; in monthrangeb() local
604 int prevyear = -1; in monthrangeb()
612 before--; in monthrangeb()
615 m1 = y * 12 + m - 1; in monthrangeb()
616 m2 = m1 + after; in monthrangeb()
625 printyearheader = (after >= mpl - 1) && (M2M(m1) - 1) % mpl == 0; in monthrangeb()
627 m = m1; in monthrangeb()
631 mkmonthb(M2Y(m + i), M2M(m + i) - 1, jd_flag, year + i); in monthrangeb()
636 if (m != m1) in monthrangeb()
649 wprintf(L"%-*ls ", in monthrangeb()
653 L"%-ls %d", year[i].name, M2Y(m + i)); in monthrangeb()
654 wprintf(L"%-*ls ", mw, wcenter(ws1, ws, mw)); in monthrangeb()
674 printf("%-*s ", in monthrangeb()
693 int m1, m2; in monthranger() local
694 int prevyear = -1; in monthranger()
702 before--; in monthranger()
705 m1 = y * 12 + m - 1; in monthranger()
706 m2 = m1 + after; in monthranger()
715 printyearheader = (after >= mpl - 1) && (M2M(m1) - 1) % mpl == 0; in monthranger()
717 m = m1; in monthranger()
721 mkmonthr(M2Y(m + i), M2M(m + i) - 1, jd_flag, year + i); in monthranger()
726 if (m != m1) in monthranger()
740 wprintf(L"%-*ls", mw, year[i].name); in monthranger()
742 wprintf(L"%-ls %-*d", year[i].name, in monthranger()
743 mw - wcslen(year[i].name) - 1, M2Y(m + i)); in monthranger()
753 printf("%-*s", in monthranger()
763 printf("%-*s", mw, year[i].weeks); in monthranger()
791 wcsftime(mlines->name, sizeof(mlines->name) / sizeof(mlines->name[0]), in mkmonthr()
793 mlines->name[0] = towupper(mlines->name[0]); in mkmonthr()
813 firstm = first - weekday(first); in mkmonthr()
834 dt.d = j - jan1 + 1; in mkmonthr()
838 highlight(mlines->lines[i] + k, in mkmonthr()
841 memcpy(mlines->lines[i] + k + l, in mkmonthr()
844 memcpy(mlines->lines[i] + k + l, " ", dw); in mkmonthr()
846 mlines->lines[i][k + l] = '\0'; in mkmonthr()
847 mlines->extralen[i] = l; in mkmonthr()
854 memset(mlines->weeks + k, ' ', dw); in mkmonthr()
856 memcpy(mlines->weeks + k, in mkmonthr()
858 mlines->weeks[k] = '\0'; in mkmonthr()
890 wcsftime(mlines->name, sizeof(mlines->name) / sizeof(mlines->name[0]), in mkmonthb()
892 mlines->name[0] = towupper(mlines->name[0]); in mkmonthb()
926 firstsm = first - weekday(first); in mkmonthb()
928 firstsm = first - (weekday(first) + 1) % 7; in mkmonthb()
941 dt.d = j - jan1 + 1; in mkmonthb()
945 highlight(mlines->lines[i] + k, in mkmonthb()
948 memcpy(mlines->lines[i] + k + l, in mkmonthb()
951 memcpy(mlines->lines[i] + k + l, " ", dw); in mkmonthb()
954 mlines->lines[i][1] = '\0'; in mkmonthb()
956 mlines->lines[i][k + l] = '\0'; in mkmonthb()
957 mlines->extralen[i] = l; in mkmonthb()
974 for (len = 2; len > 0; --len) { in mkweekdays()
978 wmemset(wds->names[i], L'\0', 4); in mkweekdays()
980 wds->names[i][0] = L' '; in mkweekdays()
981 wcsncat(wds->names[i], buf, len); in mkweekdays()
982 wcsncat(wds->names[i], L" ", 1); in mkweekdays()
1070 sprintf(s, "%.*s%s", (int)(w - strlen(t)) / 2, blanks, t); in center()
1081 swprintf(s, MAX_WIDTH, L"%.*s%ls", (int)(w - wcslen(t)) / 2, blanks, t); in wcenter()
1102 ny--; in parsemonth()
1160 len--; in highlight()
1176 len--; in highlight()
1187 len--; in highlight()