summaryrefslogtreecommitdiff
path: root/misc-utils/cal.c
diff options
context:
space:
mode:
authorKarel Zak <kzak@redhat.com>2006-12-07 00:26:54 +0100
committerKarel Zak <kzak@redhat.com>2006-12-07 00:26:54 +0100
commit48d7b13a1eab85fab91c8d6c5ddf298f733c74f5 (patch)
tree8813d36590ee3361bd75f57a12fd2032e9296ddb /misc-utils/cal.c
parent2ab8f9d3cec110ce8291f2525fe90239aeef8376 (diff)
downloadutil-linux-old-48d7b13a1eab85fab91c8d6c5ddf298f733c74f5.tar.gz
Imported from util-linux-2.13-pre1 tarball.
Diffstat (limited to 'misc-utils/cal.c')
-rw-r--r--misc-utils/cal.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/misc-utils/cal.c b/misc-utils/cal.c
index 83015ea9..c55777a7 100644
--- a/misc-utils/cal.c
+++ b/misc-utils/cal.c
@@ -66,15 +66,15 @@
#include <locale.h>
#include "errs.h"
#include "nls.h"
-#include "../defines.h"
-#if defined(HAVE_ncurses)
+#if defined(HAVE_NCURSES)
-#if NCH
+#ifdef HAVE_NCURSES_H
#include <ncurses.h>
-#else
-#include <curses.h>
+#elif defined(HAVE_NCURSES_NCURSES_H)
+#include <ncurses/ncurses.h>
#endif
+
#include <term.h> /* include after <curses.h> */
static void
@@ -92,7 +92,7 @@ my_tgetstr(char *s, char *ss) {
return tigetstr(ss);
}
-#elif defined(HAVE_termcap)
+#elif defined(HAVE_LIBTERMCAP)
#include <termcap.h>
@@ -119,7 +119,7 @@ my_tgetstr(char *s, char *ss) {
const char *term="";
const char *Senter="", *Sexit="";/* enter and exit standout mode */
-#ifdef HAVE_langinfo_h
+#ifdef HAVE_LANGINFO_H
# include <langinfo.h>
#else
# include <localeinfo.h> /* libc4 only */
@@ -255,7 +255,7 @@ main(int argc, char **argv) {
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
-#if defined(HAVE_ncurses) || defined(HAVE_termcap)
+#if defined(HAVE_NCURSES) || defined(HAVE_LIBTERMCAP)
if ((term = getenv("TERM"))) {
int ret;
my_setupterm(term, 1, &ret);
@@ -283,7 +283,7 @@ main(int argc, char **argv) {
* At some future time this may become -s for Sunday, -m for Monday,
* no option for glibc-determined locale-dependent version.
*/
-#ifdef HAVE_langinfo_h
+#ifdef HAVE_LANGINFO_H
week1stday = (int)(nl_langinfo(_NL_TIME_FIRST_WEEKDAY))[0];
#endif
#endif
@@ -310,8 +310,8 @@ main(int argc, char **argv) {
yflag = 1;
break;
case 'V':
- printf(_("%s from %s\n"),
- progname, util_linux_version);
+ printf(_("%s from %s%s\n"),
+ progname, "util-linux-", VERSION);
return 0;
case '?':
default:
@@ -378,7 +378,7 @@ void headers_init(void)
wcscpy(j_day_headings_wc,L"");
#endif
-#ifdef HAVE_langinfo_h
+#ifdef HAVE_LANGINFO_H
# define weekday(wd) nl_langinfo(ABDAY_1+wd)
#else
# define weekday(wd) _time_info->abbrev_wkday[wd]
@@ -414,7 +414,7 @@ void headers_init(void)
#undef weekday
for (i = 0; i < 12; i++) {
-#ifdef HAVE_langinfo_h
+#ifdef HAVE_LANGINFO_H
full_month[i] = nl_langinfo(MON_1+i);
#else
full_month[i] = _time_info->full_month[i];
@@ -457,7 +457,7 @@ monthly(int day, int month, int year) {
do_monthly(day, month, year, &out);
for (i = 0; i < FMT_ST_LINES; i++) {
-#if defined(HAVE_ncurses) || defined(HAVE_termcap)
+#if defined(HAVE_NCURSES) || defined(HAVE_LIBTERMCAP)
my_putstring(out.s[i]);putchar('\n');
#else
puts(out.s[i]);
@@ -502,7 +502,7 @@ monthly3(int day, int month, int year) {
width, out_prev.s[i],
width, out_curm.s[i],
width, out_next.s[i]);
-#if defined(HAVE_ncurses) || defined(HAVE_termcap)
+#if defined(HAVE_NCURSES) || defined(HAVE_LIBTERMCAP)
my_putstring(lineout);
#else
fputs(lineout,stdout);
@@ -539,7 +539,7 @@ j_yearly(int day, int year) {
}
*p = '\0';
trim_trailing_spaces(lineout);
-#if defined(HAVE_ncurses) || defined(HAVE_termcap)
+#if defined(HAVE_NCURSES) || defined(HAVE_LIBTERMCAP)
my_putstring(lineout);putchar('\n');
#else
puts(lineout);
@@ -579,7 +579,7 @@ yearly(int day, int year) {
}
*p = '\0';
trim_trailing_spaces(lineout);
-#if defined(HAVE_ncurses) || defined(HAVE_termcap)
+#if defined(HAVE_NCURSES) || defined(HAVE_LIBTERMCAP)
my_putstring(lineout);putchar('\n');
#else
puts(lineout);