Annotation of 42BSD/ingres/source/ovqp/prsym.c, revision 1.1.1.1

1.1       root        1: # include      <ingres.h>
                      2: # include      <aux.h>
                      3: # include      <symbol.h>
                      4: # include      <tree.h>
                      5: # include      "../decomp/globs.h"
                      6: # include      <sccs.h>
                      7: 
                      8: SCCSID(@(#)prsym.c     7.2     3/6/81)
                      9: 
                     10: prsym(s)
                     11: register SYMBOL        *s;
                     12: {
                     13:        register union symvalue *p;
                     14:        register int            type;
                     15:        register int            len;
                     16:        union symvalue          temp;
                     17: 
                     18:        type = s->type;
                     19:        len = s->len & 0377;
                     20:        p = &s->value;
                     21:        if (type == S_VAR)
                     22:        {
                     23:                /* actually, S_VAR's are rendered the same as VAR's
                     24:                 * by call_ovqp70.c's ovqpnod()
                     25:                 */
                     26:                printf("s_");   /* first part of "s_var" message */
                     27:                type = VAR;     /* execute var portion */
                     28:        }
                     29:        if (type == VAR)
                     30:        {
                     31:                printf("var:att#=%d:", p->sym_var.attno);
                     32:                type = p->sym_var.varfrmt;
                     33:                len = p->sym_var.varfrml;
                     34:                if (type != CHAR)
                     35:                {
                     36:                        /* move anytype to symvalue boundary */
                     37:                        bmove((char *)p->sym_var.valptr, (char *)&temp, sizeof *p);
                     38:                        p = &temp;
                     39:                }
                     40:        }
                     41:        xputchar(type);
                     42:        printf("%d:value='", len);
                     43:        switch (type)
                     44:        {
                     45:          case AND:
                     46:          case AOP:
                     47:          case BOP:
                     48:          case OR:
                     49:          case RESDOM:
                     50:          case UOP:
                     51:          case COP:
                     52:                printf("%d (operator)", p->sym_op.opno);
                     53:                break;
                     54: 
                     55:          case INT:
                     56:                switch (len)
                     57:                {
                     58:                  case 1:
                     59:                        printf("%d", p->sym_data.i1type);
                     60:                        break;
                     61: 
                     62:                  case 2:
                     63:                        printf("%d", p->sym_data.i2type);
                     64:                        break;
                     65: 
                     66:                  case 4:
                     67:                        printf("%ld", p->sym_data.i4type);
                     68:                }
                     69:                break;
                     70: 
                     71:          case FLOAT:
                     72:                printf("%10.3f", p->sym_data.f4type);
                     73:                break;
                     74: 
                     75:          case RESULTID:
                     76:          case SOURCEID:
                     77:          case CHAR:
                     78:                printf("%x=", p->sym_data.c0type);
                     79:                prstr(p->sym_data.c0type, len);
                     80:                break;
                     81: 
                     82:          case AGHEAD:
                     83:          case BYHEAD:
                     84:          case QLEND:
                     85:          case ROOT:
                     86:          case TREE:
                     87:                printf(" (delim)");
                     88:                break;
                     89: 
                     90:          case CHANGESTRAT:
                     91:          case REOPENRES:
                     92:          case EXIT:
                     93:          case QMODE:
                     94:          case RETVAL:
                     95:          case USERQRY:
                     96:                if (len)
                     97:                        printf("%d", p->sym_op.opno);
                     98:                printf(" (status)");
                     99:                break;
                    100: 
                    101:          default:
                    102:                printf("\nError in prsym: bad type= %d\n", type);
                    103:        }
                    104:        printf("'\n");
                    105: }
                    106: 
                    107: 
                    108: prstack(s)
                    109: register SYMBOL        *s;
                    110: {
                    111:        if (s->type == CHAR)
                    112:        {
                    113:                printf("c%d:value='%x=", s->len,s->value.sym_data.cptype);
                    114:                prstr(s->value.sym_data.cptype, s->len & 0377);
                    115:                printf("'\n");
                    116:        }
                    117:        else
                    118:                prsym(s);
                    119: }
                    120: 
                    121: 
                    122: 
                    123: prstr(p, l)
                    124: register char  *p;
                    125: register int   l;
                    126: {
                    127:        while (--l >= 0)
                    128:                putchar(*p++);
                    129: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.