static gboolean ToolsCoreSigHUPCb(const siginfo_t *info, gpointer data) { ToolsCore_ReloadConfig(data, TRUE); return TRUE; }
void ToolsCore_Setup(ToolsServiceState *state) { GMainContext *gctx; ToolsServiceProperty ctxProp = { TOOLS_CORE_PROP_CTX }; if (!g_thread_supported()) { g_thread_init(NULL); } ToolsCore_ReloadConfig(state, FALSE); /* * Useful for debugging purposes. Log the vesion and build information. */ g_message("Tools Version: %s (%s)\n", TOOLS_VERSION_EXT_CURRENT_STR, BUILD_NUMBER); /* Initializes the app context. */ gctx = g_main_context_default(); state->ctx.version = TOOLS_CORE_API_V1; state->ctx.name = state->name; state->ctx.errorCode = EXIT_SUCCESS; #if defined(__APPLE__) /* * Mac OS doesn't use g_main_loop_run(), so need to create the loop as * "running". */ state->ctx.mainLoop = g_main_loop_new(gctx, TRUE); #else state->ctx.mainLoop = g_main_loop_new(gctx, FALSE); #endif state->ctx.isVMware = VmCheck_IsVirtualWorld(); g_main_context_unref(gctx); g_type_init(); state->ctx.serviceObj = g_object_new(TOOLSCORE_TYPE_SERVICE, NULL); /* Register the core properties. */ ToolsCoreService_RegisterProperty(state->ctx.serviceObj, &ctxProp); g_object_set(state->ctx.serviceObj, TOOLS_CORE_PROP_CTX, &state->ctx, NULL); ToolsCorePool_Init(&state->ctx); /* Initializes the debug library if needed. */ if (state->debugPlugin != NULL) { ToolsCoreInitializeDebug(state); } }
static gboolean ToolsCoreConfFileCb(gpointer clientData) { ToolsCore_ReloadConfig(clientData, FALSE); return TRUE; }