#include <signal.h>
#include <stdio.h>
#include <string.h>
-#if 0
-#include <pwd.h>
-#include <sys/types.h>
-#endif
#include <krb.h>
}
};
+#ifdef HAVE_CURSES
Bool use_menu = TRUE; /* whether or not we are using a menu. */
+#endif
/* Function Name: main
* Description: The main driver for the Moira Client.
if (**arg == '-')
{
if (!strcmp(*arg, "-nomenu"))
- use_menu = FALSE;
+ {
+#ifdef HAVE_CURSES
+ use_menu = FALSE;
+#else
+ ;
+#endif
+ }
+ else if (!strcmp(*arg, "-menu"))
+ {
+#ifdef HAVE_CURSES
+ use_menu = TRUE;
+#else
+ fprintf(stderr, "%s: No curses support. -menu option ignored\n",
+ whoami);
+#endif
+ }
else if (!strcmp(*arg, "-db"))
if (arg - argv < argc - 1)
{
act.sa_handler = Signal_Handler;
sigaction(SIGHUP, &act, NULL);
sigaction(SIGQUIT, &act, NULL);
+#ifdef HAVE_CURSES
if (use_menu)
sigaction(SIGINT, &act, NULL);
else
+#endif
{
act.sa_handler = CatchInterrupt;
sigaction(SIGINT, &act, NULL);
menu = &namespace_menu;
+#ifdef HAVE_CURSES
if (use_menu) /* Start menus that execute program */
{
Start_paging();
Stop_paging();
}
else /* Start program without menus. */
+#endif
Start_no_menu(menu);
mr_disconnect();
static void Signal_Handler(void)
{
Put_message("Signal caught - exiting");
+#ifdef HAVE_CURSES
if (use_menu)
Cleanup_menu();
+#endif
mr_disconnect();
exit(1);
}