# 2.11BSD#431 - /usr/ingres/source/decomp/call_dbu70.c

##### Functions

    call_dbu          X
    proc_error        X
    userdestroy       X

##### Variables

    Attdes            X
    D_dbu70           X
    Desxx             X
    Error_flag        X
    Inddes            X
    Reldes            X
    Synconly          X

       1: # include   "../ingres.h"
       2: # include   "../aux.h"
       3: # include   "../pipes.h"
       4: # include   "../tree.h"
       5: # include   "../symbol.h"
       6: # include   "../access.h"
       7: # include   "decomp.h"
       8:
       9: int Synconly, Error_flag;
      10:
      11: char    D_dbu70 = 1;    /* used for loading only. causes call_dbu70 to be loaded
      12: 			** instead of call_dbu.
      13: 			*/
      14:
      15: call_dbu(code, errflag)
      16: int code;
      17: int errflag;
      18:
      19: /*
      20: **	Call the appropriate dbu with the arguments
      21: **	given in the globals Pc and Pv. Code is a
      22: **	number identifing which dbu to call. Errflag
      23: **	indicates whether an error return from the dbu
      24: **	is possibly expected.
      25: **
      26: **	If errflag < 0 then call_dbu will not wait for sync.
      27: **	If errflag = 0 then call_dbu will syserr on an error
      28: **	If errflag > 0 then call_dbu will return error value
      29: */
      30:
      31: {
      32:     struct pipfrmt  pipe;
      33:     register int    i, j;
      34:     register int    (*func)();
      35:     extern char *Pv[];
      36:     extern int  Pc;
      37:     extern int  create(), destroy(), resetrel();
      38:
      39: #	ifdef xDTR1
      40:     if (tTf(3, 0))
      41:         printf("Calling DBU %d\n", code);
      42:     if (tTf(3, 1))
      43:         prargs(Pc, Pv);
      44: #	endif
      45:
      46:     switch (code)
      47:     {
      48:
      49:       case mdCREATE:
      50:         func = &create;
      51:         break;
      52:
      53:       case mdDESTROY:
      54:         func = &destroy;
      55:         break;
      56:
      57:       case mdRESETREL:
      58:         func = &resetrel;
      59:         break;
      60:
      61:       default:
      62:         func = NULL;
      63:     }
      64:
      65:     if (func != NULL)
      66:     {
      67:         Pv[Pc] = (char *) -1;
      68:         Error_flag = (*func)(Pc, Pv);
      69:         closecatalog(FALSE);
      70:     }
      71:     else
      72:     {
      73:         wrpipe(P_PRIME, &pipe, EXEC_DBU, 0, code);
      74:         i = 0;
      75:         j = Pc;
      76:         while (j--)
      77:             wrpipe(P_NORM, &pipe, W_dbu, Pv[i++], 0);
      78:         wrpipe(P_END, &pipe, W_dbu);
      79:
      80:         Error_flag = 0;
      81:         if (errflag >= 0)
      82:         {
      83:             Synconly++;
      84:             rdpipe(P_PRIME, &pipe);
      85:             rdpipe(P_SYNC, &pipe, R_dbu);
      86:             Synconly = 0;
      87:         }
      88:     }
      89:
      90:
      91:     if (Error_flag && !errflag)
      92:     {
      93:         prargs(Pc, Pv);
      94:         syserr("call_dbu:%d,ret %d", code, Error_flag);
      95:     }
      96:     return (Error_flag);
      97:
      98: }
      99:
     100:
     101: proc_error(s1, rpipnum)
     102: struct pipfrmt  *s1;
     103: int     rpipnum;
     104:
     105: /*
     106: **	Proc_error is called from rdpipe if an error
     107: **	block is encountered. If Synconly is true then
     108: **	the dbu request was initiated by decomp.
     109: **	Otherwise the error block(s) are passed on up.
     110: */
     111:
     112: {
     113:     extern int      Synconly, Error_flag;
     114:     register struct pipfrmt *s;
     115:     register int        fd;
     116:     struct pipfrmt      t;
     117:
     118:     fd = rpipnum;
     119:     s = s1;
     120:
     121:     if (Synconly)
     122:     {
     123:         Synconly = 0;
     124:         Error_flag = s->err_id;
     125:         rdpipe(P_SYNC, s, fd);      /*  throw away the error message  */
     126:     }
     127:     else
     128:     {
     129:         wrpipe(P_PRIME, &t, s->exec_id, 0, s->func_id);
     130:         t.err_id = s->err_id;
     131:
     132:         copypipes(s, fd, &t, W_up);
     133:         rdpipe(P_PRIME, s);
     134:     }
     135: }
     136:
     137: /*
     138: **	SYSTEM RELATION DESCRIPTOR CACHE DEFINITION
     139: **
     140: **	This is defined here to prevent the ovqp definition (if any)
     141: **	from overriding these definitions. This file is a direct
     142: **	steal from ".../source/utility/catalog_desc.c"
     143: */
     144:
     145: struct descriptor   Reldes;
     146: struct descriptor   Attdes;
     147: struct descriptor   Inddes;
     148:
     149:
     150: struct desxx    Desxx[] =
     151: {
     152:     "relation", &Reldes,    &Admin.adreld,
     153:     "attribute",    &Attdes,    &Admin.adattd,
     154:     "indexes",  &Inddes,    0,
     155:     0
     156: };
     157:
     158:
     159: /*
     160: **	override definition of userdestroy() for destroy() function.
     161: **	Since destroy is only used by decomp to destroy _SYS relations,
     162: **	userdestroy is not needed.
     163: */
     164: userdestroy()
     165: {
     166:     return;
     167: }

#### Defined functions

call_dbu defined in line 15; used 9 times

- in /usr/ingres/source/decomp/ageval.c line 165
- in /usr/ingres/source/decomp/byeval.c line 97, 246
- in /usr/ingres/source/decomp/exec_sq.c line 209
- in /usr/ingres/source/decomp/qryproc.c line 104
- in /usr/ingres/source/decomp/reformat.c line 342, 432
- in /usr/ingres/source/decomp/usubr.c line 189, 217

proc_error defined in line 101; never used
userdestroy defined in line 164; never used

#### Defined variables

Attdes defined in line 146; used 1 times

- in line 153

D_dbu70 defined in line 11; never used
Desxx defined in line 150; never used
Error_flag defined in line 9; used 7 times

- in line 68, 80, 91-96(3), 113, 124

Inddes defined in line 147; used 1 times

- in line 154

Reldes defined in line 145; used 1 times

- in line 152

Synconly defined in line 9; used 5 times

- in line 83-86(2), 113, 121-123(2)

Last modified: 1995-04-14 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1458 |