version 1.15, 2001/11/20 20:50:00 |
version 1.16, 2001/11/21 15:26:39 |
|
|
*/ |
*/ |
|
|
#ifndef lint |
#ifndef lint |
static char copyright[] = |
static const char copyright[] = |
"@(#) Copyright (c) 1980, 1993\n\ |
"@(#) Copyright (c) 1980, 1993\n\ |
The Regents of the University of California. All rights reserved.\n"; |
The Regents of the University of California. All rights reserved.\n"; |
#endif /* not lint */ |
#endif /* not lint */ |
|
|
#ifndef lint |
#ifndef lint |
#if 0 |
#if 0 |
static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 4/20/95"; |
static const char sccsid[] = "@(#)main.c 8.2 (Berkeley) 4/20/95"; |
#else |
#else |
static char rcsid[] = "$OpenBSD$"; |
static const char rcsid[] = "$OpenBSD$"; |
#endif |
#endif |
#endif /* not lint */ |
#endif /* not lint */ |
|
|
|
|
#include <sys/ioctl.h> |
#include <sys/ioctl.h> |
#include "extern.h" |
#include "extern.h" |
|
|
int main __P((int, char **)); |
__dead void usage(void); |
__dead void usage __P((void)); |
int main(int, char **); |
|
|
/* |
/* |
* Mail -- a mail program |
* Mail -- a mail program |
|
|
*/ |
*/ |
|
|
int |
int |
main(argc, argv) |
main(int argc, char **argv) |
int argc; |
|
char *argv[]; |
|
{ |
{ |
int i; |
int i; |
struct name *to, *cc, *bcc, *smopts; |
struct name *to, *cc, *bcc, *smopts; |
|
|
* first of these users. |
* first of these users. |
*/ |
*/ |
ef = NULL; |
ef = NULL; |
to = NIL; |
to = NULL; |
cc = NIL; |
cc = NULL; |
bcc = NIL; |
bcc = NULL; |
smopts = NIL; |
smopts = NULL; |
subject = NULL; |
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) { |
|
|
/* |
/* |
* Check for inconsistent arguments. |
* Check for inconsistent arguments. |
*/ |
*/ |
if (to == NIL && (subject != NULL || cc != NIL || bcc != NIL)) |
if (to == NULL && (subject != NULL || cc != NULL || bcc != NULL)) |
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 != NULL && to != NIL) |
if (ef != NULL && to != NULL) |
errx(1, "Cannot give -f and people to send to"); |
errx(1, "Cannot give -f and people to send to"); |
/* |
/* |
* Block SIGINT except where we install an explicit handler for it. |
* Block SIGINT except where we install an explicit handler for it. |
|
|
* Width is either 80 or ws_col; |
* Width is either 80 or ws_col; |
*/ |
*/ |
void |
void |
setscreensize() |
setscreensize(void) |
{ |
{ |
struct termios tbuf; |
struct termios tbuf; |
struct winsize ws; |
struct winsize ws; |
|
|
} |
} |
|
|
__dead void |
__dead void |
usage() |
usage(void) |
{ |
{ |
|
|
fprintf(stderr, "usage: %s [-iInv] [-s subject] [-c cc-addr] " |
fprintf(stderr, "usage: %s [-iInv] [-s subject] [-c cc-addr] " |