# 2.11BSD#431 - /usr/src/usr.bin/m4/mdef.h

##### Macros

    ALL               X
    ARGFLAG           X
    BUFSIZE           X
    CALTYP            X
    CHNCTYPE          X
    CHNQTYPE          X
    COMMA             X
    DECRTYPE          X
    DEFITYPE          X
    DEFNTYPE          X
    DIVNTYPE          X
    DIVRTYPE          X
    DNLNTYPE          X
    DUMPTYPE          X
    ECOMMT            X
    EOS               X
    ERRPTYPE          X
    EXITTYPE          X
    EXPRTYPE          X
    FALSE             X
    HASHSIZE          X
    IFDFTYPE          X
    IFELTYPE          X
    INCLTYPE          X
    INCRTYPE          X
    INDXTYPE          X
    LENGTYPE          X
    LPAREN            X
    LQUOTE            X
    M4WRTYPE          X
    MACRTYPE          X
    MAXINP            X
    MAXOUT            X
    MAXSTR            X
    MAXTOK            X
    MKTMTYPE          X
    PARLEV            X
    PASTTYPE          X
    POPDTYPE          X
    PREVEP            X
    PREVFP            X
    PREVSP            X
    PUSDTYPE          X
    RPAREN            X
    RQUOTE            X
    SCOMMT            X
    SHIFTYPE          X
    SINCTYPE          X
    SPASTYPE          X
    STACKMAX          X
    STATIC            X
    STRSPMAX          X
    SUBSTYPE          X
    SYSCTYPE          X
    SYSVTYPE          X
    TOP               X
    TRNLTYPE          X
    TRUE              X
    UNDFTYPE          X
    UNDVTYPE          X
    cycle             X
    gpbc              X
    nil               X
    pushf             X
    pushs             X
    system            X

##### struct's

    keyblk            X
    ndblock           X

