]> andersk Git - moira.git/blobdiff - clients/moira/main.c
if argv[0] == "dcmmaint", then start in dcm menu
[moira.git] / clients / moira / main.c
index 57c772fa5fcfc00578c0899d89812dc0c31dce09..976a4c3c307b515fc627de0753e362ab141db47c 100644 (file)
@@ -1,10 +1,10 @@
-#ifndef lint
+#if (!defined(lint) && !defined(SABER))
   static char rcsid_module_c[] = "$Header$";
 #endif lint
 
-/*     This is the file main.c for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
- *     It Contains:  The main driver for this program.
+/*     This is the file main.c for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
+ *     It Contains: The main driver for the SMS Client.
  *     
  *     Created:        4/12/88
  *     By:             Chris D. Peterson
@@ -13,7 +13,7 @@
  *      $Author$
  *      $Header$
  *     
- *     Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ *     Copyright 1988 by the Massachusetts Institute of Technology.
  *
  *     For further information on copyright and distribution 
  *     see the file mit-copyright.h
 #include <menu.h>
 
 #include "mit-copyright.h"
-#include "allmaint.h"
-#include "allmaint_funcs.h"
+#include "defs.h"
+#include "f_defs.h"
 #include "globals.h"
 
 char * whoami;                 /* used by menu.c ugh!!! */
 
-extern Menu sms_top_menu;
+extern Menu sms_top_menu, list_menu, user_menu, dcm_menu;
 
-static void ErrorExit(), Usage(), SignalHandler();
+#ifndef DEBUG
+static void SignalHandler();
+#endif DEBUG
+
+static void ErrorExit(), Usage();
 char *getlogin();
 uid_t getuid();
 struct passwd *getpwuid();
@@ -44,7 +48,7 @@ struct passwd *getpwuid();
 Bool use_menu = TRUE;          /* whether or not we are using a menu. */
 
 /*     Function Name: main
- *     Description: The main driver for allmaint.
+ *     Description: The main driver for the SMS Client.
  *     Arguments: argc, argv - standard command line args.
  *     Returns: doesn't return.
  */
@@ -55,6 +59,7 @@ main(argc, argv)
     char ** argv;
 {
     int status;
+    Menu *menu;
 
     if ((user = getlogin()) == NULL) 
        user = getpwuid((int) getuid())->pw_name;
@@ -102,13 +107,22 @@ main(argc, argv)
     (void) signal(SIGQUIT, SignalHandler);
 #endif DEBUG
 
+    if (!strcmp(program_name, "listmaint"))
+      menu = &list_menu;
+    else if (!strcmp(program_name, "usermaint"))
+      menu = &user_menu;
+    else if (!strcmp(program_name, "dcmmaint"))
+      menu = &dcm_menu;
+    else
+      menu = &sms_top_menu;
+
     if (use_menu) {            /* Start menus that execute program */
         Start_paging();
-       Start_menu(&sms_top_menu);
+       Start_menu(menu);
        Stop_paging();
     }
     else                       /* Start program without menus. */
-       Start_no_menu(&sms_top_menu);
+       Start_no_menu(menu);
 
     sms_disconnect();
     exit(0);
@@ -144,6 +158,7 @@ Usage()
     exit(1);
 }
 
+#ifndef DEBUG
 /*     Function Name: SignalHandler
  *     Description: This function cleans up from a signal interrupt.
  *     Arguments: none.
@@ -159,3 +174,4 @@ SignalHandler()
     sms_disconnect();
     exit(1);
 }
+#endif DEBUG
This page took 0.055687 seconds and 4 git commands to generate.