version 1.8, 1997/04/02 17:21:24 |
version 1.9, 1997/04/28 05:48:32 |
|
|
#define OBJECT /* will object to messages without Subjects */ |
#define OBJECT /* will object to messages without Subjects */ |
#define REJECT /* will reject messages without Subjects |
#define REJECT /* will reject messages without Subjects |
(OBJECT must be defined also) */ |
(OBJECT must be defined also) */ |
/* #define UNBUFFERED /* use unbuffered output */ |
#undef UNBUFFERED /* use unbuffered output */ |
|
|
#include <sys/param.h> |
#include <sys/param.h> |
#include <sys/ioctl.h> |
#include <sys/ioctl.h> |
|
|
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
|
#include <term.h> |
#include <termios.h> |
#include <termios.h> |
#include <time.h> |
#include <time.h> |
#include <unistd.h> |
#include <unistd.h> |
|
|
time_t t; |
time_t t; |
time_t keep; |
time_t keep; |
|
|
char *nxtfld(); |
void prmesg __P((int)); |
void onintr(); |
void onintr __P((int)); |
void onsusp(); |
void onsusp __P((int)); |
|
int linecnt __P((FILE *)); |
|
int next __P((char *)); |
|
void ask __P((char *)); |
|
void gfrsub __P((FILE *)); |
|
char *nxtfld __P((char *)); |
|
|
/* option initialization */ |
/* option initialization */ |
bool hdrs = NO; |
bool hdrs = NO; |
|
|
bool lastcmd = NO; |
bool lastcmd = NO; |
jmp_buf tstpbuf; |
jmp_buf tstpbuf; |
|
|
|
int |
main(argc, argv) |
main(argc, argv) |
int argc; char *argv[]; |
int argc; |
|
char *argv[]; |
{ |
{ |
bool newrc, already; |
bool newrc, already; |
int rcfirst = 0; /* first message to print (from .rc) */ |
int rcfirst = 0; /* first message to print (from .rc) */ |
|
|
exit(0); |
exit(0); |
} |
} |
|
|
|
void |
prmesg(length) |
prmesg(length) |
int length; |
int length; |
{ |
{ |
|
|
} |
} |
|
|
void |
void |
onintr() |
onintr(unused) |
|
int unused; |
{ |
{ |
signal(SIGINT, onintr); |
signal(SIGINT, onintr); |
if (mailing) |
if (mailing) |
|
|
* We have just gotten a susp. Suspend and prepare to resume. |
* We have just gotten a susp. Suspend and prepare to resume. |
*/ |
*/ |
void |
void |
onsusp() |
onsusp(unused) |
|
int unused; |
{ |
{ |
|
|
signal(SIGTSTP, SIG_DFL); |
signal(SIGTSTP, SIG_DFL); |
sigsetmask(0); |
sigsetmask(0); |
kill(0, SIGTSTP); |
kill(0, SIGTSTP); |
|
|
longjmp(tstpbuf, 0); |
longjmp(tstpbuf, 0); |
} |
} |
|
|
|
int |
linecnt(f) |
linecnt(f) |
FILE *f; |
FILE *f; |
{ |
{ |
off_t oldpos = ftell(f); |
off_t oldpos = ftell(f); |
int l = 0; |
int l = 0; |
|
|
return (l); |
return (l); |
} |
} |
|
|
|
int |
next(buf) |
next(buf) |
char *buf; |
char *buf; |
{ |
{ |
int i; |
int i; |
sscanf(buf, "%d", &i); |
sscanf(buf, "%d", &i); |
|
|
return(--i); |
return(--i); |
} |
} |
|
|
|
void |
ask(prompt) |
ask(prompt) |
char *prompt; |
char *prompt; |
{ |
{ |
char inch; |
char inch; |
int n, cmsg, fd; |
int n, cmsg, fd; |
|
|
return; |
return; |
} |
} |
|
|
while (n = fread(inbuf, 1, sizeof inbuf, cpfrom)) |
while ((n = fread(inbuf, 1, sizeof inbuf, cpfrom))) |
fwrite(inbuf, 1, n, cpto); |
fwrite(inbuf, 1, n, cpto); |
|
|
fclose(cpfrom); |
fclose(cpfrom); |
|
|
} |
} |
} |
} |
|
|
|
void |
gfrsub(infile) |
gfrsub(infile) |
FILE *infile; |
FILE *infile; |
{ |
{ |
off_t frompos; |
off_t frompos; |
|
|
|
|
|
|
char * |
char * |
nxtfld(s) |
nxtfld(s) |
char *s; |
char *s; |
{ |
{ |
if (*s) while (*s && *s > ' ') s++; /* skip over this field */ |
if (*s) while (*s && *s > ' ') s++; /* skip over this field */ |
if (*s) while (*s && *s <= ' ') s++; /* find start of next field */ |
if (*s) while (*s && *s <= ' ') s++; /* find start of next field */ |