##### typedef's

    ndptr             X

       1: /*
       2:  * Copyright (c) 1989, 1993
       3:  *	The Regents of the University of California.  All rights reserved.
       4:  *
       5:  * This code is derived from software contributed to Berkeley by
       6:  * Ozan Yigit at York University.
       7:  *
       8:  * Redistribution and use in source and binary forms, with or without
       9:  * modification, are permitted provided that the following conditions
      10:  * are met:
      11:  * 1. Redistributions of source code must retain the above copyright
      12:  *    notice, this list of conditions and the following disclaimer.
      13:  * 2. Redistributions in binary form must reproduce the above copyright
      14:  *    notice, this list of conditions and the following disclaimer in the
      15:  *    documentation and/or other materials provided with the distribution.
      16:  * 3. All advertising materials mentioning features or use of this software
      17:  *    must display the following acknowledgement:
      18:  *	This product includes software developed by the University of
      19:  *	California, Berkeley and its contributors.
      20:  * 4. Neither the name of the University nor the names of its contributors
      21:  *    may be used to endorse or promote products derived from this software
      22:  *    without specific prior written permission.
      23:  *
      24:  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
      25:  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      26:  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      27:  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
      28:  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
      29:  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
      30:  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
      31:  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
      32:  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
      33:  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
      34:  * SUCH DAMAGE.
      35:  *
      36:  *	@(#)mdef.h	8.1 (Berkeley) 6/6/93
      37:  */
      38:
      39: #define MACRTYPE        1
      40: #define DEFITYPE        2
      41: #define EXPRTYPE        3
      42: #define SUBSTYPE        4
      43: #define IFELTYPE        5
      44: #define LENGTYPE        6
      45: #define CHNQTYPE        7
      46: #define SYSCTYPE        8
      47: #define UNDFTYPE        9
      48: #define INCLTYPE        10
      49: #define SINCTYPE        11
      50: #define PASTTYPE        12
      51: #define SPASTYPE        13
      52: #define INCRTYPE        14
      53: #define IFDFTYPE        15
      54: #define PUSDTYPE        16
      55: #define POPDTYPE        17
      56: #define SHIFTYPE        18
      57: #define DECRTYPE        19
      58: #define DIVRTYPE        20
      59: #define UNDVTYPE        21
      60: #define DIVNTYPE        22
      61: #define MKTMTYPE        23
      62: #define ERRPTYPE        24
      63: #define M4WRTYPE        25
      64: #define TRNLTYPE        26
      65: #define DNLNTYPE        27
      66: #define DUMPTYPE        28
      67: #define CHNCTYPE        29
      68: #define INDXTYPE        30
      69: #define SYSVTYPE        31
      70: #define EXITTYPE        32
      71: #define DEFNTYPE        33
      72:
      73: #define STATIC          128
      74:
      75: /*
      76:  * m4 special characters
      77:  */
      78:
      79: #define ARGFLAG         '$'
      80: #define LPAREN          '('
      81: #define RPAREN          ')'
      82: #define LQUOTE          '`'
      83: #define RQUOTE          '\''
      84: #define COMMA           ','
      85: #define SCOMMT          '#'
      86: #define ECOMMT          '\n'
      87:
      88: #ifdef msdos
      89: #define system(str) (-1)
      90: #endif
      91:
      92: /*
      93:  * other important constants
      94:  */
      95:
      96: #define EOS             (char) 0
      97: #define MAXINP          10              /* maximum include files   */
      98: #define MAXOUT          10              /* maximum # of diversions */
      99: #define MAXSTR          512             /* maximum size of string  */
     100: #define BUFSIZE         4096            /* size of pushback buffer */
     101: #define STACKMAX        1024            /* size of call stack      */
     102: #define STRSPMAX        4096            /* size of string space    */
     103: #define MAXTOK          MAXSTR          /* maximum chars in a tokn */
     104: #define HASHSIZE        199             /* maximum size of hashtab */
     105:
     106: #define ALL             1
     107: #define TOP             0
     108:
     109: #define TRUE            1
     110: #define FALSE           0
     111: #define cycle           for(;;)
     112:
     113: /*
     114:  * m4 data structures
     115:  */
     116:
     117: typedef struct ndblock *ndptr;
     118:
     119: struct ndblock {                /* hastable structure         */
     120:         char    *name;          /* entry name..               */
     121:         char    *defn;          /* definition..               */
     122:         int     type;           /* type of the entry..        */
     123:         ndptr   nxtptr;         /* link to next entry..       */
     124: };
     125:
     126: #define nil     ((ndptr) 0)
     127:
     128: struct keyblk {
     129:         char    *knam;          /* keyword name */
     130:         int     ktyp;           /* keyword type */
     131: };
     132:
     133: typedef union {         /* stack structure */
     134:     int sfra;       /* frame entry  */
     135:     char    *sstr;      /* string entry */
     136: } stae;
     137:
     138: /*
     139:  * macros for readibility and/or speed
     140:  *
     141:  *      gpbc()  - get a possibly pushed-back character
     142:  *      pushf() - push a call frame entry onto stack
     143:  *      pushs() - push a string pointer onto stack
     144:  */
     145: #define gpbc()   (bp > bufbase) ? *--bp : getc(infile[ilevel])
     146: #define pushf(x) if (sp < STACKMAX) mstack[++sp].sfra = (x)
     147: #define pushs(x) if (sp < STACKMAX) mstack[++sp].sstr = (x)
     148:
     149: /*
     150:  *	    .				   .
     151:  *	|   .	|  <-- sp		|  .  |
     152:  *	+-------+			+-----+
     153:  *	| arg 3 ----------------------->| str |
     154:  *	+-------+			|  .  |
     155:  *	| arg 2 ---PREVEP-----+ 	   .
     156:  *	+-------+	      |
     157:  *	    .		      |		|     |
     158:  *	+-------+	      | 	+-----+
     159:  *	| plev	|  PARLEV     +-------->| str |
     160:  *	+-------+			|  .  |
     161:  *	| type	|  CALTYP		   .
     162:  *	+-------+
     163:  *	| prcf	---PREVFP--+
     164:  *	+-------+  	   |
     165:  *	|   .	|  PREVSP  |
     166:  *	    .	   	   |
     167:  *	+-------+	   |
     168:  *	|	<----------+
     169:  *	+-------+
     170:  *
     171:  */
     172: #define PARLEV  (mstack[fp].sfra)
     173: #define CALTYP  (mstack[fp-1].sfra)
     174: #define PREVEP  (mstack[fp+3].sstr)
     175: #define PREVSP  (fp-3)
     176: #define PREVFP  (mstack[fp-2].sfra)

#### Defined struct's

keyblk defined in line 128; used 2 times

- in /usr/src/usr.bin/m4/main.c line 88(2)

ndblock defined in line 119; used 5 times

- in line 117
- in /usr/src/usr.bin/m4/look.c line 91(2)
- in /usr/src/usr.bin/m4/main.c line 415(2)

#### Defined typedef's

ndptr defined in line 117; used 20 times

