version 1.6, 1997/07/13 23:54:00 |
version 1.7, 1997/07/14 00:24:28 |
|
|
* Startup -- interface with user. |
* Startup -- interface with user. |
*/ |
*/ |
|
|
jmp_buf hdrjmp; |
sigjmp_buf hdrjmp; |
|
|
int |
int |
main(argc, argv) |
main(argc, argv) |
|
|
* of users to mail to. Argp will be set to point to the |
* of users to mail to. Argp will be set to point to the |
* first of these users. |
* first of these users. |
*/ |
*/ |
ef = NOSTR; |
ef = NULL; |
to = NIL; |
to = NIL; |
cc = NIL; |
cc = NIL; |
bcc = NIL; |
bcc = NIL; |
smopts = NIL; |
smopts = NIL; |
subject = NOSTR; |
subject = NULL; |
while ((i = getopt(argc, argv, "INT:b:c:dfins:u:v")) != -1) { |
while ((i = getopt(argc, argv, "INT:b:c:dfins:u:v")) != -1) { |
switch (i) { |
switch (i) { |
case 'T': |
case 'T': |
|
|
/* |
/* |
* Check for inconsistent arguments. |
* Check for inconsistent arguments. |
*/ |
*/ |
if (to == NIL && (subject != NOSTR || cc != NIL || bcc != NIL)) |
if (to == NIL && (subject != NULL || cc != NIL || bcc != NIL)) |
errx(1, "You must specify direct recipients with -s, -c, or -b"); |
errx(1, "You must specify direct recipients with -s, -c, or -b"); |
if (ef != NOSTR && to != NIL) |
if (ef != NULL && to != NIL) |
errx(1, "Cannot give -f and people to send to"); |
errx(1, "Cannot give -f and people to send to"); |
tinit(); |
tinit(); |
setscreensize(); |
setscreensize(); |
|
|
* Decide whether we are editing a mailbox or reading |
* Decide whether we are editing a mailbox or reading |
* the system mailbox, and open up the right stuff. |
* the system mailbox, and open up the right stuff. |
*/ |
*/ |
if (ef == NOSTR) |
if (ef == NULL) |
ef = "%"; |
ef = "%"; |
if (setfile(ef) < 0) |
if (setfile(ef) < 0) |
exit(1); /* error already reported */ |
exit(1); /* error already reported */ |
if (setjmp(hdrjmp) == 0) { |
if (sigsetjmp(hdrjmp, 1) == 0) { |
extern char *version; |
extern char *version; |
|
|
if ((prevint = signal(SIGINT, SIG_IGN)) != SIG_IGN) |
if ((prevint = signal(SIGINT, SIG_IGN)) != SIG_IGN) |
signal(SIGINT, hdrstop); |
signal(SIGINT, hdrstop); |
if (value("quiet") == NOSTR) |
if (value("quiet") == NULL) |
printf("Mail version %s. Type ? for help.\n", |
printf("Mail version %s. Type ? for help.\n", |
version); |
version); |
announce(); |
announce(); |
|
|
|
|
fflush(stdout); |
fflush(stdout); |
fputs("\nInterrupt\n", stderr); |
fputs("\nInterrupt\n", stderr); |
longjmp(hdrjmp, 1); |
siglongjmp(hdrjmp, 1); |
} |
} |
|
|
/* |
/* |