예제 #1
0
i4
IItupget()
{
    II_THR_CB		*thr_cb = IILQthThread();
    II_LBQ_CB		*IIlbqcb = thr_cb->ii_th_session;
    i2			nuldata;	/* For use by transfunc */
    i2			*nulptr;
    i4			data[DB_GW4_MAXSTRING/sizeof(i4) +1]; 
    i4			cols;		/* Counter for result columns */
    II_RET_DESC		*ret;		/* RETRIEVE descriptor */
    DB_EMBEDDED_DATA	*ped;		/* Pointer into host vars */

    /* First test entry into RETRIEVE loop */
    if (IInextget() == 0)
	return 0;

    ret = &IIlbqcb->ii_lq_retdesc;

    /* 
    ** Walk through each embedded data value one at a time, picking off the 
    ** calls to make to IIgetdomio and (if necessary) transforming result data 
    ** and null indicator information into host variables. 
    */
    for (ped = ret->ii_rd_param, cols = 0;
	 cols < ret->ii_rd_patts; ped++, cols++)
    {
	if (ret->ii_rd_ptrans)
	{
	    if ((nulptr = ped->ed_null) != (i2 *)0)  /* Need an indicator */
		nulptr = &nuldata;		     /* May be translated */

	    if (IIgetdomio(nulptr, 1, ped->ed_type, ped->ed_length, 
			(char *)data) == 0)
		return 0;

	    /* May need to translate indicator and/or data */
	    if (nulptr)			/* Have an indicator */
		(*ret->ii_rd_ptrans)((i4)DB_INT_TYPE, (i4)sizeof(i2), nulptr,		 
				     ped->ed_null);
	    if (nulptr == (i2 *)0 || *nulptr != DB_EMB_NULL)
		(*ret->ii_rd_ptrans)((i4)(ped->ed_type),(i4)(ped->ed_length),		 
				     data, ped->ed_data);				 
	}
	else
	{
	    if (IIgetdomio(ped->ed_null, 1, ped->ed_type, ped->ed_length, 
		ped->ed_data) == 0)
		return 0;
	}
    }
    return 1;
}
예제 #2
0
i4
IIpgetdomio(i2 *indaddr,i4 isvar,i4 hosttype,i4 hostlen,
            II_LQTYPE_GPTR addr)
{
    return IIgetdomio(indaddr,isvar,hosttype,hostlen,addr);
}