Files
lobbs/apps/Config/ConfigCommon.cpp
Ben Allfree 1243b2bc1b refactor(core): split pal from kernel
Move the BBS kernel under core/ and host I/O under platforms/.
2026-10-07 15:54:38 -07:00

29 lines
785 B
C++

#include "ConfigCommon.h"
#include "../../core/LoBBSKernel.h"
#include "ConfigDal.h"
#include <cstring>
#include "core/LoBBSStackGuard.h"
void lobbsConfigPushKey(std::vector<LoScalar> &keys, const char *key, uint32_t def, uint32_t min, uint32_t max, const char *help)
{
if (!key)
return;
LoScalar rec;
rec.setString(LODB_F_TITLE, key);
if (help)
rec.setString(LODB_F_DESCRIPTION, help);
rec.setUint32(ConfigKeyField::FIELD_DEFAULT, def);
rec.setUint32(ConfigKeyField::FIELD_MIN, min);
rec.setUint32(ConfigKeyField::FIELD_MAX, max);
keys.push_back(rec);
}
uint32_t lobbsConfigGet(LoBBSCommandCtx &ctx, const char *key)
{
if (!ctx.kernel || !key)
return 0;
return ctx.kernel->config().dal().effectiveValue(ctx, key);
}