1: # include   "../../ingres.h"
   2: # include   "../../symbol.h"
   3: # include   "../../pipes.h"
   4: # include   "IIglobals.h"
   5: 
   6: /*
   7: **	IIgettup is called to retrieve one instance
   8: **	of the target list into the c-variables.
   9: **
  10: **	Integers and Floating point numbers can be converted
  11: **	to other numbers.
  12: **
  13: **	Characters fields must match other character fields.
  14: */
  15: 
  16: IIgettup(file_name, line_no)
  17: char    *file_name;
  18: int line_no;
  19: {
  20:     register int        length, domain;
  21:     register struct retsym  *ret;
  22:     struct retsym       sym;
  23:     char            temp[256], *IIitos(), *s;
  24: 
  25: 
  26: 
  27:     if (IIproc_name = file_name)
  28:         IIline_no = line_no;
  29: 
  30:     if (IIerrflag)
  31:         return (0); /* error. no data will be coming */
  32: 
  33:     ret = IIretsym;
  34:     domain = 0;
  35: 
  36:     for (;;)
  37:     {
  38:         if (IIrdpipe(P_NORM, &IIeinpipe, IIr_front, &sym, 2) != 2)
  39:             IIsyserr("IIgettup bad rdpipe 1");
  40:         if (length = sym.len & 0377)
  41:             if (IIrdpipe(P_NORM, &IIeinpipe, IIr_front, temp, length) != length)
  42:                 IIsyserr("IIgettup bad rdpipe-2 %d", length);
  43: #		ifdef xETR1
  44:         if (IIdebug)
  45:         {
  46:             printf("%s ent ", IIproc_name ? IIproc_name : "");
  47:             printf("gettup type %d len %d\n", sym.type, length);
  48:         }
  49: #		endif
  50:         domain++;
  51:         switch (sym.type)
  52:         {
  53: 
  54:           case INT:
  55:           case FLOAT:
  56:             if (ret->type == CHAR)
  57:             {
  58:                 s = IIitos(domain);
  59:                 IIerror(1000, 1, &s);
  60:                 return (0);
  61:             }
  62:             if (IIconvert(temp, ret->addr, sym.type, length, ret->type, ret->len & 0377) < 0)
  63:             {
  64:                     s = IIitos(domain);
  65:                     IIerror(1001, 1, &s);
  66:             }
  67:             break;
  68: 
  69:           case CHAR:
  70:             if (ret->type != CHAR)
  71:             {
  72:                 s = IIitos(domain);
  73:                 IIerror(1002, 1, &s);
  74:                 return (0);
  75:             }
  76:             IIbmove(temp, ret->addr, length);
  77:             ret->addr[length] = '\0';   /* null terminate string */
  78:             break;
  79: 
  80:           case EOTUP:
  81:             return (1);
  82: 
  83:           case EXIT:
  84:             return (0);
  85:         }
  86:         ret++;
  87:     }
  88: }

Defined functions

IIgettup defined in line 16; never used
Last modified: 1980-12-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2085
Valid CSS Valid XHTML 1.0 Strict