-/* tip.h 4.9 83/05/17 */
/*
- * tip - terminal interface program
+ * Copyright (c) 1983 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
*
- * Samuel J. Leffler
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)tip.h 5.7 (Berkeley) 3/27/91
+ */
+
+/*
+ * tip - terminal interface program
*/
+#include <sys/types.h>
+#include <machine/endian.h>
+#include <sys/file.h>
+#include <sys/time.h>
+
#include <sgtty.h>
#include <signal.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
#include <pwd.h>
-#include <sys/types.h>
#include <ctype.h>
+#include <setjmp.h>
+#include <unistd.h>
+#include <errno.h>
/*
* Remote host attributes
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 *RM; /* remote file name */
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 */
/*
* String value table
typedef
union {
int zz_number;
- int zz_boolean;
- int zz_character;
+ short zz_boolean[2];
+ char zz_character[4];
int *zz_address;
}
zzhack;
#define value(v) vtable[v].v_value
-#define boolean(v) ((((zzhack *)(&(v))))->zz_boolean)
#define number(v) ((((zzhack *)(&(v))))->zz_number)
-#define character(v) ((((zzhack *)(&(v))))->zz_character)
+
+#if BYTE_ORDER == LITTLE_ENDIAN
+#define boolean(v) ((((zzhack *)(&(v))))->zz_boolean[0])
+#define character(v) ((((zzhack *)(&(v))))->zz_character[0])
+#endif
+
+#if BYTE_ORDER == BIG_ENDIAN
+#define boolean(v) ((((zzhack *)(&(v))))->zz_boolean[1])
+#define character(v) ((((zzhack *)(&(v))))->zz_character[3])
+#endif
+
#define address(v) ((((zzhack *)(&(v))))->zz_address)
/*
#define FORCE 8
#define FRAMESIZE 9
#define HOST 10
-#if ACULOG
-#define LOCK 11
-#define LOG 12
-#define PHONES 13
-#define PROMPT 14
-#define RAISE 15
-#define RAISECHAR 16
-#define RECORD 17
-#define REMOTE 18
-#define SCRIPT 19
-#define TABEXPAND 20
-#define VERBOSE 21
-#define SHELL 22
-#define HOME 23
-#define ECHOCHECK 24
-#else
-#define PHONES 11
-#define PROMPT 12
-#define RAISE 13
-#define RAISECHAR 14
-#define RECORD 15
-#define REMOTE 16
-#define SCRIPT 17
-#define TABEXPAND 18
-#define VERBOSE 19
-#define SHELL 20
-#define HOME 21
-#define ECHOCHECK 22
-#endif
+#define LOG 11
+#define PHONES 12
+#define PROMPT 13
+#define RAISE 14
+#define RAISECHAR 15
+#define RECORD 16
+#define REMOTE 17
+#define SCRIPT 18
+#define TABEXPAND 19
+#define VERBOSE 20
+#define SHELL 21
+#define HOME 22
+#define ECHOCHECK 23
+#define DISCONNECT 24
+#define TAND 25
+#define LDELAY 26
+#define CDELAY 27
+#define ETIMEOUT 28
+#define RAWFTP 29
+#define HALFDUPLEX 30
+#define LECHO 31
+#define PARITY 32
#define NOVAL ((value_t *)NULL)
#define NOACU ((acu_t *)NULL)
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 */
char ch; /* for tipout */
char *uucplock; /* name of lock file for uucp's */
-/*
- * From <sys/tty.h> (PDP-11 V7) ... it's put in here to avoid lots
- * of naming conflicts with stuff we have to pull in to use tty.h
- */
-#ifndef TIOCFLUSH
-# define TIOCFLUSH (('t'<<8)|16)
-#endif
-
-/*
- * On PDP-11 V7 systems with Rand's capacity call use this
- * stuff, otherwise <assuming it's a VM system> use FIONREAD
- */
-#ifndef FIONREAD
-#define FIOCAPACITY (('f'<<8)|3)
-
-struct capacity {
- off_t cp_nbytes;
- char cp_eof;
-};
-#endif
-
-#ifdef VMUNIX
int odisc; /* initial tty line discipline */
-extern int disc; /* current tty discpline */
-#endif
+extern int disc; /* current tty discpline */
-extern char *ctrl();
-extern char *ctime();
-extern long time();
-extern struct passwd *getpwuid();
-extern char *getlogin();
-extern char *vinterp();
-extern char *getenv();
-extern char *rindex();
-extern char *index();
-extern char *malloc();
-extern char *connect();
+extern char *ctrl();
+extern char *vinterp();
+extern char *connect();