1: # include   "../ingres.h"
   2: # include   "../aux.h"
   3: # include   "../symbol.h"
   4: # include   "../tree.h"
   5: # include   "../pipes.h"
   6: # include   "ovqp.h"
   7: 
   8: prsym(ss)
   9: struct symbol   *ss;
  10: {
  11:     char        *p;
  12:     register    i,j;
  13:     register struct symbol  *s;
  14:     char            temp[4];
  15: 
  16:     s = ss;
  17:     i = s->type;
  18:     j = s->len & 0377;
  19:     p = (char *) s->value;
  20:     if (i == S_VAR)
  21:     {
  22:         i = VAR;    /* execute var portion */
  23:         printf("s_");   /* first part of "s_var" message */
  24:     }
  25:     if (i == VAR)
  26:     {
  27:         /* beware : do S_VAR's have attno's? */
  28:         printf("var:att#=%d:", *p);
  29:         i = ((struct qt_v *)s)->vtype;
  30:         j = ((struct qt_v *)s)->vlen & 0377;
  31:         p = (char *) ((struct qt_v *)s)->vpoint;
  32:         if (i != CHAR)
  33:         {
  34:             /* move INT & FLOAT to word boundary */
  35:             bmove(p, temp, 4);
  36:             p = temp;
  37:         }
  38:     }
  39: 
  40:     printf("%d:%d:value='",i,j);
  41:     switch (i)
  42:     {
  43:       case AND:
  44:       case AOP:
  45:       case BOP:
  46:       case OR:
  47:       case RESDOM:
  48:       case UOP:
  49:         printf("%d (operator)", *p);
  50:         break;
  51: 
  52:       case INT:
  53:         switch(j)
  54:         {
  55:           case 1:
  56:             printf("%d", i1deref(p));
  57:             break;
  58:           case 2:
  59:             printf("%d", i2deref(p));
  60:             break;
  61:           case 4:
  62:             printf("%s", locv(i4deref(p)));
  63:         }
  64:         break;
  65: 
  66:       case FLOAT:
  67:         switch(j)
  68:         {
  69:           case 4:
  70:             printf("%10.3f", f4deref(p));
  71:             break;
  72:           case 8:
  73:             printf("%10.3f", f8deref(p));
  74:         }
  75:         break;
  76: 
  77:       case RESULTID:
  78:       case SOURCEID:
  79:       case CHAR:
  80:         prstr(p, j);
  81:         break;
  82: 
  83:       case AGHEAD:
  84:       case BYHEAD:
  85:       case QLEND:
  86:       case ROOT:
  87:       case TREE:
  88:         printf(" (delim)");
  89:         break;
  90: 
  91:       case CHANGESTRAT:
  92:       case REOPENRES:
  93:       case EXIT:
  94:       case QMODE:
  95:       case RETVAL:
  96:       case USERQRY:
  97:         if (j)
  98:             printf("%d", *p);
  99:         printf(" (status)");
 100:         break;
 101: 
 102:       default:
 103:         printf("\nError in prsym: bad type= %d\n",i);
 104:     }
 105:     printf("'\n");
 106: }
 107: 
 108: 
 109: prstack(ss)
 110: struct symbol   *ss;
 111: {
 112:     register struct symbol  *s;
 113:     register char       *p;
 114: 
 115:     s = ss;
 116: 
 117:     if (s->type == CHAR)
 118:     {
 119:         printf("%d:%d:value='", s->type, s->len);
 120:         prstr(cpderef(s->value), s->len & 0377);
 121:         printf("'\n");
 122:     }
 123:     else
 124:         prsym(s);
 125: }
 126: 
 127: 
 128: prstr(pt, len)
 129: char    *pt;
 130: int len;
 131: {
 132:     register char   *p;
 133:     register int    l;
 134: 
 135:     l = len + 1;
 136:     p = pt;
 137:     while (--l)
 138:         putchar(*p++);
 139: }
Last modified: 1995-03-02
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2960
Valid CSS Valid XHTML 1.0 Strict