void op_zmess(int4 errnum, ...) { va_list var; int4 status, cnt, faocnt; unsigned short m_len; unsigned char faostat[4]; unsigned char msgbuff[MAX_MSG_SIZE + 1]; unsigned char buff[FAO_BUFFER_SPACE]; int4 fao[MAX_FAO_PARMS + 1]; $DESCRIPTOR(d_sp, msgbuff); error_def(ERR_TPRETRY); VAR_START(var, errnum); va_count(cnt); cnt--; status = sys$getmsg(errnum, &m_len, &d_sp, 0, &faostat[0]); if ((status & 1) && m_len) { buff[m_len] = 0; memset(&fao[0], 0, SIZEOF(fao)); faocnt = (cnt ? faostat[1] : cnt); faocnt = (faocnt > MAX_FAO_PARMS ? MAX_FAO_PARMS : faocnt); if (faocnt) faocnt = mval2fao(msgbuff, var, &fao[0], cnt, faocnt, buff, buff + SIZEOF(buff)); va_end(var); if (faocnt != -1) { /* Currently there are a max of 20 fao parms (MAX_FAO_PARMS) allowed, hence passing upto fao_list[19]. * An assert is added to ensure this code is changed whenever the macro MAX_FAO_PARMS is changed. * The # of arguments passed below should change accordingly. */ assert(MAX_FAO_PARMS == 20); if (ERR_TPRETRY == errnum) { /* A TP restart is being signalled. Set t_fail_hist just like a TRESTART command would */ op_trestart_set_cdb_code(); } rts_error(VARLSTCNT(MAX_FAO_PARMS + 2) errnum, faocnt, fao[0], fao[1], fao[2], fao[3], fao[4], fao[5], fao[6], fao[7], fao[8], fao[9], fao[10], fao[11], fao[12], fao[13], fao[14], fao[15], fao[16], fao[17], fao[18], fao[19]); } return; } else { va_end(var); rts_error(VARLSTCNT(1) status); } }
void op_zmess(int4 errnum, ...) { va_list var; int4 status, cnt, faocnt; unsigned short m_len; unsigned char faostat[4]; unsigned char msgbuff[MAX_MSG_SIZE + 1]; unsigned char buff[FAO_BUFFER_SPACE]; int4 fao[MAX_FAO_PARMS]; $DESCRIPTOR(d_sp, msgbuff); VAR_START(var, errnum); va_count(cnt); cnt--; assert(34 == MAX_FAO_PARMS); /* Defined in fao_parm.h. */ status = sys$getmsg(errnum, &m_len, &d_sp, 0, &faostat[0]); if ((status & 1) && m_len) { buff[m_len] = 0; memset(&fao[0], 0, SIZEOF(fao)); faocnt = (cnt ? faostat[1] : cnt); faocnt = (faocnt > MAX_FAO_PARMS ? MAX_FAO_PARMS : faocnt); if (faocnt) faocnt = mval2fao(msgbuff, var, &fao[0], cnt, faocnt, buff, buff + SIZEOF(buff)); va_end(var); if (faocnt != -1) { if (ERR_TPRETRY == errnum) { /* A TP restart is being signalled. Set t_fail_hist just like a TRESTART command would */ op_trestart_set_cdb_code(); } rts_error_csa(CSA_ARG(NULL) VARLSTCNT(MAX_FAO_PARMS + 2) errnum, faocnt, fao[0], fao[1], fao[2], fao[3], fao[4], fao[5], fao[6], fao[7], fao[8], fao[9], fao[10], fao[11], fao[12], fao[13], fao[14], fao[15], fao[16], fao[17], fao[18], fao[19], fao[20], fao[21], fao[22], fao[23], fao[24], fao[25], fao[26], fao[27], fao[28], fao[29], fao[30], fao[31], fao[32], fao[33]); } return; } else { va_end(var); rts_error_csa(CSA_ARG(NULL) VARLSTCNT(1) status); } }
void op_zmess(unsigned int cnt, ...) { va_list var; const err_ctl *ectl; const err_msg *eptr; UINTPTR_T fao[MAX_FAO_PARMS]; char buff[FAO_BUFFER_SPACE]; unsigned int errnum, j; int faocnt; error_def(ERR_TPRETRY); VAR_START(var, cnt); errnum = va_arg(var, int); cnt--; if (ectl = err_check(errnum)) { assert((errnum & FACMASK(ectl->facnum)) && (MSGMASK(errnum, ectl->facnum) <= ectl->msg_cnt)); j = MSGMASK(errnum, ectl->facnum); eptr = ectl->fst_msg + j - 1; faocnt = eptr->parm_count; faocnt = (faocnt > MAX_FAO_PARMS ? MAX_FAO_PARMS : faocnt); faocnt = mval2fao(eptr->msg, var, &fao[0], cnt, faocnt, buff, buff + SIZEOF(buff)); va_end(var); if (faocnt != -1) { if (ERR_TPRETRY == errnum) { /* A TP restart is being signalled. Set t_fail_hist just like a TRESTART command would */ op_trestart_set_cdb_code(); } rts_error(VARLSTCNT(faocnt+2) errnum, faocnt, fao[0], fao[1], fao[2], fao[3], fao[4], fao[5], fao[6], fao[7], fao[8], fao[9], fao[10], fao[11]); } } else { va_end(var); rts_error(VARLSTCNT(1) errnum); } }