version 1.22, 2001/11/20 20:50:00 |
version 1.23, 2001/11/21 15:26:39 |
|
|
|
|
#ifndef lint |
#ifndef lint |
#if 0 |
#if 0 |
static char sccsid[] = "@(#)collect.c 8.2 (Berkeley) 4/19/94"; |
static const char sccsid[] = "@(#)collect.c 8.2 (Berkeley) 4/19/94"; |
#else |
#else |
static char rcsid[] = "$OpenBSD$"; |
static const char rcsid[] = "$OpenBSD$"; |
#endif |
#endif |
#endif /* not lint */ |
#endif /* not lint */ |
|
|
|
|
* receipt of an interrupt signal, the partial message can be salted |
* receipt of an interrupt signal, the partial message can be salted |
* away on dead.letter. |
* away on dead.letter. |
*/ |
*/ |
|
|
static FILE *collf; /* File for saving away */ |
static FILE *collf; /* File for saving away */ |
static int hadintr; /* Have seen one SIGINT so far */ |
static int hadintr; /* Have seen one SIGINT so far */ |
|
|
FILE * |
FILE * |
collect(hp, printheaders) |
collect(struct header *hp, int printheaders) |
struct header *hp; |
|
int printheaders; |
|
{ |
{ |
FILE *fbuf; |
FILE *fbuf; |
int lc, cc, fd, c, t, lastlong, rc, sig; |
int lc, cc, fd, c, t, lastlong, rc, sig; |
|
|
hp->h_bcc = cat(hp->h_bcc, extract(&linebuf[2], GBCC)); |
hp->h_bcc = cat(hp->h_bcc, extract(&linebuf[2], GBCC)); |
break; |
break; |
case 'd': |
case 'd': |
strncpy(linebuf + 2, getdeadletter(), sizeof(linebuf) - 3); |
linebuf[2] = '\0'; |
linebuf[sizeof(linebuf) - 1] = '\0'; |
strlcat(linebuf, getdeadletter(), sizeof(linebuf)); |
/* fall into . . . */ |
/* fall into . . . */ |
case 'r': |
case 'r': |
case '<': |
case '<': |
|
|
* Write a file, ex-like if f set. |
* Write a file, ex-like if f set. |
*/ |
*/ |
int |
int |
exwrite(name, fp, f) |
exwrite(char *name, FILE *fp, int f) |
char name[]; |
|
FILE *fp; |
|
int f; |
|
{ |
{ |
FILE *of; |
FILE *of; |
int c; |
int c; |
|
|
* On return, make the edit file the new temp file. |
* On return, make the edit file the new temp file. |
*/ |
*/ |
void |
void |
mesedit(fp, c) |
mesedit(FILE *fp, int c) |
FILE *fp; |
|
int c; |
|
{ |
{ |
FILE *nf; |
FILE *nf; |
struct sigaction oact; |
struct sigaction oact; |
|
|
* Sh -c must return 0 to accept the new message. |
* Sh -c must return 0 to accept the new message. |
*/ |
*/ |
void |
void |
mespipe(fp, cmd) |
mespipe(FILE *fp, char *cmd) |
FILE *fp; |
|
char cmd[]; |
|
{ |
{ |
FILE *nf; |
FILE *nf; |
int fd; |
int fd; |
|
|
* should shift over and 'f' if not. |
* should shift over and 'f' if not. |
*/ |
*/ |
int |
int |
forward(ms, fp, fn, f) |
forward(char *ms, FILE *fp, char *fn, int f) |
char ms[]; |
|
FILE *fp; |
|
char *fn; |
|
int f; |
|
{ |
{ |
int *msgvec; |
int *msgvec; |
struct ignoretab *ig; |
struct ignoretab *ig; |
|
|
* Save the partial message in ~/dead.letter. |
* Save the partial message in ~/dead.letter. |
*/ |
*/ |
int |
int |
collabort() |
collabort(void) |
{ |
{ |
/* |
/* |
* the control flow is subtle, because we can be called from ~q. |
* the control flow is subtle, because we can be called from ~q. |
|
|
} |
} |
|
|
void |
void |
savedeadletter(fp) |
savedeadletter(FILE *fp) |
FILE *fp; |
|
{ |
{ |
FILE *dbuf; |
FILE *dbuf; |
int c; |
int c; |
|
|
} |
} |
|
|
int |
int |
gethfromtty(hp, gflags) |
gethfromtty(struct header *hp, int gflags) |
struct header *hp; |
|
int gflags; |
|
{ |
{ |
|
|
hadintr = 0; |
hadintr = 0; |