/*
 * MG_STATUS.pgc - mg 모듈 서비스 MG_STATUS (one service = one file).
 * Split out of the former inline mg_svr.pgc; runs on the caller's XA
 * branch (no EXEC SQL CONNECT). Advertised by mg_svr at tpsvrinit.
 */
#include "MG_STATUS.h"

/* 29. MG_STATUS - 전문 처리 상태 조회 (msg_id). */
void MG_STATUS(TPSVCINFO *p)
{
    UBFH *b = (UBFH *)p->data;
    long msg_id = getl(b, T_ID1);
    char st[4];
    if (mgdb_get_msg_status(msg_id, st) < 0) FAIL(b);
    sets_(b, T_STATUS, st);
    OK(b);
}
