break out special local mail processing (e.g., mapping to the
[unix-history] / usr / src / bin / csh / csh.h
index 16c5f89..12417de 100644 (file)
@@ -1,10 +1,10 @@
 /*-
 /*-
- * Copyright (c) 1980, 1991 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1991, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  * %sccs.include.redist.c%
  *
  *
  * %sccs.include.redist.c%
  *
- *     @(#)csh.h       5.20 (Berkeley) %G%
+ *     @(#)csh.h       8.1 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -45,6 +45,12 @@ typedef char Char;
 #define SAVE(a) (strsave(a))
 #endif
 
 #define SAVE(a) (strsave(a))
 #endif
 
+/*
+ * Make sure a variable is not stored in a register by taking its address
+ * This is used where variables might be clobbered by longjmp.
+ */
+#define UNREGISTER(a)  (void) &a
+
 typedef void *ioctl_t;         /* Third arg of ioctl */
 
 typedef void *ptr_t;
 typedef void *ioctl_t;         /* Third arg of ioctl */
 
 typedef void *ptr_t;
@@ -53,27 +59,16 @@ typedef void *ptr_t;
 #include "char.h"
 #include "err.h"
 
 #include "char.h"
 #include "err.h"
 
-#ifdef SYSMALLOC
 #define xmalloc(i)     Malloc(i)
 #define xrealloc(p, i) Realloc(p, i)
 #define xcalloc(n, s)  Calloc(n, s)
 #define xfree(p)       Free(p)
 #define xmalloc(i)     Malloc(i)
 #define xrealloc(p, i) Realloc(p, i)
 #define xcalloc(n, s)  Calloc(n, s)
 #define xfree(p)       Free(p)
-#else
-#define xmalloc(i)     malloc(i)
-#define xrealloc(p, i) realloc(p, i)
-#define xcalloc(n, s)  calloc(n, s)
-#define xfree(p)       free(p)
-#endif                         /* SYSMALLOC */
 
 #include <stdio.h>
 FILE *cshin, *cshout, *csherr;
 
 #define        isdir(d)        ((d.st_mode & S_IFMT) == S_IFDIR)
 
 
 #include <stdio.h>
 FILE *cshin, *cshout, *csherr;
 
 #define        isdir(d)        ((d.st_mode & S_IFMT) == S_IFDIR)
 
-#define SIGN_EXTEND_CHAR(a) \
-       ((a) & 0x80 ? ((int) (a)) | 0xffffff00 : ((int) a) & 0x000000ff)
-
-
 typedef int bool;
 
 #define        eq(a, b)        (Strcmp(a, b) == 0)
 typedef int bool;
 
 #define        eq(a, b)        (Strcmp(a, b) == 0)
@@ -117,6 +112,7 @@ Char   *ffile;                      /* Name of shell file for $0 */
 char   *seterr;                        /* Error message from scanner/parser */
 Char   *shtemp;                        /* Temp name for << shell files in /tmp */
 
 char   *seterr;                        /* Error message from scanner/parser */
 Char   *shtemp;                        /* Temp name for << shell files in /tmp */
 
+#include <sys/types.h>
 #include <sys/time.h>
 #include <sys/resource.h>
 
 #include <sys/time.h>
 #include <sys/resource.h>
 
@@ -128,8 +124,8 @@ struct rusage ru0;
  */
 Char   *doldol;                        /* Character pid for $$ */
 int    backpid;                /* Pid of the last background process */
  */
 Char   *doldol;                        /* Character pid for $$ */
 int    backpid;                /* Pid of the last background process */
-int     uid;                   /* Invokers uid */
-int     gid;                   /* Invokers gid */
+int     uid, euid;             /* Invokers uid */
+int     gid, egid;             /* Invokers gid */
 time_t  chktim;                        /* Time mail last checked */
 int     shpgrp;                        /* Pgrp of shell */
 int     tpgrp;                 /* Terminal process group */
 time_t  chktim;                        /* Time mail last checked */
 int     shpgrp;                        /* Pgrp of shell */
 int     tpgrp;                 /* Terminal process group */
@@ -143,8 +139,7 @@ int     opgrp;                      /* Initial pgrp and tty pgrp */
  * descriptors it uses away from 0,1,2.
  * Ideally these should be in units which are closed across exec's
  * (this saves work) but for version 6, this is not usually possible.
  * descriptors it uses away from 0,1,2.
  * Ideally these should be in units which are closed across exec's
  * (this saves work) but for version 6, this is not usually possible.
- * The desired initial values for these descriptors are defined in
- * local.h.
+ * The desired initial values for these descriptors are F{SHIN,...}.
  */
 int   SHIN;                    /* Current shell input (script) */
 int   SHOUT;                   /* Shell output */
  */
 int   SHIN;                    /* Current shell input (script) */
 int   SHOUT;                   /* Shell output */
@@ -219,7 +214,12 @@ struct Ain {
 #define A_SEEK 0               /* Alias seek */
 #define F_SEEK 1               /* File seek */
 #define E_SEEK 2               /* Eval seek */
 #define A_SEEK 0               /* Alias seek */
 #define F_SEEK 1               /* File seek */
 #define E_SEEK 2               /* Eval seek */
-    off_t f_seek;
+    union {
+       off_t _f_seek;
+       Char* _c_seek;
+    } fc;
+#define f_seek fc._f_seek
+#define c_seek fc._c_seek
     Char **a_seek;
 } ;
 extern int aret;               /* What was the last character returned */
     Char **a_seek;
 } ;
 extern int aret;               /* What was the last character returned */