1: # include <ingres.h> 2: # include <symbol.h> 3: # include <tree.h> 4: # include <pv.h> 5: # include "parser.h" 6: # include <sccs.h> 7: 8: SCCSID(@(#)call_tree.c 8.1 12/31/84) 9: 10: /* 11: ** CALL_TREE -- call the appropriate module below 12: ** 13: ** Call_tree prepends a TREE node to the leftmost node on the tree, 14: ** adds the tree to the PARM, and does a CM call(). 15: ** 16: ** Parameters: 17: ** qmode -- qmode of query 18: ** dest -- module to call 19: ** err_fcn() -- function to call on error 20: ** 21: ** Returns: 22: ** nothing 23: ** 24: ** Trace Flags: 25: ** call_tree ~~ 44.0, 44.4 26: */ 27: 28: call_tree(qmode, dest, err_fcn) 29: register int qmode; 30: int dest; 31: int (*err_fcn)(); 32: { 33: extern int Resrng; 34: extern QTREE *Lastree; 35: 36: # ifdef xPTR2 37: tTfp(44, 0, "call_tree: qm=%d, dest=%d\n", qmode, dest); 38: # endif 39: 40: Qt.qt_qmode = qmode; 41: 42: # ifdef xPTR2 43: 44: if (tTf(44, 4)) 45: if (Resrng >= 0) 46: printf("resvarno:%d\n", Resrng); 47: # endif 48: 49: Qt.qt_resvar = Resrng; 50: 51: /* the following attaches the TREE node to the far left of the tree */ 52: 53: tlprepend(tree(NULL, NULL, TREE, 0), Lastree); 54: 55: setp(PV_QTREE, Lastree); 56: 57: call(dest, err_fcn); 58: 59: # ifdef xPTR2 60: tTfp(44, 5, "Call_tree: call returned\n"); 61: # endif 62: }