char *canonicalize_cell(char *c);
int GetAliasValue(int argc, char **argv, void *retval);
void RealDeleteFS(char **info, Bool one_item);
-char *SortAfter(struct qelem *elem, int count);
+char *SortAfter(struct mqelem *elem, int count);
void RealDeleteFSAlias(char **info, Bool one_item);
#define FS_ALIAS_TYPE "FILESYS"
* Returns: a pointer to the first element in the queue.
*/
-static struct qelem *GetFSInfo(int type, char *name)
+static struct mqelem *GetFSInfo(int type, char *name)
{
int stat;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
char *args[5];
switch (type)
if (!strcmp(info[FS_TYPE], "FSGROUP") || !strcmp(info[FS_TYPE], "MUL"))
{
int stat;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
if (!strcmp(info[FS_TYPE], "MUL"))
sprintf(print_buf, "%20s Multiple Filesystem: %s", " ", info[FS_NAME]);
int GetFS(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
top = GetFSInfo(LABEL, argv[1]); /* get info. */
Loop(top, (void (*)(char **))PrintFSInfo);
int GetFSM(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
argv[1] = canonicalize_hostname(strdup(argv[1]));
top = GetFSInfo(MACHINE, argv[1]); /* get info. */
int DeleteFS(int argc, char **argv)
{
- struct qelem *elem = GetFSInfo(LABEL, argv[1]);
+ struct mqelem *elem = GetFSInfo(LABEL, argv[1]);
QueryLoop(elem, PrintFSInfo, RealDeleteFS, "Delete the Filesystem");
FreeQueue(elem);
int ChangeFS(int argc, char **argv)
{
- struct qelem *elem = GetFSInfo(LABEL, argv[1]);
+ struct mqelem *elem = GetFSInfo(LABEL, argv[1]);
QueryLoop(elem, NullPrint, RealChangeFS, "Update the Filesystem");
FreeQueue(elem);
static char *val[] = {"def_quota", NULL};
static char *def_quota = NULL;
char *argv[Q_QUOTA + 1];
- struct qelem *top = NULL;
+ struct mqelem *top = NULL;
if (!def_quota)
{
* Returns: sort key to use.
*/
-char *SortAfter(struct qelem *elem, int count)
+char *SortAfter(struct mqelem *elem, int count)
{
char *prev, *next, prevnext, *key, keybuf[9];
int AddFSToGroup(int argc, char **argv)
{
int stat, count;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
char buf[BUFSIZ], *args[5], *bufp;
if ((stat = do_mr_query("get_fsgroup_members", 1, argv + 1, StoreInfo,
int ChangeFSGroupOrder(int argc, char **argv)
{
int stat, src, dst, i;
- struct qelem *elem = NULL, *top, *tmpelem;
+ struct mqelem *elem = NULL, *top, *tmpelem;
char buf[BUFSIZ], *bufp, *args[3];
if ((stat = do_mr_query("get_fsgroup_members", 1, argv + 1, StoreInfo,
int GetFSAlias(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
top = GetFSInfo(ALIAS, argv[1]);
Put_message(" "); /* blank line. */
int CreateFSAlias(int argc, char **argv)
{
int stat;
- struct qelem *elem, *top;
+ struct mqelem *elem, *top;
char *args[MAX_ARGS_SIZE], buf[BUFSIZ], **info;
elem = NULL;
int DeleteFSAlias(int argc, char **argv)
{
- struct qelem *elem = GetFSInfo(ALIAS, argv[1]);
+ struct mqelem *elem = GetFSInfo(ALIAS, argv[1]);
QueryLoop(elem, PrintFSAlias, RealDeleteFSAlias,
"Delete the Filesystem Alias");
FreeQueue(elem);
#include "f_defs.h"
#include "globals.h"
+#include <sys/types.h>
#include <sys/utsname.h>
#include <netinet/in.h>
#include <string.h>
void PrintAliases(char **info);
-struct qelem *GetMCInfo(int type, char *name1, char *name2);
+struct mqelem *GetMCInfo(int type, char *name1, char *name2);
char **AskMCDInfo(char **info, int type, Bool name);
int CheckAndRemoveFromCluster(char *name, Bool ask_user);
int CheckAndRemoveMachines(char *name, Bool ask_first);
{
char buf[BUFSIZ], tbuf[256];
char *args[3];
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
int stat;
Put_message("");
* Returns: the top element of a queue containing the data or NULL.
*/
-struct qelem *GetMCInfo(int type, char *name1, char *name2)
+struct mqelem *GetMCInfo(int type, char *name1, char *name2)
{
int stat;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
char *args[5];
switch (type)
int ShowMachineInfo(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
char *tmpname;
tmpname = canonicalize_hostname(strdup(argv[1]));
int ShowMachineQuery(int argc, char **argv)
{
int stat;
- struct qelem *top, *elem = NULL;
+ struct mqelem *top, *elem = NULL;
char *args[5];
if (!strcmp(argv[1], "") && !strcmp(argv[2], "") &&
{
char **args, *info[MAX_ARGS_SIZE], *name, buf[256], *xargs[5];
char **rinfo;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
int stat;
if (!ValidName(argv[1])) /* Checks for wildcards. */
int UpdateMachine(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
char *tmpname;
tmpname = canonicalize_hostname(strdup(argv[1]));
int stat, ret_value;
Bool delete_it;
char *args[10], temp_buf[BUFSIZ], *ptr;
- struct qelem *top, *elem = NULL;
+ struct mqelem *top, *elem = NULL;
ret_value = SUB_NORMAL; /* initialize ret_value. */
args[0] = name;
int DeleteMachine(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
char *tmpname;
tmpname = canonicalize_hostname(strdup(argv[1]));
int ShowCname(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
char *tmpalias, *tmpname;
tmpalias = partial_canonicalize_hostname(strdup(argv[1]));
int stat;
char *machine, *cluster, temp_buf[BUFSIZ], *args[10];
Bool add_it, one_machine, one_cluster;
- struct qelem *melem, *mtop, *celem, *ctop;
+ struct mqelem *melem, *mtop, *celem, *ctop;
machine = canonicalize_hostname(strdup(argv[1]));
if (strcasecmp(machine, argv[1]) && *argv[1] != '"')
int RemoveMachineFromCluster(int argc, char **argv)
{
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
char buf[BUFSIZ], * args[10];
int stat;
int ShowSubnetInfo(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
top = GetMCInfo(SUBNET, argv[1], (char *) NULL);
Loop(top, (void *) PrintSubnetInfo);
int UpdateSubnet(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
top = GetMCInfo(SUBNET, argv[1], NULL);
QueryLoop(top, NullPrint, RealUpdateSubnet, "Update the subnet");
int DeleteSubnet(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
top = GetMCInfo(SUBNET, argv[1], NULL);
QueryLoop(top, PrintSubnetInfo, RealDeleteSubnet, "Delete the subnet");
int ShowClusterInfo(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
top = GetMCInfo(CLUSTER, argv[1], NULL);
Loop(top, (void *) PrintClusterInfo);
int UpdateCluster(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
top = GetMCInfo(CLUSTER, argv[1], NULL);
QueryLoop(top, NullPrint, RealUpdateCluster, "Update the cluster");
int stat, ret_value;
Bool delete_it;
char *args[10], temp_buf[BUFSIZ], *ptr;
- struct qelem *top, *elem = NULL;
+ struct mqelem *top, *elem = NULL;
ret_value = SUB_NORMAL;
args[MAP_MACHINE] = "*";
int DeleteCluster(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
top = GetMCInfo(CLUSTER, argv[1], NULL);
QueryLoop(top, PrintClusterInfo, RealDeleteCluster, "Delete the cluster");
int ShowClusterData(int argc, char **argv)
{
- struct qelem *elem, *top;
+ struct mqelem *elem, *top;
char **info;
top = elem = GetMCInfo(DATA, argv[1], argv[2]);
int RemoveClusterData(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
top = GetMCInfo(DATA, argv[1], argv[2]);
QueryLoop(top, PrintClusterData, RealRemoveClusterData,
int MachineToClusterMap(int argc, char **argv)
{
- struct qelem *elem, *top;
+ struct mqelem *elem, *top;
char *tmpname, temp_buf[256];
tmpname = canonicalize_hostname(strdup(argv[1]));
#define FORMFEED Put_message(" ")
-/* for use with insqueue and remque. */
+/* NOT for use with insqueue and remque. */
-struct qelem {
- struct qelem *q_forw;
- struct qelem *q_back;
+struct mqelem {
+ struct mqelem *q_forw;
+ struct mqelem *q_back;
void *q_data;
};
int CheckListForDeletion(char *name, Bool verbose);
void CheckAce(char *type, char *name, Bool verbose);
int CheckIfAce(char *name, char *type, Bool verbose);
-int RemoveItemFromLists(char *name, char *type, struct qelem **elem,
+int RemoveItemFromLists(char *name, char *type, struct mqelem **elem,
int verbose);
int RemoveMembersOfList(char *name, Bool verbose);
int DeleteUserGroup(char *name, Bool verbose);
int CheckListForDeletion(char *name, Bool verbose)
{
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
int status;
char *args[2], buf[BUFSIZ], **info;
int CheckIfAce(char *name, char *type, Bool verbose)
{
char *args[2], buf[BUFSIZ], **info;
- struct qelem *local, *elem;
+ struct mqelem *local, *elem;
int status;
elem = NULL;
* Returns: SUB_ERROR if there is an error.
*/
-int RemoveItemFromLists(char *name, char *type, struct qelem **elem,
+int RemoveItemFromLists(char *name, char *type, struct mqelem **elem,
int verbose)
{
- struct qelem *local;
+ struct mqelem *local;
char *args[10], temp_buf[BUFSIZ];
int lists;
int status;
int RemoveMembersOfList(char *name, Bool verbose)
{
char buf[BUFSIZ], *args[10];
- struct qelem *local, *elem = NULL;
+ struct mqelem *local, *elem = NULL;
int status, members;
/*
* Get the members of this list.
void AttemptToDeleteList(char **list_info, Bool ask_first)
{
int status;
- struct qelem *local, *member_of;
+ struct mqelem *local, *member_of;
char *name = list_info[L_NAME];
member_of = NULL;
int DeleteList(int argc, char *argv[])
{
char buf[BUFSIZ];
- struct qelem *top, *list;
+ struct mqelem *top, *list;
int status;
Bool one_list;
char buf[BUFSIZ];
char *name = argv[1]; /* name of the user we are deleting. */
#ifndef ATHENA
- struct qelem *local, *member_of = NULL;
+ struct mqelem *local, *member_of = NULL;
#endif
if (!ValidName(name))
char **CopyInfo(char **info);
void FreeInfo(char **);
-void FreeQueue(struct qelem *elem);
+void FreeQueue(struct mqelem *elem);
void FreeAndClear(char **pointer, Bool free_it);
-void Loop(struct qelem *elem, void (*func)(char **));
-void QueryLoop(struct qelem *elem, char * (*print_func)(char **),
+void Loop(struct mqelem *elem, void (*func)(char **));
+void QueryLoop(struct mqelem *elem, char * (*print_func)(char **),
void (*op_func)(char **, Bool), char *query_string);
void SlipInNewName(char **info, char *name);
int CountArgs(char **args);
int ToggleVerboseMode(int argc, char **argv);
char *NullPrint(char **info);
char *atot(char *itime);
-struct qelem *QueueTop(struct qelem *elem);
+struct mqelem *QueueTop(struct mqelem *elem);
Bool Confirm(char *prompt);
Bool YesNoQuestion(char *prompt, int bool_def);
Bool YesNoQuitQuestion(char *prompt, int bool_def);
int GetTypeFromUser(char *prompt, char *tname, char **pointer);
int GetAddressFromUser(char *prompt, char **pointer);
Bool ValidName(char *s);
-int QueueCount(struct qelem *elem);
+int QueueCount(struct mqelem *elem);
int PromptWithDefault(char *prompt, char *buf, int buflen, char *def);
-struct qelem *GetTypeValues(char *tname);
+struct mqelem *GetTypeValues(char *tname);
#endif /* _f_defs_ */
RCSID("$Header$");
-struct qelem *GetListInfo(int type, char *name1, char *name2);
+struct mqelem *GetListInfo(int type, char *name1, char *name2);
char **AskListInfo(char **info, Bool name);
int AddList(int argc, char **argv);
void ListMembersByType(char *type);
* Returns: the first element in the queue.
*/
-struct qelem *GetListInfo(int type, char *name1, char *name2)
+struct mqelem *GetListInfo(int type, char *name1, char *name2)
{
char *args[2];
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
int status;
switch (type)
int ShowListInfo(int argc, char **argv)
{
- struct qelem *top, *list;
+ struct mqelem *top, *list;
top = list = GetListInfo(LIST, argv[1], NULL);
while (list)
{
int stat;
char **args;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
if (!(args = AskListInfo(info, TRUE)))
{
int UpdateList(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
top = GetListInfo(LIST, argv[1], (char *) NULL);
QueryLoop(top, NullPrint, RealUpdateList, "Update the list");
{
static char *info[MAX_ARGS_SIZE], **add_args;
int status, ret_code = SUB_NORMAL;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
if (!ValidName(argv[1]))
return DM_NORMAL;
{
char *args[10], temp_buf[BUFSIZ], *p;
int status;
- struct qelem *mailhubs, *elem;
+ struct mqelem *mailhubs, *elem;
if (GetMemberInfo("add", args) == SUB_ERROR)
return DM_NORMAL;
{
int status;
char *type, *name, *args[10], buf[BUFSIZ];
- struct qelem *top, *elem;
+ struct mqelem *top, *elem;
type = strdup("USER");
if (GetTypeFromUser("Type of member", "member", &type) == SUB_ERROR)
{
char buf[BUFSIZ], temp_buf[BUFSIZ], *type, *name, **info;
Bool maillist, group;
- struct qelem *top, *elem;
+ struct mqelem *top, *elem;
type = strdup("USER");
if (GetTypeFromUser("Type of member", "member", &type) == SUB_ERROR)
int ListByAdministrator(int argc, char **argv)
{
char buf[BUFSIZ], temp_buf[BUFSIZ], *type, *name;
- struct qelem *top;
+ struct mqelem *top;
type = strdup("USER");
if (GetTypeFromUser("Type of member", "member", &type) == SUB_ERROR)
* <mit-copyright.h>.
*/
-#include <mit-copyright.h>
+#include <stdio.h>
+
+#include "mit-copyright.h"
#include <moira.h>
#include "defs.h"
#include "f_defs.h"
int TableStats(int argc, char **argv)
{
int status;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
if ((status = do_mr_query("get_all_table_stats", 0, NULL, StoreInfo, &elem)))
{
int ShowClients(int argc, char **argv)
{
int status;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
if ((status = do_mr_query("_list_users", 0, NULL, StoreInfo, &elem)))
{
int ShowValue(int argc, char **argv)
{
int status;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
if ((status = do_mr_query("get_value", 1, &argv[1], StoreInfo, &elem)))
{
{
int status;
char *info[4];
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
info[0] = argv[1];
info[1] = argv[2];
int ShowNFSService(int argc, char **argv)
{
int stat;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
char *args[10];
if (!ValidName(argv[1]))
int UpdateNFSService(int argc, char **argv)
{
int stat;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
char *args[10];
if (!ValidName(argv[1]))
static void RealDeleteNFSService(char **info, Bool one_item)
{
char temp_buf[BUFSIZ], *args[10];
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
int stat;
sprintf(temp_buf,
int DeleteNFSService(int argc, char **argv)
{
int stat;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
char *args[10];
if (!ValidName(argv[1]))
{
int status;
static char *args[] = {"pop", NULL};
- struct qelem *top = NULL;
+ struct mqelem *top = NULL;
if ((status = do_mr_query("get_server_locations", CountArgs(args), args,
StoreInfo, &top)))
int GetUserPOBox(int argc, char **argv)
{
int status;
- struct qelem *top = NULL;
+ struct mqelem *top = NULL;
char buf[BUFSIZ];
if (!ValidName(argv[1]))
int status;
char *type, temp_buf[BUFSIZ], *local_user, *args[10], box[BUFSIZ];
char *temp_box;
- struct qelem *top = NULL;
+ struct mqelem *top = NULL;
local_user = argv[1];
if (!ValidName(local_user))
* if printer not found.
*/
-static struct qelem *GetPcapInfo(char *name)
+static struct mqelem *GetPcapInfo(char *name)
{
int stat;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
if ((stat = do_mr_query("get_printcap_entry", 1, &name, StoreInfo, &elem)))
{
int GetPcap(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
top = GetPcapInfo(argv[1]); /* get info. */
Loop(top, (void *) PrintPcapInfo);
int DeletePcap(int argc, char **argv)
{
- struct qelem *elem = GetPcapInfo(argv[1]);
+ struct mqelem *elem = GetPcapInfo(argv[1]);
QueryLoop(elem, PrintPcapInfo, RealDeletePcap, "Delete Printer");
FreeQueue(elem);
int ChngPcap(int argc, char **argv)
{
- struct qelem *elem = GetPcapInfo(argv[1]);
+ struct mqelem *elem = GetPcapInfo(argv[1]);
QueryLoop(elem, NullPrint, ChangePcap, "Change the printer");
FreeQueue(elem);
return DM_NORMAL;
}
-static struct qelem *GetPalladiumInfo(char *name)
+static struct mqelem *GetPalladiumInfo(char *name)
{
int status;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
if ((status = do_mr_query("get_palladium", 1, &name, StoreInfo, &elem)))
{
int GetPalladium(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
top = GetPalladiumInfo(argv[1]);
Loop(top, (void (*)(char **))PrintPalladiumInfo);
int ChngPalladium(int argc, char **argv)
{
- struct qelem *elem = GetPalladiumInfo(argv[1]);
+ struct mqelem *elem = GetPalladiumInfo(argv[1]);
QueryLoop(elem, NullPrint, ChangePalladium, "Change the server/supervisor");
FreeQueue(elem);
return DM_NORMAL;
int DeletePalladium(int argc, char **argv)
{
- struct qelem *elem = GetPalladiumInfo(argv[1]);
+ struct mqelem *elem = GetPalladiumInfo(argv[1]);
QueryLoop(elem, PrintPalladiumInfo, RealDeletePalladium,
"Delete server/supervisor");
FreeQueue(elem);
int ShowPalladiumAlias(int argc, char **argv)
{
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
char *qargv[3], buf[BUFSIZ];
int status;
{
int status;
char **info;
- struct qelem *top = NULL;
+ struct mqelem *top = NULL;
static char *val[] = {"def_quota", NULL};
if (override || (def_quota == NULL))
int GetQuota(int argc, char **argv)
{
- struct qelem *top = NULL;
+ struct mqelem *top = NULL;
int status;
char **args;
int GetQuotaByFilesys(int argc, char **argv)
{
- struct qelem *top = NULL;
+ struct mqelem *top = NULL;
int status;
char **args = malloc(2 * sizeof(char *));
{
int status;
char **args;
- struct qelem *top = NULL;
+ struct mqelem *top = NULL;
if (!(args = GetQuotaArgs(FALSE)))
return DM_NORMAL;
{
int status;
char **args;
- struct qelem *top = NULL;
+ struct mqelem *top = NULL;
if (!(args = GetQuotaArgs(FALSE)))
return DM_NORMAL;
#include "f_defs.h"
#include "globals.h"
+#include <sys/time.h>
+
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
void CorrectCapitalization(char **name);
char **AskUserInfo(char **info, Bool name);
-struct qelem *GetUserInfo(int type, char *name1, char *name2);
+struct mqelem *GetUserInfo(int type, char *name1, char *name2);
#define LOGIN 0
#define UID 1
}
else
{
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
char *argv[3];
if (GetValueFromUser("User's last name", &info[U_LAST]) == SUB_ERROR)
*
*/
-struct qelem *GetUserInfo(int type, char *name1, char *name2)
+struct mqelem *GetUserInfo(int type, char *name1, char *name2)
{
char *args[2];
int status;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
switch (type)
{
* Returns: uid - the malloced uid of the user that was chosen.
*/
-static char *ChooseUser(struct qelem *elem)
+static char *ChooseUser(struct mqelem *elem)
{
while (elem)
{
{
char *args[5], *uid, first[BUFSIZ], last[BUFSIZ];
int status;
- struct qelem *top = NULL;
+ struct mqelem *top = NULL;
if (!Prompt_input("First Name: ", first, BUFSIZ))
return NULL;
int UpdateUser(int argc, char **argv)
{
- struct qelem *elem;
+ struct mqelem *elem;
elem = GetUserInfo(LOGIN, argv[1], NULL);
QueryLoop(elem, NullPrint, RealUpdateUser, "Update the user");
int status;
char txt_buf[BUFSIZ];
char *qargs[2], **args;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
if (one_item)
{
int DeactivateUser(int argc, char **argv)
{
- struct qelem *elem;
+ struct mqelem *elem;
elem = GetUserInfo(LOGIN, argv[1], NULL);
QueryLoop(elem, NullPrint, RealDeactivateUser, "Deactivate user");
int DeleteUserByUid(int argc, char **argv)
{
int status;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
char **info;
if (!ValidName(argv[1]))
int ShowUserByLogin(int argc, char *argv[])
{
- struct qelem *top, *elem;
+ struct mqelem *top, *elem;
elem = top = GetUserInfo(LOGIN, argv[1], NULL);
Loop(elem, PrintUserInfo);
int ShowUserByName(int argc, char *argv[])
{
- struct qelem *top;
+ struct mqelem *top;
char buf[BUFSIZ];
top = GetUserInfo(BY_NAME, argv[1], argv[2]);
int ShowUserByClass(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
if (YesNoQuestion("This will take a long time. Are you sure", 0) == FALSE)
return DM_NORMAL;
int ShowUserById(int argc, char *argv[])
{
- struct qelem *top, *elem;
+ struct mqelem *top, *elem;
elem = top = GetUserInfo(ID, argv[1], NULL);
Loop(elem, PrintUserInfo);
int GetKrbmap(int argc, char **argv)
{
int stat;
- struct qelem *elem = NULL, *top;
+ struct mqelem *elem = NULL, *top;
char buf[BUFSIZ];
if ((stat = do_mr_query("get_kerberos_user_map", 2, &argv[1],
int GetDirFlags(int argc, char **argv)
{
int stat, flags;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
char buf[BUFSIZ], **info;
if (!ValidName(argv[1]))
{
int stat, flags;
char **info, buf[BUFSIZ], *args[2];
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
if (!ValidName(argv[1]))
return DM_NORMAL;
#include "f_defs.h"
#include "globals.h"
+#include <sys/types.h>
+
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h> /* for gethostbyname. */
* Returns: none.
*/
-static void AddQueue(struct qelem *elem, struct qelem *pred)
+static void AddQueue(struct mqelem *elem, struct mqelem *pred)
{
if (!pred)
{
* Returns: none.
*/
-static void RemoveQueue(struct qelem *elem)
+static void RemoveQueue(struct mqelem *elem)
{
if (elem->q_forw)
elem->q_forw->q_back = elem->q_back;
}
/* Function Name: QueueTop
- * Description: returns a qelem pointer that points to the top of
+ * Description: returns a mqelem pointer that points to the top of
* a queue.
* Arguments: elem - any element of a queue.
* Returns: top element of a queue.
*/
-struct qelem *QueueTop(struct qelem *elem)
+struct mqelem *QueueTop(struct mqelem *elem)
{
if (!elem) /* NULL returns NULL. */
return NULL;
* Returns: none
*/
-static void FreeQueueElem(struct qelem *elem)
+static void FreeQueueElem(struct mqelem *elem)
{
char **info = elem->q_data;
* Returns: none.
*/
-void FreeQueue(struct qelem *elem)
+void FreeQueue(struct mqelem *elem)
{
- struct qelem *temp, *local = QueueTop(elem);
+ struct mqelem *temp, *local = QueueTop(elem);
while (local)
{
* Returns: none.
*/
-int QueueCount(struct qelem *elem)
+int QueueCount(struct mqelem *elem)
{
int count = 0;
elem = QueueTop(elem);
* Arguments: argc, argv, - information returned from the query returned
* in argv.
* data - the previous element on the queue, this data will be
- * stored in a qelem struct immediatly after this elem.
+ * stored in a mqelem struct immediatly after this elem.
* If NULL then a new queue will be created. This value
* is updated to the current element at the end off the
* call.
int StoreInfo(int argc, char **argv, void *data)
{
char **info = malloc(MAX_ARGS_SIZE * sizeof(char *));
- struct qelem **old_elem = data;
- struct qelem *new_elem = malloc(sizeof(struct qelem));
+ struct mqelem **old_elem = data;
+ struct mqelem *new_elem = malloc(sizeof(struct mqelem));
int count;
if (!new_elem || !info)
* Returns: none.
*/
-void Loop(struct qelem *elem, void (*func)(char **))
+void Loop(struct mqelem *elem, void (*func)(char **))
{
while (elem)
{
* "Delete the list"
*/
-void QueryLoop(struct qelem *elem, char * (*print_func)(char **),
+void QueryLoop(struct mqelem *elem, char * (*print_func)(char **),
void (*op_func)(char **, Bool), char *query_string)
{
Bool one_item;
* Returns: argv of values
*/
-struct qelem *GetTypeValues(char *tname)
+struct mqelem *GetTypeValues(char *tname)
{
int stat;
char *argv[3], *p, **pp;
- struct qelem *elem, *oelem;
- static struct qelem *cache = NULL;
+ struct mqelem *elem, *oelem;
+ static struct mqelem *cache = NULL;
struct cache_elem {
char *cache_name;
- struct qelem *cache_data;
+ struct mqelem *cache_data;
} *ce;
for (elem = cache; elem; elem = elem->q_forw)
FreeInfo(pp);
elem->q_data = p;
}
- elem = malloc(sizeof(struct qelem));
+ elem = malloc(sizeof(struct mqelem));
ce = malloc(sizeof(struct cache_elem));
ce->cache_name = strdup(tname);
ce->cache_data = QueueTop(oelem);
int GetTypeFromUser(char *prompt, char *tname, char **pointer)
{
char def[BUFSIZ], buffer[BUFSIZ], *p, *argv[3];
- struct qelem *elem;
+ struct mqelem *elem;
int stat;
strcpy(def, *pointer);
com_err(program_name, stat, " in add_alias");
else
{
- elem = malloc(sizeof(struct qelem));
+ elem = malloc(sizeof(struct mqelem));
elem->q_data = strdup(*pointer);
AddQueue(elem, GetTypeValues(tname));
Put_message("Done.");
/* Get info from database */
-static struct qelem *GetZephyrInfo(char *name)
+static struct mqelem *GetZephyrInfo(char *name)
{
int stat;
- struct qelem *elem = NULL;
+ struct mqelem *elem = NULL;
if ((stat = do_mr_query("get_zephyr_class", 1, &name, StoreInfo, &elem)))
{
/* Menu entry for get zephyr */
int GetZephyr(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
top = GetZephyrInfo(argv[1]);
Loop(top, (void *) PrintZephyrInfo);
int DeleteZephyr(int argc, char **argv)
{
- struct qelem *elem = GetZephyrInfo(argv[1]);
+ struct mqelem *elem = GetZephyrInfo(argv[1]);
QueryLoop(elem, PrintZephyrInfo, RealDeleteZephyr,
"Delete Zephyr class restriction for class ");
FreeQueue(elem);
int ChngZephyr(int argc, char **argv)
{
- struct qelem *top;
+ struct mqelem *top;
top = GetZephyrInfo(argv[1]);
QueryLoop(top, NullPrint, RealUpdateZephyr, "Update class");