BSD 4 release
[unix-history] / usr / src / cmd / sdb / head.h
index b492c81..1b02dd4 100644 (file)
@@ -1,10 +1,10 @@
-
-#include <stdio.h>
-#include <setjmp.h>
-#include "sgtty.h"
+/* "@(#)head.h 4.1 10/9/80" */
 #include <sys/vm.h>
 #define        PAGSIZ  (CLSIZE*NBPG)
 #include <sys/vm.h>
 #define        PAGSIZ  (CLSIZE*NBPG)
-#include "bio.h"
+#include <stdio.h>
+#include <setjmp.h>
+#include <sgtty.h>
+#include "old.h"
 #include "defs.h"
 
 /* input line decoding */
 #include "defs.h"
 
 /* input line decoding */
@@ -19,19 +19,28 @@ int scallf;         /* set to 1 iff procedure call */
 int    reflag;         /* set to 1 iff re */
 int    redir;          /* set to 1 iff forward search */
 int    colonflag;      /* set to 1 iff colon typed */
 int    reflag;         /* set to 1 iff re */
 int    redir;          /* set to 1 iff forward search */
 int    colonflag;      /* set to 1 iff colon typed */
+int    ncolonflag;     /* set to 1 iff colon typed after number */
+int    percentflag;    /* set to 1 iff percent symbol typed */
 
 /* source file i/o */
 char   curfile[30];    /* name of file being edited */
 int    fline;          /* line number in file */
 
 /* source file i/o */
 char   curfile[30];    /* name of file being edited */
 int    fline;          /* line number in file */
-int    maxfline;       /* maximum line number in file, 0 if unknown */
-struct brbuf  fiobuf;  /* file descriptor */
-char   fbuf[256];      /* current line from file */
+char   fbuf[BUFSIZ];   /* current line from file */
 char   filework[128];  /* place to put filename */
 char   *fp;            /* pointer to it */
 int    nolines;        /* set to 1 iff no lines in file */
 char   filework[128];  /* place to put filename */
 char   *fp;            /* pointer to it */
 int    nolines;        /* set to 1 iff no lines in file */
+#ifdef FLEXNAMES
+off_t  gstart;         /* start of string table in a.out */
+char   *strtab;        /* string table from a.out * (in core!) */
+long   ssiz;           /* size of string table (for range checks) */
+#endif
 
 /* returned by slookup */
 
 /* returned by slookup */
+#ifndef FLEXNAMES
 char   sl_name[8];
 char   sl_name[8];
+#else
+char   *sl_name;
+#endif
 char   sl_class;
 short  sl_type;
 int    sl_size, sl_addr;
 char   sl_class;
 short  sl_type;
 int    sl_size, sl_addr;
@@ -46,7 +55,9 @@ char dschar;                  /* '/' if value should be displayed */
 
 /* symbol table info */
 long   ststart;                /* offset of symbol table in a.out */
 
 /* symbol table info */
 long   ststart;                /* offset of symbol table in a.out */
+#ifndef VMUNIX
 struct brbuf sbuf;             /* buffer for symbol table */
 struct brbuf sbuf;             /* buffer for symbol table */
+#endif
 long   extstart;               /* offset of first external in a.out */
 
 /* address info */
 long   extstart;               /* offset of first external in a.out */
 
 /* address info */
@@ -64,14 +75,17 @@ struct sgttyb sdbttym, userttym;
 char   oldargs[128];
 char prname[50];               /* print name used by outvar */
 jmp_buf        env;                    /* environment for setjmp, longjmp */
 char   oldargs[128];
 char prname[50];               /* print name used by outvar */
 jmp_buf        env;                    /* environment for setjmp, longjmp */
-#define        WINDOW  10              /* window size for display commands */
-#define        COMMANDS        "\004\"+-=!/BCDRSTabcdegklmpqrstwzVXY"
-                               /* each sdb command must appear here */
 int    debug;                  /* toggled by Y command */
 time_t symtime;                /* modification time of symfil */
 int    debug;                  /* toggled by Y command */
 time_t symtime;                /* modification time of symfil */
+char   *symfil;
+char   *corfil;
+ADDR   exactaddr, lnfaddr;     /* set by adrtolineno() */
+ADDR   firstdata;              /* lowest address of data */
 
 #define        STABMASK        0376
 
 #define        STABMASK        0376
-
+#define        WINDOW  10              /* window size for display commands */
+#define        COMMANDS        "\004\"+-=!/BCDMQRSTXabcdegklmpqrstwxzVXY"
+                               /* each sdb command must appear here */
 #define NUMARGS 16             /* number of args allowed in sub call */
 #define SUBSTSP 512            /* length of space for sub args and strings */
 #define WORDSIZE 4             /* wordsize in bytes on this machine */
 #define NUMARGS 16             /* number of args allowed in sub call */
 #define SUBSTSP 512            /* length of space for sub args and strings */
 #define WORDSIZE 4             /* wordsize in bytes on this machine */
@@ -80,14 +94,22 @@ time_t      symtime;                /* modification time of symfil */
 #define MAXADDR 1L<<30
 
 struct filet {
 #define MAXADDR 1L<<30
 
 struct filet {
+#ifndef FLEXNAMES
        char    sfilename[31];  /* source file name */
        char    sfilename[31];  /* source file name */
+#else
+       char    *sfilename;
+#endif
        char    lineflag;       /* set iff this is a '#line' file */
        ADDR    faddr;          /* address in core */
        long    stf_offset;     /* offset in a.out */
 } *files, *badfile;
 
 struct proct {
        char    lineflag;       /* set iff this is a '#line' file */
        ADDR    faddr;          /* address in core */
        long    stf_offset;     /* offset in a.out */
 } *files, *badfile;
 
 struct proct {
+#ifndef FLEXNAMES
        char    pname[8];       /* procedure name */
        char    pname[8];       /* procedure name */
+#else
+       char    *pname;
+#endif
        ADDR    paddr;          /* address in core */
        long    st_offset;      /* offset in a.out */
        struct filet  *sfptr;   /* source file name pointer */
        ADDR    paddr;          /* address in core */
        long    st_offset;      /* offset in a.out */
        struct filet  *sfptr;   /* source file name pointer */
@@ -117,6 +139,6 @@ ADDR varaddr(), dispvar();
 ADDR extaddr(), formaddr(), stackreg();
 struct proct *curproc();
 struct proct *findproc();
 ADDR extaddr(), formaddr(), stackreg();
 struct proct *curproc();
 struct proct *findproc();
-struct proct *adrtoproc();
+struct proct *adrtoprocp();
 struct proct *initframe(), *nextframe();
 struct filet *findfile(), *adrtofilep();
 struct proct *initframe(), *nextframe();
 struct filet *findfile(), *adrtofilep();