static char **SetContainerDefaults(char **info, char *name)
{
info[CON_NAME] = strdup(name);
+ info[CON_PUBLIC] = strdup(DEFAULT_NO);
info[CON_DESCRIPT] = strdup(CON_DEFAULT_TYPE);
info[CON_LOCATION] = strdup(CON_DEFAULT_TYPE);
info[CON_CONTACT] = strdup(CON_DEFAULT_TYPE);
return NULL;
break;
case CONTAINER:
+ if (GetYesNoValueFromUser("Is this a public container",
+ &info[CON_PUBLIC]) == SUB_ERROR)
+ return NULL;
if (GetValueFromUser("Container's Description:", &info[CON_DESCRIPT]) ==
SUB_ERROR)
return NULL;
static char *PrintContainerInfo(char **info)
{
char buf[BUFSIZ], tbuf[256];
+ char *args[2];
+ struct mqelem *elem = NULL;
+ int stat;
Put_message("");
- sprintf(buf, "Container: %-16s", info[CON_NAME]);
+ sprintf(buf, "Container: %-16s Public: %s", info[CON_NAME],
+ atoi(info[CON_PUBLIC]) ? "Yes" : "No");
Put_message(buf);
+ /* Do a get_container_list to see what the associated list is. */
+ args[0] = info[CON_NAME];
+ if (stat = do_mr_query("get_container_list", 1, args, StoreInfo, &elem))
+ {
+ if (stat != MR_NO_MATCH)
+ com_err(program_name, stat, " looking up container list");
+ }
+ else
+ {
+ sprintf(buf, "Container's associated list is: LIST %s",
+ ((char **)elem->q_data)[1]);
+ Put_message(buf);
+ FreeQueue(elem);
+ }
sprintf(buf, "Description: %-16s", info[CON_DESCRIPT]);
Put_message(buf);
sprintf(buf, "Location: %-16s Contact: %s", info[CON_LOCATION],
sprintf(buf, MOD_FORMAT, info[CON_MODBY], info[CON_MODTIME],
info[CON_MODWITH]);
Put_message(buf);
- return info[CON_NAME];
+ return(info[CON_NAME]);
}
static char *PrintContainer(char **info)