head 1.5; access; symbols; locks; strict; comment @ * @; 1.5 date 93.08.25.17.27.19; author jromine; state Exp; branches; next 1.4; 1.4 date 92.12.15.00.20.22; author jromine; state Exp; branches; next 1.3; 1.3 date 92.11.04.00.57.54; author jromine; state Exp; branches; next 1.2; 1.2 date 92.01.31.22.24.46; author jromine; state Exp; branches; next 1.1; 1.1 date 92.01.31.22.24.30; author jromine; state Exp; branches; next ; desc @@ 1.5 log @off_t fixes for BSD44 @ text @/* rcvpack.c - a rcvmail program to keep a copy */ #ifndef lint static char ident[] = "@@(#)$Id: rcvpack.c,v 1.4 1992/12/15 00:20:22 jromine Exp jromine $"; #endif /* lint */ #include "../h/mh.h" #include "../h/dropsbr.h" #include "../h/rcvmail.h" #include "../zotnet/tws.h" #include "../zotnet/mts.h" #ifdef LOCALE #include #endif /* */ static struct swit switches[] = { #define HELPSW 0 "help", 4, NULL, 0 }; /* */ /* ARGSUSED */ main (argc, argv) int argc; char **argv; { int md; char *cp, *file = NULL, buf[100], ddate[BUFSIZ], **ap, **argp, *arguments[MAXARGS]; #ifdef LOCALE setlocale(LC_ALL, ""); #endif invo_name = r1bindex (argv[0], '/'); mts_init (invo_name); if ((cp = m_find (invo_name)) != NULL) { ap = brkstring (cp = getcpy (cp), " ", "\n"); ap = copyip (ap, arguments); } else ap = arguments; (void) copyip (argv + 1, ap); argp = arguments; /* */ while (cp = *argp++) { if (*cp == '-') switch (smatch (++cp, switches)) { case AMBIGSW: ambigsw (cp, switches); done (1); case UNKWNSW: adios (NULLCP, "-%s unknown", cp); case HELPSW: (void) sprintf (buf, "%s [switches] file", invo_name); help (buf, switches); done (1); } if (file) adios (NULLCP, "only one file at a time!"); else file = cp; } /* */ if (!file) adios (NULLCP, "%s [switches] file", invo_name); (void) sprintf (ddate, "Delivery-Date: %s\n", dtimenow ()); rewind (stdin); if ((md = mbx_open (file, getuid (), getgid (), m_gmprot ())) == NOTOK || mbx_copy (file, md, fileno (stdin), 1, ddate, 0) == NOTOK || mbx_close (file, md) == NOTOK) { if (md != NOTOK) (void) mbx_close (file, md); done (RCV_MBX); } done (RCV_MOK); } @ 1.4 log @endif sugar @ text @d3 1 a3 1 static char ident[] = "@@(#)$Id: rcvpack.c,v 1.3 1992/11/04 00:57:54 jromine Exp jromine $"; a22 4 /* */ long lseek (); @ 1.3 log @LOCALE TYPESIG @ text @d3 2 a4 2 static char ident[] = "@@(#)$Id: rcvpack.c,v 1.2 1992/01/31 22:24:46 jromine Exp jromine $"; #endif lint @ 1.2 log @kerberos @ text @d3 1 a3 1 static char ident[] = "@@(#)$Id: scan.c,v 1.9 1992/01/23 23:06:45 jromine Exp $"; d11 3 d45 3 @ 1.1 log @Initial revision @ text @d2 3 d18 1 a18 1 NULL, NULL @