/*
 * CARD_VALIDATE.pgc - au 모듈 서비스 CARD_VALIDATE (one service = one file).
 * 카드번호 Luhn 검증 (common lib).
 * Moved verbatim from the former inline au_svr.pgc; runs on the caller's XA
 * branch (no EXEC SQL CONNECT). Advertised by au_svr at tpsvrinit.
 */
#include "CARD_VALIDATE.h"

void CARD_VALIDATE(TPSVCINFO *p)
{
    UBFH *b = (UBFH *)p->data;
    char card[24];
    gets_(b, T_KEY1, card, sizeof(card));
    setl(b, T_RC, acq_luhn_ok(card) ? 0 : 1);
    OK(b);
}
