version 1.12, 2001/04/12 19:21:43 |
version 1.13, 2001/09/09 19:30:49 |
|
|
void intprompt(); |
void intprompt(); |
void timeout(); |
void timeout(); |
void cleanup(); |
void cleanup(); |
char *sname(); |
|
char PNbuf[256]; /* This limits the size of a number */ |
char PNbuf[256]; /* This limits the size of a number */ |
|
|
int |
int |
|
|
egid = getegid(); |
egid = getegid(); |
uid = getuid(); |
uid = getuid(); |
euid = geteuid(); |
euid = geteuid(); |
if (equal(sname(argv[0]), "cu")) { |
if (equal(__progname, "cu")) { |
cumode = 1; |
cumode = 1; |
cumain(argc, argv); |
cumain(argc, argv); |
goto cucommon; |
goto cucommon; |
|
|
exit(1); |
exit(1); |
} |
} |
if (!isatty(0)) { |
if (!isatty(0)) { |
fprintf(stderr, "tip: must be interactive\n"); |
fprintf(stderr, "%s: must be interactive\n", __progname); |
exit(1); |
exit(1); |
} |
} |
|
|
|
|
break; |
break; |
|
|
default: |
default: |
fprintf(stderr, "tip: %s, unknown option\n", argv[1]); |
fprintf(stderr, "%s: %s, unknown option\n", __progname, |
|
argv[1]); |
break; |
break; |
} |
} |
} |
} |
|
|
* is private, we don't want 'ps' or 'w' to find it). |
* is private, we don't want 'ps' or 'w' to find it). |
*/ |
*/ |
if (strlen(system) > sizeof PNbuf - 1) { |
if (strlen(system) > sizeof PNbuf - 1) { |
fprintf(stderr, "tip: phone number too long (max = %d bytes)\n", |
fprintf(stderr, "%s: phone number too long (max = %d bytes)\n", |
sizeof PNbuf - 1); |
__progname, sizeof(PNbuf) - 1); |
exit(1); |
exit(1); |
} |
} |
strncpy( PNbuf, system, sizeof PNbuf - 1 ); |
strncpy( PNbuf, system, sizeof PNbuf - 1 ); |
|
|
vinit(); /* init variables */ |
vinit(); /* init variables */ |
setparity("none"); /* set the parity table */ |
setparity("none"); /* set the parity table */ |
if ((i = speed(number(value(BAUDRATE)))) == 0) { |
if ((i = speed(number(value(BAUDRATE)))) == 0) { |
printf("tip: bad baud rate %ld\n", number(value(BAUDRATE))); |
printf("%s: bad baud rate %ld\n", __progname, |
|
number(value(BAUDRATE))); |
daemon_uid(); |
daemon_uid(); |
(void)uu_unlock(uucplock); |
(void)uu_unlock(uucplock); |
exit(3); |
exit(3); |
|
|
if (boolean(value(TAND))) |
if (boolean(value(TAND))) |
cntrl.c_iflag |= IXOFF; |
cntrl.c_iflag |= IXOFF; |
tcsetattr(FD, TCSAFLUSH, &cntrl); |
tcsetattr(FD, TCSAFLUSH, &cntrl); |
} |
|
|
|
/* |
|
* Return "simple" name from a file name, |
|
* strip leading directories. |
|
*/ |
|
char * |
|
sname(s) |
|
register char *s; |
|
{ |
|
register char *p = s; |
|
|
|
while (*s) |
|
if (*s++ == '/') |
|
p = s; |
|
return (p); |
|
} |
} |
|
|
static char partab[0200]; |
static char partab[0200]; |