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
#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"
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);
}
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);
}
sprintf(print_buf, "User Ownership: %-30s Group Ownership: %s",
info[FS_OWNER], info[FS_OWNERS]);
Put_message(print_buf);
- sprintf(print_buf, "Auto Create %-34s Locker Type: %s",info[FS_CREATE],
+ sprintf(print_buf, "Auto Create: %-34s Locker Type: %s",
+ atoi(info[FS_CREATE]) ? "ON" : "OFF",
info[FS_L_TYPE]);
Put_message(print_buf);
- sprintf(print_buf, "Last Modified at %s, by %s with %s",
- info[FS_MODTIME], info[FS_MODBY], info[FS_MODWITH]);
+ sprintf(print_buf, MOD_FORMAT, info[FS_MODBY], info[FS_MODTIME],
+ info[FS_MODWITH]);
Put_message(print_buf);
return(info[FS_NAME]);
}
GetValueFromUser("Comments about this Filesystem", &info[FS_COMMENTS]);
GetValueFromUser("Filesystem's owner (user)", &info[FS_OWNER]);
GetValueFromUser("Filesystem's owners (group)", &info[FS_OWNERS]);
- GetValueFromUser("Automatically create this filsystem (0/1)",
+ GetYesNoValueFromUser("Automatically create this filsystem",
&info[FS_CREATE]);
GetValueFromUser("Filesystem's lockertype", &info[FS_L_TYPE]);
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);
}
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);
}
* 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;