386BSD 0.1 development
[unix-history] / usr / src / usr.bin / tip / tip.h
index dd1490f..e0614eb 100644 (file)
@@ -1,18 +1,56 @@
-/*     tip.h   4.11    83/06/25        */
+/*
+ * 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.
+ *
+ * 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>
 
 /*
  * tip - terminal interface program
  */
 
 #include <sys/types.h>
+#include <machine/endian.h>
 #include <sys/file.h>
 #include <sys/file.h>
+#include <sys/time.h>
 
 #include <sgtty.h>
 #include <signal.h>
 #include <stdio.h>
 
 #include <sgtty.h>
 #include <signal.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 #include <pwd.h>
 #include <ctype.h>
 #include <setjmp.h>
 #include <pwd.h>
 #include <ctype.h>
 #include <setjmp.h>
+#include <unistd.h>
 #include <errno.h>
 
 /*
 #include <errno.h>
 
 /*
@@ -106,17 +144,26 @@ typedef
 typedef
        union {
                int     zz_number;
 typedef
        union {
                int     zz_number;
-               short   zz_boolean;
-               char    zz_character;
+               short   zz_boolean[2];
+               char    zz_character[4];
                int     *zz_address;
        }
        zzhack;
 
 #define value(v)       vtable[v].v_value
 
                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 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 address(v)     ((((zzhack *)(&(v))))->zz_address)
 
 /*
@@ -207,6 +254,8 @@ int AC;                     /* open file descriptor to dialer (v831 only) */
 int    vflag;                  /* print .tiprc initialization sequence */
 int    sfd;                    /* for ~< operation */
 int    pid;                    /* pid of tipout */
 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    stop;                   /* stop transfer session flag */
 int    quit;                   /* same; but on other end */
 int    intflag;                /* recognized interrupt */
@@ -224,13 +273,5 @@ int        odisc;                          /* initial tty line discipline */
 extern int disc;                       /* current tty discpline */
 
 extern char *ctrl();
 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 *vinterp();
-extern char *getenv();
-extern char *rindex();
-extern char *index();
-extern char *malloc();
 extern char *connect();
 extern char *connect();