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