]> andersk Git - moira.git/blobdiff - clients/moira/cluster.c
Added some casts for ANSI standard.
[moira.git] / clients / moira / cluster.c
index 352ee8f17e750adcc8c8b43e7c180bb409e5da54..54802521b06bdb2441c2ff1b764c9bd7f54fa979 100644 (file)
@@ -2,19 +2,18 @@
   static char rcsid_module_c[] = "$Header$";
 #endif lint
 
-/*     This is the file cluseter.c for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
+/*     This is the file cluster.c for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
  *     It Contains: 
  *     
  *     Created:        4/22/88
  *     By:             Chris D. Peterson
- *      Based upon:  Clusermaint.c by marcus: 87/07/22
  *
  *      $Source$
  *      $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
@@ -28,8 +27,8 @@
 #include <menu.h>
 
 #include "mit-copyright.h"
-#include "allmaint.h"
-#include "allmaint_funcs.h"
+#include "defs.h"
+#include "f_defs.h"
 #include "globals.h"
 #include "infodefs.h"
 
@@ -101,8 +100,7 @@ char ** info;
     Put_message("");
     sprintf(buf, "Machine: %-30s Type: %s", info[M_NAME], info[M_TYPE]);
     Put_message(buf);
-    sprintf(buf, "Last Modified at %s, by %s with %s",info[M_MODTIME],
-           info[M_MODBY], info[M_MODWITH]);
+    sprintf(buf, MOD_FORMAT, info[M_MODBY], info[M_MODTIME], info[M_MODWITH]);
     Put_message(buf);
     return(info[M_NAME]);
 }
@@ -127,8 +125,7 @@ char ** info;
     Put_message(buf);
     sprintf(buf, "Location:    %s", info[C_LOCATION]);
     Put_message(buf);
-    sprintf(buf, "Last Modified at %s, by %s with %s",info[C_MODTIME],
-           info[C_MODBY], info[C_MODWITH]);
+    sprintf(buf, MOD_FORMAT, info[C_MODBY], info[C_MODTIME], info[C_MODWITH]);
     Put_message(buf);
     return(info[C_NAME]);
 }
@@ -190,14 +187,14 @@ char * name1, *name2;
     switch (type) {
     case MACHINE:
        if ( (stat = sms_query("get_machine", 1, &name1,
-                              StoreInfo, &elem)) != 0) {
+                              StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, " in get_machine.");
            return(NULL);
        }
        break;
     case CLUSTER:
        if ( (stat = sms_query("get_cluster",  1, &name1,
-                              StoreInfo, &elem)) != 0) {
+                              StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, " in get_cluster.");
            return(NULL);
        }
@@ -206,7 +203,7 @@ char * name1, *name2;
        args[MAP_MACHINE] = name1;
        args[MAP_CLUSTER] = name2;
        if ( (stat = sms_query("get_machine_to_cluster_map", 2, args,
-                              StoreInfo, &elem)) != 0) {
+                              StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, " in get_machine_to_cluster_map.");
            return(NULL);
        }
@@ -215,7 +212,7 @@ char * name1, *name2;
        args[CD_NAME] = name1;
        args[CD_LABEL] = name2;
        if ( (stat = sms_query("get_cluster_data", 2, args,
-                              StoreInfo, &elem)) != 0) {
+                              StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, " in get_cluster_data.");
            return(NULL);
        }
@@ -439,7 +436,7 @@ Bool ask_user;
     args[0] = name;
     args[1] = "*";
     stat = sms_query("get_machine_to_cluster_map", 2, args, 
-                        StoreInfo, &elem);
+                        StoreInfo, (char *)&elem);
     if (stat && stat != SMS_NO_MATCH) {
        com_err(program_name, stat, " in get_machine_to_cluster_map.");
        return(DM_NORMAL);
@@ -675,14 +672,14 @@ char ** argv;
     args[MAP_END] = NULL;
 
     stat = sms_query("get_machine_to_cluster_map", CountArgs(args), args,
-                    StoreInfo, &elem);
+                    StoreInfo, (char *)&elem);
     if (stat == SMS_NO_MATCH) {
        sprintf(buf, "The machine %s is not is the cluster %s.",
                args[MAP_MACHINE], args[MAP_CLUSTER]);
        Put_message(buf);
        return(DM_NORMAL);
     }
-    if (stat)
+    if (stat != SMS_SUCCESS)
        com_err(program_name, stat, " in delete_machine_from_cluster");
 
     elem = QueueTop(elem);
@@ -821,7 +818,7 @@ Bool ask_first;
     args[MAP_MACHINE] = "*";
     args[MAP_CLUSTER] = name;
     stat = sms_query("get_machine_to_cluster_map", 2, args, 
-                        StoreInfo, &elem);
+                        StoreInfo, (char *)&elem);
     if (stat && stat != SMS_NO_MATCH) {
        com_err(program_name, stat, " in get_machine_to_cluster_map.");
        return(DM_NORMAL);
@@ -1063,25 +1060,6 @@ char **argv;
     return(DM_NORMAL);
 }
 
-/*     Function Name: MachinesInCluster
- *     Description: Shows all machines in a give cluster.
- *     Arguments: argv, argc - name of cluster in argv[1].
- *     Returns: DM_NORMAL;
- */
-
-/* ARGSUSED */
-int
-MachinesInCluster(argc, argv)
-int argc;
-char **argv;
-{
-    char *info[10];
-    info[0] = argv[0];
-    info[2] = argv[1];
-    info[1] = "*";
-    return(MachineToClusterMap(3, info));
-}
-
 /* 
  * Local Variables:
  * mode: c
This page took 0.041259 seconds and 4 git commands to generate.