# 2.11BSD#431 - /usr/src/new/PORT/B/src/bsmall/b1com.c

##### Functions

    field             X
    mk_fun            X
    mk_how            X
    mk_per            X
    mk_prd            X
    mk_ref            X
    mk_simploc        X
    mk_tbseloc        X
    mk_trimloc        X
    put_in_field      X

       1: /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1984. */
       2: /* $Header: b1com.c,v 1.1 84/06/28 00:49:03 timo Exp $ */
       3:
       4: /************************************************************************/
       5: /* B compounds                                                          */
       6: /* plus Hows Funs and other odd types that don't fit anywhere else      */
       7: /*                                                                      */
       8: /* A compound is modelled as a sequence of len values, its fields.      */
       9: /*                                                                      */
      10: /************************************************************************/
      11:
      12: #include "b.h"
      13: #include "b1obj.h"
      14:
      15: Visible value* field(v, k) value v; intlet k; { /* k in {0..size-1}; no copy */
      16:     return (value *) Field(v, k);
      17: }
      18:
      19: Visible Procedure put_in_field(v, c, i) value v, *c; intlet i; {
      20:     /*Note that no copy of v is made: the caller must do this*/
      21:     *(Ats(*c)+i)= v;
      22: }
      23:
      24: /* Other types */
      25: Visible loc mk_simploc(id, en) basidf id; env en; {
      26:     loc l= grab_sim();
      27:     (*Ats(l))= copy(id); (*(Ats(l)+1))= (value) en;
      28:     return l;
      29: }
      30:
      31: Visible loc mk_trimloc(R, B, C) loc R; intlet B, C; {
      32:     loc l= grab_tri(); trimloc *ll= (trimloc *)Ats(l);
      33:     ll->R= copy(R); ll->B= B; ll->C= C;
      34:     return l;
      35: }
      36:
      37: Visible loc mk_tbseloc(R, K) loc R; value K; {
      38:     loc l= grab_tse(); tbseloc *ll= (tbseloc *)Ats(l);
      39:     ll->R= copy(R); ll->K= copy(K);
      40:     return l;
      41: }
      42:
      43: Visible fun mk_fun(L, H, adic, def, fux, lux, reftab, filed)
      44:  intlet L, H; literal adic, def; txptr fux, lux; value reftab; bool filed; {
      45:     fun f= grab_fun(); funprd *ff= (funprd *)Ats(f);
      46:     ff->L= L; ff->H= H; ff->adic= adic; ff->def= def; ff->fux= fux;
      47:     ff->lux= lux; ff->reftab= reftab; ff->filed= filed;
      48:     return f;
      49: }
      50:
      51: Visible prd mk_prd(adic, def, fux, lux, reftab, filed)
      52:  literal adic, def; txptr fux, lux; value reftab; bool filed; {
      53:     prd p= grab_prd(); funprd *pp= (funprd *)Ats(p);
      54:     pp->adic= adic; pp->def= def; pp->fux= fux;
      55:     pp->lux= lux; pp->reftab= reftab; pp->filed= filed;
      56:     return p;
      57: }
      58:
      59: Visible value mk_how(fux, lux, reftab, filed)
      60:  txptr fux, lux; value reftab; bool filed; {
      61:     value h= grab_how(); how *hh= (how *)Ats(h);
      62:     hh->fux= fux; hh->lux= lux; hh->reftab= reftab; hh->filed= filed;
      63:     return h;
      64: }
      65:
      66: Visible value mk_ref(rp, rlino) txptr rp; intlet rlino; {
      67:     value r= grab_ref();
      68:     ((ref *)Ats(r))->rp= rp;
      69:     ((ref *)Ats(r))->rlino= rlino;
      70:     return r;
      71: }
      72:
      73: Visible value mk_per(v) value v; {
      74:     value p= grab_per();
      75:     *Ats(p)= copy(v);
      76:     return p;
      77: }

#### Defined functions

field defined in line 15; used 15 times

- in /usr/src/new/PORT/B/src/bsmall/b1obj.h line 138
- in /usr/src/new/PORT/B/src/bsmall/b2exp.c line 38, 46, 67
- in /usr/src/new/PORT/B/src/bsmall/b2loc.c line 107(2), 124, 147, 200
- in /usr/src/new/PORT/B/src/bsmall/b2scr.c line 143
- in /usr/src/new/PORT/B/src/bsmall/b2tes.c line 193
- in /usr/src/new/PORT/B/src/bsmall/b2typ.c line 50, 63, 99(2)

mk_fun defined in line 43; used 5 times

- in /usr/src/new/PORT/B/src/bsmall/b1obj.h line 193
- in /usr/src/new/PORT/B/src/bsmall/b2exp.c line 32-33(2)
- in /usr/src/new/PORT/B/src/bsmall/b2fpr.c line 88
- in /usr/src/new/PORT/B/src/bsmall/b2uni.c line 69

mk_how defined in line 59; used 2 times

- in /usr/src/new/PORT/B/src/bsmall/b1obj.h line 195
- in /usr/src/new/PORT/B/src/bsmall/b2uni.c line 68

mk_per defined in line 73; used 4 times

- in /usr/src/new/PORT/B/src/bsmall/b1obj.h line 192
- in /usr/src/new/PORT/B/src/bsmall/b2sou.c line 382, 478, 484

mk_prd defined in line 51; used 3 times

- in /usr/src/new/PORT/B/src/bsmall/b1obj.h line 194
- in /usr/src/new/PORT/B/src/bsmall/b2fpr.c line 102
- in /usr/src/new/PORT/B/src/bsmall/b2uni.c line 70

mk_ref defined in line 66; used 2 times

- in /usr/src/new/PORT/B/src/bsmall/b1obj.h line 196
- in /usr/src/new/PORT/B/src/bsmall/b2uni.c line 522

mk_simploc defined in line 25; used 3 times

- in /usr/src/new/PORT/B/src/bsmall/b1obj.h line 188
- in /usr/src/new/PORT/B/src/bsmall/b2loc.c line 76-78(2)

mk_tbseloc defined in line 37; used 2 times

- in /usr/src/new/PORT/B/src/bsmall/b1obj.h line 190
- in /usr/src/new/PORT/B/src/bsmall/b2loc.c line 71

mk_trimloc defined in line 31; used 3 times

- in /usr/src/new/PORT/B/src/bsmall/b1obj.h line 189
- in /usr/src/new/PORT/B/src/bsmall/b2loc.c line 61-63(2)

put_in_field defined in line 19; used 11 times

- in /usr/src/new/PORT/B/src/bsmall/b2exp.c line 39(2), 54(2), 60(2), 106
- in /usr/src/new/PORT/B/src/bsmall/b2tar.c line 29
- in /usr/src/new/PORT/B/src/bsmall/b2typ.c line 50, 63
- in /usr/src/new/PORT/B/src/bsmall/b2uni.c line 408

Last modified: 1985-08-27 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 592 |