- in line 123-126(2)
- in /usr/src/usr.bin/m4/eval.c line 439, 464, 485, 510
- in /usr/src/usr.bin/m4/look.c line 67-71(2), 83-91(3), 100, 119
- in /usr/src/usr.bin/m4/main.c line 62, 234, 244, 376, 383, 411-415(2)

#### Defined macros

ALL defined in line 106; used 1 times

- in /usr/src/usr.bin/m4/eval.c line 271

ARGFLAG defined in line 79; used 1 times

- in /usr/src/usr.bin/m4/eval.c line 390

BUFSIZE defined in line 100; used 2 times

- in /usr/src/usr.bin/m4/main.c line 63-67(2)

CALTYP defined in line 173; used 2 times

- in /usr/src/usr.bin/m4/main.c line 342-345(2)

CHNCTYPE defined in line 67; used 1 times

- in /usr/src/usr.bin/m4/main.c line 104

CHNQTYPE defined in line 45; used 1 times

- in /usr/src/usr.bin/m4/main.c line 103

COMMA defined in line 84; never used
DECRTYPE defined in line 57; used 1 times

- in /usr/src/usr.bin/m4/main.c line 101

DEFITYPE defined in line 40; used 1 times

- in /usr/src/usr.bin/m4/main.c line 91

DEFNTYPE defined in line 71; used 1 times

- in /usr/src/usr.bin/m4/main.c line 92

DIVNTYPE defined in line 60; used 1 times

- in /usr/src/usr.bin/m4/main.c line 117

DIVRTYPE defined in line 58; used 1 times

- in /usr/src/usr.bin/m4/main.c line 93

DNLNTYPE defined in line 65; used 1 times

- in /usr/src/usr.bin/m4/main.c line 102

DUMPTYPE defined in line 66; used 1 times

- in /usr/src/usr.bin/m4/main.c line 112

ECOMMT defined in line 86; used 3 times

- in /usr/src/usr.bin/m4/eval.c line 629-633(2)
- in /usr/src/usr.bin/m4/main.c line 86

EOS defined in line 96; used 4 times

- in /usr/src/usr.bin/m4/main.c line 168, 337, 355, 392

ERRPTYPE defined in line 62; used 1 times

- in /usr/src/usr.bin/m4/main.c line 119

EXITTYPE defined in line 70; used 1 times

- in /usr/src/usr.bin/m4/main.c line 121

EXPRTYPE defined in line 41; used 2 times

- in /usr/src/usr.bin/m4/main.c line 94-95(2)

FALSE defined in line 110; never used
HASHSIZE defined in line 104; used 4 times

- in /usr/src/usr.bin/m4/eval.c line 519
- in /usr/src/usr.bin/m4/look.c line 61
- in /usr/src/usr.bin/m4/main.c line 62, 394

IFDFTYPE defined in line 53; used 1 times

- in /usr/src/usr.bin/m4/main.c line 98

IFELTYPE defined in line 43; used 1 times

- in /usr/src/usr.bin/m4/main.c line 97

INCLTYPE defined in line 48; used 1 times

- in /usr/src/usr.bin/m4/main.c line 89

INCRTYPE defined in line 52; used 1 times

- in /usr/src/usr.bin/m4/main.c line 100

INDXTYPE defined in line 68; used 1 times

- in /usr/src/usr.bin/m4/main.c line 105

LENGTYPE defined in line 44; used 1 times

- in /usr/src/usr.bin/m4/main.c line 99

LPAREN defined in line 80; used 2 times

- in /usr/src/usr.bin/m4/main.c line 274-276(2)

LQUOTE defined in line 82; used 2 times

- in /usr/src/usr.bin/m4/eval.c line 608
- in /usr/src/usr.bin/m4/main.c line 83

M4WRTYPE defined in line 63; used 1 times

- in /usr/src/usr.bin/m4/main.c line 120

MACRTYPE defined in line 39; used 5 times

- in /usr/src/usr.bin/m4/eval.c line 453, 496
- in /usr/src/usr.bin/m4/main.c line 126-129(2), 342

MAXINP defined in line 97; used 3 times

- in /usr/src/usr.bin/m4/eval.c line 555
- in /usr/src/usr.bin/m4/main.c line 65, 74

MAXOUT defined in line 98; used 5 times

- in /usr/src/usr.bin/m4/eval.c line 644, 670, 676
- in /usr/src/usr.bin/m4/main.c line 75, 217

MAXSTR defined in line 99; used 1 times

- in line 103

MAXTOK defined in line 103; used 4 times

