* $Header$
*/
+/* (c) Copyright 1988 by the Massachusetts Institute of Technology. */
+/* For copying and distribution information, please see the file */
+/* <mit-copyright.h>. */
+
#ifndef lint
static char rcsid_mailmaint_c[] = "$Header$";
#endif lint
#include <varargs.h>
#include <com_err.h>
#include <ctype.h>
-#include "mit-copyright.h"
+#include <sms.h>
+#include <sms_app.h>
+#include <mit-copyright.h>
#define STARTCOL 0
#define STARTROW 3
printf("Connecting to database for %s...please hold on.\n", uname);
- status = sms_connect();
+ status = sms_connect(SMS_SERVER);
if (status) {
(void) sprintf(buf, "\nConnection to SMS server failed");
goto punt;
show_text(DISPROW, STARTCOL, "Show information about a list.\n\r");
buf = calloc((unsigned)1024, 1);
- if (Prompt("Enter List Name: ", buf, LISTSIZE) == 1) {
+ if (Prompt("Enter List Name: ", buf, LISTSIZE, 1) == 1) {
Put_message("\n\r");
if (fetch_list_info(buf, current_li) == 0) {
(void) sprintf(buf, "Description: %s\n\r", current_li->desc);
currow++;
mvcur(0, 0, currow, STARTCOL);
refresh();
- if (Prompt("--RETURN for more, ctl-c to exit--", buffer, 1) == 0) {
+ if (Prompt("--RETURN for more, ctl-c to exit--", buffer, 1, 0) == 0) {
Put_message("Flushing query...");
moreflg = 1;
return (0);
show_text(DISPROW, STARTCOL, "Add yourself to a list\n\r");
buf = calloc(LISTMAX, 1);
- if (Prompt("Enter List Name: ", buf, LISTSIZE) == 1) {
+ if (Prompt("Enter List Name: ", buf, LISTSIZE, 1) == 1) {
Put_message("\r\n");
argv[0] = strsave(buf);
argv[1] = strsave("user");
show_text(DISPROW, STARTCOL, "Remove yourself from a list\n\r");
buf = calloc(LISTMAX, 1);
- if (Prompt("Enter List Name: ", buf, LISTSIZE) == 1) {
+ if (Prompt("Enter List Name: ", buf, LISTSIZE, 1) == 1) {
Put_message("\r\n");
argv[0] = strsave(buf);
argv[1] = strsave("user");
Put_message("\r\n");
com_err(whoami, status, " in get_lists_of_member");
}
+ currow++;
show_text(currow, STARTCOL, "Press any Key to continue...");
(void) getchar();
clrwin(DISPROW);
mvcur(0, 0, DISPROW, STARTCOL);
refresh();
buf = calloc(LISTMAX, 1);
- if (Prompt("Enter List Name: ", buf, LISTSIZE) == 1) {
+ if (Prompt("Enter List Name: ", buf, LISTSIZE, 1) == 1) {
(void) sprintf(buffer, "The members of list '%s' are:", buf);
show_text(DISPROW + 1, STARTCOL, buffer);
argv[0] = buf;
currow++;
mvcur(0, 0, currow, STARTCOL);
refresh();
- if (Prompt("--RETURN for more, ctl-c to exit--", buffer, 1) == 0) {
+ if (Prompt("--RETURN for more, ctl-c to exit--", buffer, 1, 0) == 0) {
Put_message("Flushing query...");
moreflg = 1;
return (0);
/****************************************************/
/* Prompt the user for input */
int
-Prompt(prompt, buf, buflen)
+Prompt(prompt, buf, buflen, crok)
char *prompt;
char *buf;
int buflen;
+ int crok;
{
int c;
char *p;
return (0);
case '\n':
case '\r':
- Put_message("\r");
+ if (crok)
+ Put_message("\r");
*p = '\0';
if (strlen(buf) < 1)/* only \n or \r in buff */
return (-1);
if (p > buf) {
p--;
x--;
- Put_message("\b");
- Put_message(" ");
- Put_message("\b");
+ printf("\b \b");
}
break;
case CTL('U'):
case CTL('G'):
case CTL('['):
x = oldx;
+ while (p-- > buf)
+ printf("\b \b");
p = buf;
break;
default:
(void) putc('\0', &_strbuf);
Put_message(buf);
}
-
-
-/*
- * Local Variables:
- * mode: c
- * c-indent-level: 4
- * c-continued-statement-offset: 4
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * End:
- */