BSD 4_4 release
[unix-history] / usr / src / usr.bin / ex / ex.h
index 03dc849..98d6a83 100644 (file)
@@ -1,5 +1,14 @@
-/* Copyright (c) 1981 Regents of the University of California */
-/* sccs id:    @(#)ex.h        7.2     %G%  */
+/*-
+ * Copyright (c) 1980, 1993
+ *     The Regents of the University of California.  All rights reserved.
+ *
+ * This module is believed to contain source code proprietary to AT&T.
+ * Use and redistribution is subject to the Berkeley Software License
+ * Agreement and your Software Agreement with AT&T (Western Electric).
+ *
+ *     @(#)ex.h        8.1 (Berkeley) 6/9/93
+ */
+
 #ifdef V6
 #include <retrofit.h>
 #endif
 #ifdef V6
 #include <retrofit.h>
 #endif
  * of additional terminal descriptions you add to the termcap data base.
  */
 
  * of additional terminal descriptions you add to the termcap data base.
  */
 
-#include <sys/types.h>
+#ifndef        vms
+#include <sys/param.h>
+#else
+#define        MAXBSIZE        1024    /* Maximum block size */
+#include <types.h>
+#endif
 #include <ctype.h>
 #include <errno.h>
 #include <signal.h>
 #include <setjmp.h>
 #include <ctype.h>
 #include <errno.h>
 #include <signal.h>
 #include <setjmp.h>
+#ifndef        vms
 #include <sys/stat.h>
 #include <sys/stat.h>
+#else
+#include <stat.h>
+#endif
 
 #ifndef var
 
 #ifndef var
-#define var    var
+#define var    extern
 #endif
 /*
  *     The following little dance copes with the new USG tty handling.
 #endif
 /*
  *     The following little dance copes with the new USG tty handling.
 #include <termio.h>
 #define CBREAK xxxxx
 #else
 #include <termio.h>
 #define CBREAK xxxxx
 #else
+#ifndef        vms
 #include <sgtty.h>
 #include <sgtty.h>
+#else
+#include "vmstty.h"
+#endif
 #endif
 
 extern int errno;
 #endif
 
 extern int errno;
@@ -105,6 +127,11 @@ struct     option {
 
 extern  struct option options[NOPTS + 1];
 
 
 extern  struct option options[NOPTS + 1];
 
+#ifdef vms
+#define        st_blksize      st_fab_mrs
+#define        _exit(n)        vms_exit(n)
+#define        fork()          vfork()
+#endif
 
 /*
  * The editor does not normally use the standard i/o library.  Because
 
 /*
  * The editor does not normally use the standard i/o library.  Because
@@ -119,20 +146,24 @@ extern     struct option options[NOPTS + 1];
  * are not debugging.  Such a modified printf exists in "printf.c" here.
  */
 #ifdef TRACE
  * are not debugging.  Such a modified printf exists in "printf.c" here.
  */
 #ifdef TRACE
-#      include <stdio.h>
+# include <stdio.h>
        var     FILE    *trace;
        var     bool    trubble;
        var     bool    techoin;
        var     char    tracbuf[BUFSIZ];
        var     FILE    *trace;
        var     bool    trubble;
        var     bool    techoin;
        var     char    tracbuf[BUFSIZ];
-#      undef   putchar
-#      undef   getchar
 #else
 # ifdef        VMUNIX
 #      define  BUFSIZ  1024
 # else
 #else
 # ifdef        VMUNIX
 #      define  BUFSIZ  1024
 # else
+#  ifdef u370
+#      define  BUFSIZ  4096
+#  else
 #      define  BUFSIZ  512
 #      define  BUFSIZ  512
+#  endif
 # endif
 # endif
+# ifndef NULL
 #      define  NULL    0
 #      define  NULL    0
+# endif
 #      define  EOF     -1
 #endif
 
 #      define  EOF     -1
 #endif
 
@@ -146,9 +177,12 @@ extern      struct option options[NOPTS + 1];
  */
 #define        QUOTE   0200
 #define        TRIM    0177
  */
 #define        QUOTE   0200
 #define        TRIM    0177
-#define        CTRL(c) ('c' & 037)
-#define        NL      CTRL(j)
-#define        CR      CTRL(m)
+#ifndef vms
+#undef CTRL
+#endif
+#define        CTRL(c) (c & 037)
+#define        NL      CTRL('j')
+#define        CR      CTRL('m')
 #define        DELETE  0177            /* See also ATTN, QUIT in ex_tune.h */
 #define        ESCAPE  033
 
 #define        DELETE  0177            /* See also ATTN, QUIT in ex_tune.h */
 #define        ESCAPE  033
 
