SCCS-vsn: sbin/dump/unctime.c 5.2
SCCS-vsn: sbin/dump/dumprmt.c 5.9
-static char sccsid[] = "@(#)dumprmt.c 5.8 (Berkeley) %G%";
-#endif not lint
+static char sccsid[] = "@(#)dumprmt.c 5.9 (Berkeley) %G%";
+#endif /* not lint */
#include <sys/param.h>
#include <sys/mtio.h>
#include <sys/param.h>
#include <sys/mtio.h>
#include <protocols/dumprestore.h>
#include <pwd.h>
#include <stdio.h>
#include <protocols/dumprestore.h>
#include <pwd.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include "pathnames.h"
#define TS_CLOSED 0
#include "pathnames.h"
#define TS_CLOSED 0
static int rmtstate = TS_CLOSED;
int rmtape;
static int rmtstate = TS_CLOSED;
int rmtape;
+void rmtgetconn();
+void rmtconnaborted();
+int rmtreply();
+int rmtgetb();
+void rmtgets();
+int rmtcall();
char *rmtpeer;
extern int ntrec; /* blocking factor on tape */
char *rmtpeer;
extern int ntrec; /* blocking factor on tape */
rmthost(host)
char *host;
{
rmthost(host)
char *host;
{
rmtgetconn()
{
static struct servent *sp = 0;
rmtgetconn()
{
static struct servent *sp = 0;
rmtopen(tape, mode)
char *tape;
int mode;
rmtopen(tape, mode)
char *tape;
int mode;
return (rmtcall(tape, buf));
}
return (rmtcall(tape, buf));
}
rmtread(buf, count)
char *buf;
int count;
rmtread(buf, count)
char *buf;
int count;
rmtwrite(buf, count)
char *buf;
int count;
rmtwrite(buf, count)
char *buf;
int count;
return (rmtreply("write"));
}
return (rmtreply("write"));
}
rmtwrite0(count)
int count;
{
rmtwrite0(count)
int count;
{
write(rmtape, line, strlen(line));
}
write(rmtape, line, strlen(line));
}
rmtwrite1(buf, count)
char *buf;
int count;
rmtwrite1(buf, count)
char *buf;
int count;
write(rmtape, buf, count);
}
write(rmtape, buf, count);
}
return (rmtreply("write"));
}
return (rmtreply("write"));
}
rmtseek(offset, pos)
int offset, pos;
{
rmtseek(offset, pos)
int offset, pos;
{
rmtioctl(cmd, count)
int cmd, count;
{
rmtioctl(cmd, count)
int cmd, count;
{
return (rmtcall("ioctl", buf));
}
return (rmtcall("ioctl", buf));
}
rmtcall(cmd, buf)
char *cmd, *buf;
{
rmtcall(cmd, buf)
char *cmd, *buf;
{
return (rmtreply(cmd));
}
return (rmtreply(cmd));
}
rmtreply(cmd)
char *cmd;
{
rmtreply(cmd)
char *cmd;
{
char code[30], emsg[BUFSIZ];
rmtgets(code, sizeof (code));
char code[30], emsg[BUFSIZ];
rmtgets(code, sizeof (code));
return (atoi(code + 1));
}
return (atoi(code + 1));
}
rmtgets(cp, len)
char *cp;
int len;
rmtgets(cp, len)
char *cp;
int len;
-static char sccsid[] = "@(#)unctime.c 5.1 (Berkeley) %G%";
-#endif not lint
+static char sccsid[] = "@(#)unctime.c 5.2 (Berkeley) %G%";
+#endif /* not lint */
#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
/*
* Convert a ctime(3) format string into a system format date.
* Return the date thus calculated.
/*
* Convert a ctime(3) format string into a system format date.
* Return the date thus calculated.
#define E_SECOND 17
#define E_YEAR 20
#define E_SECOND 17
#define E_YEAR 20
+static int lookup();
+
+time_t
+unctime(str)
char *str;
{
struct tm then;
char *str;
{
struct tm then;
str[25] = 0;
strcpy(dbuf, str);
dbuf[E_MONTH+3] = 0;
str[25] = 0;
strcpy(dbuf, str);
dbuf[E_MONTH+3] = 0;
- if ( (then.tm_mon = lookup(&dbuf[E_MONTH])) < 0) {
- return(-1);;
- }
+ if ((then.tm_mon = lookup(&dbuf[E_MONTH])) < 0)
+ return (-1);
then.tm_mday = atoi(&dbuf[E_DAY]);
then.tm_hour = atoi(&dbuf[E_HOUR]);
then.tm_min = atoi(&dbuf[E_MINUTE]);
then.tm_mday = atoi(&dbuf[E_DAY]);
then.tm_hour = atoi(&dbuf[E_HOUR]);
then.tm_min = atoi(&dbuf[E_MINUTE]);
static char months[] =
"JanFebMarAprMayJunJulAugSepOctNovDec";
static char months[] =
"JanFebMarAprMayJunJulAugSepOctNovDec";
*/
struct tm *localtime();
*/
struct tm *localtime();
struct tm *dp;
{
time_t conv;
struct tm *dp;
{
time_t conv;
if (dp->a < dp2->a) \
return(-1)
if (dp->a < dp2->a) \
return(-1)
dcmp(dp, dp2)
register struct tm *dp, *dp2;
{
dcmp(dp, dp2)
register struct tm *dp, *dp2;
{