1: # include "../ingres.h" 2: # include "../aux.h" 3: # include "../pipes.h" 4: # include "../symbol.h" 5: # include "../tree.h" 6: # include "parser.h" 7: 8: struct pipfrmt Pipebuf; /* define pipe buffer structure 9: also referenced in rngsend and treepr */ 10: /* 11: ** CALL_TREE -- send a tree to decomp (or qrymod) 12: */ 13: call_tree(qmode1, execid) 14: int qmode1; 15: int execid; 16: { 17: register int qmode; 18: register int retr; 19: 20: qmode = qmode1; 21: # ifdef xPTR2 22: tTfp(26, 0, "call_tree: qm=%d\tex=%d\n", qmode, execid); 23: # endif 24: wrpipe(P_PRIME, &Pipebuf, execid, 0, qmode); 25: writesym(QMODE, 2, &qmode1); 26: if (Resrng) 27: { 28: # ifdef xPTR2 29: tTfp(26, 1, "resvarno:%d\n", Resrng->rentno); 30: # endif 31: writesym(RESULTVAR, 2, &Resrng->rentno); 32: } 33: rngsend(); 34: treepr(Lastree); 35: wrpipe(P_END, &Pipebuf, W_down); 36: 37: /* optomize test for these two conditions */ 38: retr = (qmode == mdRETR || qmode == mdRET_UNI); 39: 40: /* output sync block to EQUEL if necessary */ 41: if (Equel && retr && Resrng == 0) 42: syncup(); 43: syncdn(); 44: if (retr) 45: { 46: if (Resrng) 47: { 48: if (Relspec) 49: { 50: setp(Resrng->relnm); 51: setp(Relspec); 52: call_p(mdMODIFY, EXEC_DBU); 53: } 54: } 55: else if (!Equel) 56: printeh(); 57: } 58: } 59: 60: /* 61: ** WRITESYM -- does the physical write stuff, etc. 62: ** for a normal tree symbol. (i.e. other 63: ** than a SOURCEID--range table entry 64: */ 65: writesym(typ, len, value) 66: int typ; 67: int len; 68: char *value; 69: { 70: struct symbol sym; 71: 72: sym.type = typ & I1MASK; 73: sym.len = len & I1MASK; 74: wrpipe(P_NORM, &Pipebuf, W_down, &sym, 2); 75: if (value != NULL) 76: wrpipe(P_NORM, &Pipebuf, W_down, value, len & I1MASK); 77: } 78: 79: /* 80: ** RNGWRITE -- does the physical write operation, etc. 81: ** for SOURCEID symbol (i.e. a range table entry). 82: */ 83: rngwrite(r) 84: struct rngtab *r; 85: { 86: register struct rngtab *rptr; 87: struct srcid s; 88: register struct srcid *sp; 89: 90: rptr = r; 91: sp = &s; 92: sp->type = SOURCEID; 93: sp->len = sizeof(*sp) - 2; 94: sp->srcvar = rptr->rentno; 95: pmove(rptr->relnm, sp->srcname, MAXNAME, ' '); 96: bmove(rptr->relnowner, sp->srcown, 2); 97: sp->srcstat = rptr->rstat; 98: wrpipe(P_NORM, &Pipebuf, W_down, sp, sizeof(*sp)); 99: # ifdef xPTR3 100: if (tTf(26, 2)) 101: printf("srcvar:%d\tsrcname:%.12s\tsrcown:%.2s\tsrcstat:%o\n", sp->srcvar, sp->srcname, sp->srcown, sp->srcstat); 102: # endif 103: }