/*
 * ST_BANDRATE.pgc - st 모듈 서비스 ST_BANDRATE (one service = one file).
 * Moved verbatim from the former inline st_svr.pgc; runs on the caller's XA
 * branch (no EXEC SQL CONNECT). Advertised by st_svr at tpsvrinit.
 */
#include "ST_BANDRATE.h"

/* 26. ST_BANDRATE - 금액 구간 요율(bps) 조회 (dbio). */
void ST_BANDRATE(TPSVCINFO *p)
{
    UBFH *b = (UBFH *)p->data;
    char ftype[16];
    long amount = getl(b, T_AMOUNT), bps;
    gets_(b, T_STR1, ftype, sizeof(ftype)); if (ftype[0] == 0) strcpy(ftype, "MDR");
    bps = stdb_lookup_rate(ftype, amount);
    if (bps < 0) FAIL(b);
    setl(b, T_RC, bps);
    OK(b);
}

/* vim: set ts=4 sw=4 et smartindent: */
