本文整理汇总了C++中InitConfig函数的典型用法代码示例。如果您正苦于以下问题:C++ InitConfig函数的具体用法?C++ InitConfig怎么用?C++ InitConfig使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了InitConfig函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TEST_F
TEST_F(MallocDebugConfigTest, free_track_backtrace_num_frames_zero) {
ASSERT_TRUE(InitConfig("free_track_backtrace_num_frames=0")) << getFakeLogPrint();
ASSERT_EQ(0U, config->options);
ASSERT_EQ(0U, config->free_track_backtrace_num_frames);
ASSERT_STREQ("", getFakeLogBuf().c_str());
ASSERT_STREQ("", getFakeLogPrint().c_str());
}
示例2: maincsm_onmessage
int maincsm_onmessage(CSM_RAM* data, GBS_MSG* msg)
{
if (msg->msg == MSG_RECONFIGURE_REQ)
{
if (strcmp_nocase(successed_config_filename, (char*)msg->data0) == 0)
InitConfig();
}
return 1;
}
示例3: TEST_F
TEST_F(MallocDebugConfigTest, free_track_backtrace_num_frames_max_error) {
ASSERT_FALSE(InitConfig("free_track_backtrace_num_frames=400"));
ASSERT_STREQ("", getFakeLogBuf().c_str());
std::string log_msg(
"6 malloc_debug malloc_testing: bad value for option 'free_track_backtrace_num_frames', "
"value must be <= 256: 400\n");
ASSERT_STREQ((log_msg + usage_string).c_str(), getFakeLogPrint().c_str());
}
示例4: init
static void init()
{
decoder_ = FLAC__file_decoder_new();
strcpy(lastfn_, "");
InitConfig();
ReadConfig();
InitInfobox();
}
示例5: m_name
Scorer::Scorer(const string& name, const string& config)
: m_name(name),
m_vocab(mert::VocabularyFactory::GetVocabulary()),
#if defined(__GLIBCXX__) || defined(__GLIBCPP__)
m_filter(NULL),
#endif
m_score_data(NULL),
m_enable_preserve_case(true)
{
InitConfig(config);
}
示例6: TEST
TEST(Config, SpecialSectionValues) {
InitConfig("data/s3test.conf", "special_over");
EXPECT_EQ(8, s3ext_threadnum);
EXPECT_EQ(128 * 1024 * 1024, s3ext_chunksize);
EXPECT_EQ(10240, s3ext_low_speed_limit);
EXPECT_EQ(60, s3ext_low_speed_time);
EXPECT_TRUE(s3ext_encryption);
EXPECT_FALSE(s3ext_debug_curl);
}
示例7: Init
BOOL Init()
{
InitConfig( );
InitDafaultConfig( "./ServerConfig.ini" );
Printf( m_ddesc[0] );
Printf( m_ddesc[1] );
SetServerType(AGENT_SERVER);
LoadServerConfig( "./ServerConfig.ini" );
Printf( m_desc[0] );
Printf( m_desc[1] );
return TRUE;
}
示例8: LoadConfig
//******************************************************************************
// load parameters from the registry
//******************************************************************************
void LoadConfig(sbtray_parms * p)
{
LONG err;
HKEY hKey;
DWORD value;
DWORD value_size;
#define REGLOAD_DWORD(vn,vv) \
value_size = sizeof(DWORD); \
err = RegQueryValueEx(hKey,vn,0,0, \
(LPBYTE)&value,&value_size); \
if ((err == ERROR_SUCCESS) && (value_size == sizeof(DWORD))) \
{ \
vv = value; \
}
#define REGLOAD_STR(vn,vv) \
ZeroMemory(vv,SBTRAY_PARMS_STRLEN+1); \
value_size = SBTRAY_PARMS_STRLEN+1; \
err = RegQueryValueEx(hKey,vn,0,0, \
(LPBYTE)vv,&value_size); \
if (err != ERROR_SUCCESS) \
{ \
vv[0] = '\0'; \
}
// sanity check
if (!p)
return;
InitConfig(p);
err = RegOpenKeyEx(HKEY_CURRENT_USER,TOPLEVEL_REGKEY,
0,KEY_READ,&hKey);
if (err == ERROR_SUCCESS)
{
REGLOAD_DWORD( REGVALUE_ENABLESOUNDS, p->bEnableSounds )
REGLOAD_DWORD( REGVALUE_UPDATEPERIOD, p->dwUpdatePeriod )
REGLOAD_DWORD( REGVALUE_ENABLELOGGING, p->bEnableLogging )
REGLOAD_DWORD( REGVALUE_ENABLEEMAIL, p->bEnableEmail )
REGLOAD_STR( REGVALUE_SMTPSERVER, p->szSMTPServer )
REGLOAD_STR( REGVALUE_MAILFROM, p->szMailFrom )
REGLOAD_STR( REGVALUE_MAILTO, p->szMailTo )
REGLOAD_DWORD( REGVALUE_SELECTEDWORLD, p->dwSelectedWorld )
RegCloseKey(hKey);
}
return;
}
示例9: TEST_F
TEST_F(MallocDebugConfigTest, front_guard) {
ASSERT_TRUE(InitConfig("front_guard=48"));
ASSERT_EQ(FRONT_GUARD, config->options);
ASSERT_EQ(48U, config->front_guard_bytes);
ASSERT_TRUE(InitConfig("front_guard"));
ASSERT_EQ(FRONT_GUARD, config->options);
ASSERT_EQ(32U, config->front_guard_bytes);
ASSERT_TRUE(InitConfig("front_guard=39"));
ASSERT_EQ(FRONT_GUARD, config->options);
#if defined(__LP64__)
ASSERT_EQ(48U, config->front_guard_bytes);
#else
ASSERT_EQ(40U, config->front_guard_bytes);
#endif
ASSERT_TRUE(InitConfig("front_guard=41"));
ASSERT_EQ(FRONT_GUARD, config->options);
ASSERT_EQ(48U, config->front_guard_bytes);
ASSERT_STREQ("", getFakeLogBuf().c_str());
ASSERT_STREQ("", getFakeLogPrint().c_str());
}
示例10: Init
bool MSystem::Init()
{
if(!InitConfig())
{
return false;
}
InitDebug();
InitLog();
MISEISINFO("*********************************************");
MISEISINFO("MSWA start");
return true;
}
示例11: main
int main (char *exename, char *fname)
{
MAIN_CSM main_csm;
LockSched();
UpdateCSMname();
CreateCSM(&MAINCSM.maincsm,&main_csm,0);
UnlockSched();
InitConfig(ELF_NAME);
GetFileDir (exename, dir);
//SetCurFile (fname);
return 0;
}
示例12: writer_init
// invoked by s3_export(), need to be exception safe
GPWriter* writer_init(const char* url_with_options, const char* format) {
GPWriter* writer = NULL;
s3extErrorMessage.clear();
try {
if (!url_with_options) {
return NULL;
}
string urlWithOptions(url_with_options);
S3Params params = InitConfig(urlWithOptions);
InitRemoteLog();
// Prepare memory to be used for thread chunk buffer.
PrepareS3MemContext(params);
string extName = params.isAutoCompress() ? string(format) + ".gz" : format;
writer = new GPWriter(params, extName);
if (writer == NULL) {
return NULL;
}
memoryContextHolder = new S3MemoryContext(params.getMemoryContext());
writer->open(params);
return writer;
} catch (S3Exception& e) {
if (writer != NULL) {
delete writer;
delete memoryContextHolder;
}
s3extErrorMessage =
"writer_init caught a " + e.getType() + " exception: " + e.getFullMessage();
S3ERROR("writer_init caught %s: %s", e.getType().c_str(), s3extErrorMessage.c_str());
return NULL;
} catch (...) {
if (writer != NULL) {
delete writer;
delete memoryContextHolder;
}
S3ERROR("Caught an unexpected exception.");
s3extErrorMessage = "Caught an unexpected exception.";
return NULL;
}
}
示例13: main
int main(){
//GLFWの初期化
if (!Initialize_GLFW()){
return 1;
}
//ウインドウを作成する
Window::CreateWindowStart(1024, 768, "Test!");
//GLEWの初期化
if (!Initialize_GLEW()){
return 1;
}
//初期設定=========================================
InitConfig();
//ウィンドウ、シーケンスコントローラーを作成
InputManager::SetMyWindow(Window::GetWindow());
if (!SeaquenceController::instance()){
SeaquenceController::Create();
}
// ウィンドウ全体をビューポートにする
glViewport(0, 0, Window::Get_w(), Window::Get_h());
//描画関連の設定(かえることがあれば他から設定できるように移す)
ConfingDraw();
//=================================================
//描画処理=========================================
while (Window::ShouldClose() == GL_FALSE){
// 画面消去
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
//シーケンスコントローラーが全てのUpdate、描画を管理する
SeaquenceController::instance()->Update();
//バッファを入れ替える
Window::SwapBuffers();
}
//=================================================
//終わった時の処理
atexit(Cleanup);
return 0;
}
示例14: InitConfig
NTSTATUS CWdfQueue::Create(CWdfDevice &Device)
{
WDF_IO_QUEUE_CONFIG QueueConfig;
WDF_OBJECT_ATTRIBUTES Attributes;
InitConfig(QueueConfig);
SetCallbacks(QueueConfig);
WDF_OBJECT_ATTRIBUTES_INIT(&Attributes);
Attributes.ExecutionLevel = m_ExecutionLevel;
auto status = Device.AddQueue(QueueConfig, Attributes, m_Queue);
if (!NT_SUCCESS(status)) {
TraceEvents(TRACE_LEVEL_ERROR, TRACE_WDFDEVICE, "%!FUNC! failed %!STATUS!", status);
}
return status;
}
示例15: TEST
TEST(ListBucket, s3) {
InitConfig("test/s3.conf", "default");
S3Credential g_cred = {s3ext_accessid, s3ext_secret};
ListBucketResult *r =
ListBucket("https", S3HOST, S3BUCKET, S3PREFIX, g_cred);
ASSERT_NE(r, (void *)NULL);
EXPECT_EQ(r->contents.size(), 16);
char urlbuf[256];
vector<BucketContent *>::iterator i;
for (i = r->contents.begin(); i != r->contents.end(); i++) {
BucketContent *p = *i;
sprintf(urlbuf, "http://%s/%s/%s", S3HOST, S3BUCKET, p->Key().c_str());
printf("%s, %d\n", urlbuf, p->Size());
}
delete r;
}