Update date2 and tip.

This commit is contained in:
Serge
2022-06-18 15:10:26 -07:00
parent 1febcc5f9f
commit c849b8f1f8
10 changed files with 142 additions and 81 deletions

View File

@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#define ATOI2(ar) (ar[0] - '0') * 10 + (ar[1] - '0'); ar += 2;
@@ -39,7 +40,7 @@ static struct utmp wtmp[2] = {
* gtime --
* convert user's time into number of seconds
*/
static
static int
gtime(ap)
register char *ap; /* user argument */
{
@@ -242,15 +243,15 @@ void fmttime(char *fmt, struct tm *tm)
printf("%d",tm->tm_isdst);
break;
case 'O':
printf("%02d%02d",tm->tm_gmtoff/60,tm->tm_gmtoff%60);
printf("%02ld%02ld", tm->tm_gmtoff/60, tm->tm_gmtoff%60);
break;
case 'P':
printf("%02d:%02d",tm->tm_gmtoff/60,tm->tm_gmtoff%60);
printf("%02ld:%02ld", tm->tm_gmtoff/60, tm->tm_gmtoff%60);
break;
case 'T':
printf("%s",tm->tm_zone);
break;
/*
int tm_sec;
int tm_min;
@@ -292,10 +293,10 @@ void fmttime(char *fmt, struct tm *tm)
break;
}
}
}
main(argc,argv)
int main(argc, argv)
int argc;
char **argv;
{

View File

@@ -155,7 +155,7 @@ acutype(s)
register acu_t *p;
extern acu_t acutable[];
for (p = acutable; p->acu_name != '\0'; p++)
for (p = acutable; p->acu_name != NULL; p++)
if (!strcmp(s, p->acu_name))
return (p);
return (NOACU);

View File

@@ -141,9 +141,7 @@ sigALRM(int i)
}
static int
gobble(match, response)
register char match;
char response[];
gobble(char match, char response[])
{
register char *cp = response;
char c;

View File

@@ -210,17 +210,19 @@ int v831_dialer(num, acu)
void v831_abort()
{
#ifdef DEBUG
printf("[abort: AC=%d]\n", AC);
#endif
sleep(2);
if (child > 0)
if (child > 0) {
kill(child, SIGKILL);
if (AC > 0)
}
if (AC > 0) {
ioctl(FD, TIOCNXCL, (struct sgttyb *)NULL);
close(AC);
if (FD > 0)
}
if (FD > 0) {
ioctl(FD, TIOCCDTR, 0);
}
close(FD);
}

View File

@@ -140,9 +140,7 @@ sigALRM(int i)
}
static int
gobble(match, response)
register char match;
char response[];
gobble(char match, char response[])
{
register char *cp = response;
char c;

View File

@@ -835,7 +835,7 @@ expand(name)
close(pivec[1]);
l = read(pivec[0], xname, BUFSIZ);
close(pivec[0]);
while (wait(&s) != pid);
while (wait(&s) != pid)
;
s &= 0377;
if (s != 0 && s != SIGPIPE) {

View File

@@ -20,7 +20,7 @@
int bauds[] = {
0, 50, 75, 150, 200, 300, 600,
1200, 1800, 2400, 4800, 9600, 19200,
1200, 1800, 2400, 4800, 9600, 19200,
38400, 57600, 115200, 230400, 460800,
500000, 576000, 921600, 1000000, 1152000,
1500000, 2000000, 2500000, 3000000,
@@ -28,12 +28,73 @@ int bauds[] = {
};
int disc = 0; // OTTYDISC; /* tip normally runs this way */
void intprompt(int i);
void timeout(int i);
void cleanup(int i);
char *sname();
char PNbuf[256]; /* This limits the size of a number */
char *DV; /* UNIX device(s) to open */
char *EL; /* chars marking an EOL */
char *CM; /* initial connection message */
char *IE; /* EOT to expect on input */
char *OE; /* EOT to send to complete FT */
char *CU; /* call unit if making a phone call */
char *AT; /* acu type */
char *PN; /* phone number(s) */
char *DI; /* disconnect string */
char *PA; /* parity to be generated */
char *PH; /* phone number file */
char *HO; /* host name */
int BR; /* line speed for conversation */
int FS; /* frame size for transfers */
char DU; /* this host is dialed up */
char HW; /* this device is hardwired, see hunt.c */
char *ES; /* escape character */
char *EX; /* exceptions */
char *FO; /* force (literal next) char*/
char *RC; /* raise character */
char *RE; /* script record file */
char *PR; /* remote prompt */
int DL; /* line delay for file transfers to remote */
int CL; /* char delay for file transfers to remote */
int ET; /* echocheck timeout */
char HD; /* this host is half duplex - do local echo */
int vflag; /* verbose during reading of .tiprc file */
struct sgttyb arg; /* current mode of local terminal */
struct sgttyb defarg; /* initial mode of local terminal */
struct tchars tchars; /* current state of terminal */
struct tchars defchars; /* initial state of terminal */
struct ltchars ltchars; /* current local characters of terminal */
struct ltchars deflchars; /* initial local characters of terminal */
FILE *fscript; /* FILE for scripting */
int fildes[2]; /* file transfer synchronization channel */
int repdes[2]; /* read process sychronization channel */
int FD; /* open file descriptor to remote host */
int AC; /* open file descriptor to dialer (v831 only) */
int vflag; /* print .tiprc initialization sequence */
int sfd; /* for ~< operation */
int pid; /* pid of tipout */
uid_t uid, euid; /* real and effective user id's */
gid_t gid, egid; /* real and effective group id's */
int stop; /* stop transfer session flag */
int quit; /* same; but on other end */
int intflag; /* recognized interrupt */
int stoprompt; /* for interrupting a prompt session */
int timedout; /* ~> transfer timedout */
int cumode; /* simulating the "cu" program */
char fname[80]; /* file name buffer for ~< */
char copyname[80]; /* file name buffer for ~> */
char ccc; /* synchronization character */
char ch; /* for tipout */
char *uucplock; /* name of lock file for uucp's */
int odisc; /* initial tty line discipline */
int disc; /* current tty discpline */
void intprompt(int i);
void timeout(int i);
void cleanup(int i);
char *sname();
/*
* ****TIPIN TIPIN****
*/

View File

@@ -32,36 +32,36 @@
/*
* Remote host attributes
*/
char *DV; /* UNIX device(s) to open */
char *EL; /* chars marking an EOL */
char *CM; /* initial connection message */
char *IE; /* EOT to expect on input */
char *OE; /* EOT to send to complete FT */
char *CU; /* call unit if making a phone call */
char *AT; /* acu type */
char *PN; /* phone number(s) */
char *DI; /* disconnect string */
char *PA; /* parity to be generated */
extern char *DV; /* UNIX device(s) to open */
extern char *EL; /* chars marking an EOL */
extern char *CM; /* initial connection message */
extern char *IE; /* EOT to expect on input */
extern char *OE; /* EOT to send to complete FT */
extern char *CU; /* call unit if making a phone call */
extern char *AT; /* acu type */
extern char *PN; /* phone number(s) */
extern char *DI; /* disconnect string */
extern char *PA; /* parity to be generated */
char *PH; /* phone number file */
char *RM; /* remote file name */
char *HO; /* host name */
extern char *PH; /* phone number file */
extern char *RM; /* remote file name */
extern char *HO; /* host name */
int BR; /* line speed for conversation */
int FS; /* frame size for transfers */
extern int BR; /* line speed for conversation */
extern int FS; /* frame size for transfers */
char DU; /* this host is dialed up */
char HW; /* this device is hardwired, see hunt.c */
char *ES; /* escape character */
char *EX; /* exceptions */
char *FO; /* force (literal next) char*/
char *RC; /* raise character */
char *RE; /* script record file */
char *PR; /* remote prompt */
int DL; /* line delay for file transfers to remote */
int CL; /* char delay for file transfers to remote */
int ET; /* echocheck timeout */
char HD; /* this host is half duplex - do local echo */
extern char DU; /* this host is dialed up */
extern char HW; /* this device is hardwired, see hunt.c */
extern char *ES; /* escape character */
extern char *EX; /* exceptions */
extern char *FO; /* force (literal next) char*/
extern char *RC; /* raise character */
extern char *RE; /* script record file */
extern char *PR; /* remote prompt */
extern int DL; /* line delay for file transfers to remote */
extern int CL; /* char delay for file transfers to remote */
extern int ET; /* echocheck timeout */
extern char HD; /* this host is half duplex - do local echo */
/*
* String value table
@@ -192,39 +192,39 @@ extern value_t vtable[]; /* variable table */
#define NOFILE ((FILE *)NULL)
#define NOPWD ((struct passwd *)0)
struct sgttyb arg; /* current mode of local terminal */
struct sgttyb defarg; /* initial mode of local terminal */
struct tchars tchars; /* current state of terminal */
struct tchars defchars; /* initial state of terminal */
struct ltchars ltchars; /* current local characters of terminal */
struct ltchars deflchars; /* initial local characters of terminal */
extern struct sgttyb arg; /* current mode of local terminal */
extern struct sgttyb defarg; /* initial mode of local terminal */
extern struct tchars tchars; /* current state of terminal */
extern struct tchars defchars; /* initial state of terminal */
extern struct ltchars ltchars; /* current local characters of terminal */
extern struct ltchars deflchars; /* initial local characters of terminal */
FILE *fscript; /* FILE for scripting */
extern FILE *fscript; /* FILE for scripting */
int fildes[2]; /* file transfer synchronization channel */
int repdes[2]; /* read process sychronization channel */
int FD; /* open file descriptor to remote host */
int AC; /* open file descriptor to dialer (v831 only) */
int vflag; /* print .tiprc initialization sequence */
int sfd; /* for ~< operation */
int pid; /* pid of tipout */
uid_t uid, euid; /* real and effective user id's */
gid_t gid, egid; /* real and effective group id's */
int stop; /* stop transfer session flag */
int quit; /* same; but on other end */
int intflag; /* recognized interrupt */
int stoprompt; /* for interrupting a prompt session */
int timedout; /* ~> transfer timedout */
int cumode; /* simulating the "cu" program */
extern int fildes[2]; /* file transfer synchronization channel */
extern int repdes[2]; /* read process sychronization channel */
extern int FD; /* open file descriptor to remote host */
extern int AC; /* open file descriptor to dialer (v831 only) */
extern int vflag; /* print .tiprc initialization sequence */
extern int sfd; /* for ~< operation */
extern int pid; /* pid of tipout */
extern uid_t uid, euid; /* real and effective user id's */
extern gid_t gid, egid; /* real and effective group id's */
extern int stop; /* stop transfer session flag */
extern int quit; /* same; but on other end */
extern int intflag; /* recognized interrupt */
extern int stoprompt; /* for interrupting a prompt session */
extern int timedout; /* ~> transfer timedout */
extern int cumode; /* simulating the "cu" program */
char fname[80]; /* file name buffer for ~< */
char copyname[80]; /* file name buffer for ~> */
char ccc; /* synchronization character */
char ch; /* for tipout */
char *uucplock; /* name of lock file for uucp's */
extern char fname[80]; /* file name buffer for ~< */
extern char copyname[80]; /* file name buffer for ~> */
extern char ccc; /* synchronization character */
extern char ch; /* for tipout */
extern char *uucplock; /* name of lock file for uucp's */
int odisc; /* initial tty line discipline */
extern int disc; /* current tty discpline */
extern int odisc; /* initial tty line discipline */
extern int disc; /* current tty discpline */
char *ctrl (int c);
char *connect (void);

View File

@@ -240,7 +240,7 @@ vtoken(s)
if (p) {
cp++;
if (p->v_type&NUMBER)
vassign(p, atoi(cp));
vassign(p, (char*) atoi(cp));
else {
if (strcmp(s, "record") == 0)
cp = expand(cp);
@@ -308,7 +308,7 @@ int vstring(s, v)
if (p == 0)
return (1);
if (p->v_type&NUMBER)
vassign(p, atoi(v));
vassign(p, (char*) atoi(v));
else {
if (strcmp(s, "record") == 0)
v = expand(v);

View File

@@ -91,6 +91,7 @@ int hzto (struct timeval *tv);
#include <time.h>
int gettimeofday (struct timeval *tv, struct timezone *tz);
int settimeofday (const struct timeval *tv, const struct timezone *tz);
int utimes (const char *filename, const struct timeval times[2]);
int getitimer (int which, struct itimerval *curr_value);
int setitimer (int which, const struct itimerval *new_value,