]> andersk Git - moira.git/blobdiff - clients/moira/attach.c
Added some casts for ANSI standard.
[moira.git] / clients / moira / attach.c
index 90ab70aa6426dd0e231461b4b2d3b5daf8529068..569362065878ccc121aeef90ab85bb725c5308b1 100644 (file)
@@ -2,21 +2,20 @@
   static char rcsid_module_c[] = "$Header$";
 #endif
 
-/*     This is the file attach.c for allmaint, the SMS client that allows
- *      a user to maintaint most important parts of the SMS database.
+/*     This is the file attach.c for the SMS Client, which allows a nieve
+ *      user to quickly and easily maintain most parts of the SMS database.
  *     It Contains: Functions for maintaining data used by Hesiod 
  *                   to map courses/projects/users to their file systems, 
  *                   and maintain filesys info. 
  *     
  *     Created:        5/4/88
  *     By:             Chris D. Peterson
- *      Based Upon:     attach.c 87/07/24 marcus
  *
  *      $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"
 
@@ -96,21 +95,21 @@ char *name;
     switch (type) {
     case LABEL:
        if ( (stat = sms_query("get_filesys_by_label", 1, &name,
-                              StoreInfo, &elem)) != 0) {
+                              StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, NULL);
            return(NULL);
        }
        break;
     case MACHINE:
        if ( (stat = sms_query("get_filesys_by_machine", 1, &name,
-                              StoreInfo, &elem)) != 0) {
+                              StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, NULL);
            return(NULL);
        }
        break;
     case GROUP:
        if ( (stat = sms_query("get_filesys_by_group", 1, &name,
-                              StoreInfo, &elem)) != 0) {
+                              StoreInfo, (char *)&elem)) != 0) {
            com_err(program_name, stat, NULL);
            return(NULL);
        }
@@ -119,7 +118,8 @@ char *name;
        args[ALIAS_NAME] = name;
        args[ALIAS_TYPE] = FS_ALIAS_TYPE;
        args[ALIAS_TRANS] = "*";
-       if ( (stat = sms_query("get_alias", 3, args, StoreInfo, &elem)) != 0) {
+       if ( (stat = sms_query("get_alias", 3, args, StoreInfo, 
+                              (char *) &elem)) != 0) {
            com_err(program_name, stat, " in get_alias.");
            return(NULL);
        }
@@ -249,14 +249,10 @@ GetFS(argc, argv)
 int argc;
 char **argv;
 {
-    struct qelem *top, *elem;
+    struct qelem *top;
 
-    top = elem = GetFSInfo(LABEL, argv[1]); /* get info. */
-    while(elem != NULL) {
-       char ** info = (char **) elem->q_data;
-       (void) PrintFSInfo(info);
-       elem = elem->q_forw;
-    }
+    top = GetFSInfo(LABEL, argv[1]); /* get info. */
+    Loop(top, (void *) PrintFSInfo);
     FreeQueue(top);            /* clean the queue. */
     return (DM_NORMAL);
 }
@@ -409,17 +405,11 @@ GetFSAlias(argc, argv)
 int argc;
 char **argv;
 {
-    struct qelem *top, *elem;
-
-    top = elem = GetFSInfo(ALIAS, argv[1]);
+    struct qelem *top;
 
+    top = GetFSInfo(ALIAS, argv[1]);
     Put_message(" ");          /* blank line. */
-    while (elem != NULL) {
-       char **info = (char **) elem->q_data;
-       PrintFSAlias(info);
-       elem = elem->q_forw;
-    }
-
+    Loop(top, (void *) PrintFSAlias);
     FreeQueue(top);
     return(DM_NORMAL);
 }
@@ -456,7 +446,8 @@ char **argv;
  * print out values, free memory used and then exit.
  */
 
-    if ( (stat = sms_query("get_alias", 3, args, StoreInfo, &elem)) == 0) {
+    if ( (stat = sms_query("get_alias", 3, args, StoreInfo, 
+                          (char *)&elem)) == 0) {
        top = elem = QueueTop(elem);
        while (elem != NULL) {
            info = (char **) elem->q_data;          
This page took 0.041838 seconds and 4 git commands to generate.