/*
 * LIMIT_DEC.pgc - au 모듈 서비스 LIMIT_DEC (one service = one file).
 * 한도 차감(사용금액 증가).
 * 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 "LIMIT_DEC.h"

void LIMIT_DEC(TPSVCINFO *p)
{
    UBFH *b = (UBFH *)p->data;
    char card[24];
    long amount = getl(b, T_AMOUNT);
    gets_(b, T_KEY1, card, sizeof(card));
    if (audb_limit_dec(card, amount) < 0) FAIL(b);
    OK(b);
}
