/*
 * CM_LUHN.pgc - cm 모듈 서비스 CM_LUHN (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_LUHN.h"

/* 13. CM_LUHN - 카드번호 Luhn 검증 (순수 계산, common util). */
void CM_LUHN(TPSVCINFO *p)
{
    UBFH *b = (UBFH *)p->data;
    char pan[32];
    gets_(b, T_STR5, pan, sizeof(pan));
    setl(b, T_RC, acq_luhn_ok(pan) ? 0 : 1);   /* 0=유효 */
    OK(b);
}
