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

/* 19. CM_PARAM_SET - 공통 파라미터 설정 (owner-writes, upsert). */
void CM_PARAM_SET(TPSVCINFO *p)
{
    UBFH *b = (UBFH *)p->data;
    char key[64], val[128];
    gets_(b, T_STR1, key, sizeof(key));
    gets_(b, T_STR3, val, sizeof(val));
    if (key[0] == 0) FAIL(b);
    if (cmdb_set_param(key, val) < 0) FAIL(b);
    userlog("CM_PARAM_SET %s=%s", key, val);
    OK(b);
}
