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

/* 10. CM_SEQ - 공통 채번 (cm_seq 이름있는 카운터). */
void CM_SEQ(TPSVCINFO *p)
{
    UBFH *b = (UBFH *)p->data;
    char name[32];
    long v;
    gets_(b, T_KEY1, name, sizeof(name)); if (name[0] == 0) strcpy(name, "BATCH");
    v = cmdb_next_seq(name);
    if (v < 0) FAIL(b);
    setl(b, T_ARG1, v);
    OK(b);
}
