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

/* 24. CM_HOLIDAY_CHK - 휴일 여부 확인 (cm_holiday). */
void CM_HOLIDAY_CHK(TPSVCINFO *p)
{
    UBFH *b = (UBFH *)p->data;
    char date[16];
    int h;
    gets_(b, T_STR1, date, sizeof(date));
    if (date[0] == 0) FAIL(b);
    h = cmdb_is_holiday(date);
    if (h < 0) FAIL(b);
    setl(b, T_RC, h);              /* 1=휴일, 0=평일 */
    OK(b);
}