@@ -167,12 +201,12 @@ var       bool    dosusp;         /* Do SIGTSTP in visual when ^Z typed */
 var    bool    edited;         /* Current file is [Edited] */
 var    line    *endcore;       /* Last available core location */
 extern  bool   endline;        /* Last cmd mode command ended with \n */
 var    bool    edited;         /* Current file is [Edited] */
 var    line    *endcore;       /* Last available core location */
 extern  bool   endline;        /* Last cmd mode command ended with \n */
-#ifndef VMUNIX
+#ifdef EXSTRINGS
 var    short   erfile;         /* Error message file unit */
 #endif
 var    line    *fendcore;      /* First address in line pointer space */
 var    char    file[FNSIZE];   /* Working file name */
 var    short   erfile;         /* Error message file unit */
 #endif
 var    line    *fendcore;      /* First address in line pointer space */
 var    char    file[FNSIZE];   /* Working file name */
-var    char    genbuf[LBSIZE]; /* Working buffer when manipulating linebuf */
+var    char    genbuf[MAXBSIZE]; /* Working buffer when manipulating linebuf */
 var    bool    hush;           /* Command line option - was given, hush up! */
 var    char    *globp;         /* (Untyped) input string to command mode */
 var    bool    holdcm;         /* Don't cursor address */
 var    bool    hush;           /* Command line option - was given, hush up! */
 var    char    *globp;         /* (Untyped) input string to command mode */
 var    bool    holdcm;         /* Don't cursor address */
@@ -216,6 +250,7 @@ var bool    vcatch;         /* Want to catch an error (open/visual) */
 var    jmp_buf vreslab;        /* For error throws to a visual catch */
 var    bool    writing;        /* 1 if in middle of a file write */
 var    int     xchng;          /* Suppresses multiple "No writes" in !cmd */
 var    jmp_buf vreslab;        /* For error throws to a visual catch */
 var    bool    writing;        /* 1 if in middle of a file write */
 var    int     xchng;          /* Suppresses multiple "No writes" in !cmd */
+var    long    bsize;          /* Block size for disk i/o */
 
 /*
  * Macros
 
 /*
  * Macros
@@ -326,8 +361,8 @@ char        *getpass();
 
 extern int     (*Outchar)();
 extern int     (*Pline)();
 
 extern int     (*Outchar)();
 extern int     (*Pline)();
-extern int     (*Putchar)();
-var    int     (*oldhup)();
+extern int     (*Put_char)();
+sig_t  oldhup;
 int    (*setlist())();
 int    (*setnorm())();
 int    (*setnorm())();
 int    (*setlist())();
 int    (*setnorm())();
 int    (*setnorm())();
@@ -337,6 +372,9 @@ char        *cgoto();
 char   *genindent();
 char   *getblock();
 char   *getenv();
 char   *genindent();
 char   *getblock();
 char   *getenv();
+#ifdef vms
+char   *getlog();
+#endif
 line   *getmark();
 char   *longname();
 char   *mesg();
 line   *getmark();
 char   *longname();
 char   *mesg();
@@ -360,7 +398,7 @@ char        *vskipwh();
 int    put();
 int    putreg();
 int    YANKreg();
 int    put();
 int    putreg();
 int    YANKreg();
-int    delete();
+int    ex_delete();
 int    execl();
 int    filter();
 int    getfile();
 int    execl();
 int    filter();
 int    getfile();
@@ -372,16 +410,16 @@ off_t     lseek();
 int    normchar();
 int    normline();
 int    numbline();
 int    normchar();
 int    normline();
 int    numbline();
-var    int     (*oldquit)();
-int    onhup();
-int    onintr();
-int    onsusp();
+var    void (*oldquit)();
+void   onhup();
+void   onintr();
+void   onsusp();
 int    putch();
 int    shift();
 int    termchar();
 int    vfilter();
 #ifdef CBREAK
 int    putch();
 int    shift();
 int    termchar();
 int    vfilter();
 #ifdef CBREAK
-int    vintr();
+void   vintr();
 #endif
 int    vputch();
 int    vshftop();
 #endif
 int    vputch();
 int    vshftop();