Annotation of 42BSD/ingres/source/libq/IIgettup.c, revision 1.1

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

unix.superglobalmegacorp.com

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