- in /usr/src/usr.bin/m4/eval.c line 301, 693
- in /usr/src/usr.bin/m4/main.c line 241, 382

MKTMTYPE defined in line 61; used 1 times

- in /usr/src/usr.bin/m4/main.c line 118

PARLEV defined in line 172; used 4 times

- in /usr/src/usr.bin/m4/main.c line 325-334(3), 354

PASTTYPE defined in line 50; used 1 times

- in /usr/src/usr.bin/m4/main.c line 107

POPDTYPE defined in line 55; used 1 times

- in /usr/src/usr.bin/m4/main.c line 110

PREVEP defined in line 174; used 1 times

- in /usr/src/usr.bin/m4/main.c line 347

PREVFP defined in line 176; used 1 times

- in /usr/src/usr.bin/m4/main.c line 349

PREVSP defined in line 175; used 1 times

- in /usr/src/usr.bin/m4/main.c line 348

PUSDTYPE defined in line 54; used 1 times

- in /usr/src/usr.bin/m4/main.c line 111

RPAREN defined in line 81; used 1 times

- in /usr/src/usr.bin/m4/main.c line 275

RQUOTE defined in line 83; used 2 times

- in /usr/src/usr.bin/m4/eval.c line 609
- in /usr/src/usr.bin/m4/main.c line 84

SCOMMT defined in line 85; used 2 times

- in /usr/src/usr.bin/m4/eval.c line 632
- in /usr/src/usr.bin/m4/main.c line 85

SHIFTYPE defined in line 56; used 1 times

- in /usr/src/usr.bin/m4/main.c line 113

SINCTYPE defined in line 49; used 1 times

- in /usr/src/usr.bin/m4/main.c line 90

SPASTYPE defined in line 51; used 1 times

- in /usr/src/usr.bin/m4/main.c line 108

STACKMAX defined in line 101; used 4 times

- in line 146-147(2)
- in /usr/src/usr.bin/m4/main.c line 68, 339

STATIC defined in line 73; used 3 times

- in /usr/src/usr.bin/m4/eval.c line 97
- in /usr/src/usr.bin/m4/look.c line 102
- in /usr/src/usr.bin/m4/main.c line 420

STRSPMAX defined in line 102; used 2 times

- in /usr/src/usr.bin/m4/main.c line 69-71(2)

SUBSTYPE defined in line 42; used 1 times

- in /usr/src/usr.bin/m4/main.c line 96

SYSCTYPE defined in line 46; used 1 times

- in /usr/src/usr.bin/m4/main.c line 122

SYSVTYPE defined in line 69; used 1 times

- in /usr/src/usr.bin/m4/main.c line 123

TOP defined in line 107; used 2 times

- in /usr/src/usr.bin/m4/eval.c line 282
- in /usr/src/usr.bin/m4/main.c line 172

TRNLTYPE defined in line 64; used 1 times

- in /usr/src/usr.bin/m4/main.c line 114

TRUE defined in line 109; never used
UNDFTYPE defined in line 47; used 1 times

- in /usr/src/usr.bin/m4/main.c line 115

UNDVTYPE defined in line 59; used 1 times

- in /usr/src/usr.bin/m4/main.c line 116

cycle defined in line 111; used 2 times

- in /usr/src/usr.bin/m4/eval.c line 534
- in /usr/src/usr.bin/m4/main.c line 247

gpbc defined in line 145; used 8 times

- in /usr/src/usr.bin/m4/eval.c line 338
- in /usr/src/usr.bin/m4/main.c line 248, 273, 297, 316, 327, 356, 386

nil defined in line 126; used 11 times

- in /usr/src/usr.bin/m4/eval.c line 134, 445, 466, 514, 520
- in /usr/src/usr.bin/m4/look.c line 73, 123-127(3)
- in /usr/src/usr.bin/m4/main.c line 250, 394

pushf defined in line 146; used 3 times

- in /usr/src/usr.bin/m4/main.c line 262-264(3)

pushs defined in line 147; used 4 times

- in /usr/src/usr.bin/m4/main.c line 269-271(3), 359

system defined in line 89; used 1 times

- in /usr/src/usr.bin/m4/eval.c line 173

#### Usage of this include

mdef.h used 4 times

- in /usr/src/usr.bin/m4/eval.c line 51
- in /usr/src/usr.bin/m4/look.c line 50
- in /usr/src/usr.bin/m4/main.c line 57
- in /usr/src/usr.bin/m4/misc.c line 45

Last modified: 1993-06-07 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1345 |