From 3f79b5c000b4e25372438f04fe0e24ab296cdaf0 Mon Sep 17 00:00:00 2001 From: Chris Punches Date: Fri, 14 Mar 2025 03:07:02 -0400 Subject: [PATCH] improved testing with standalone module builds for debugging --- dpmdk/include/CommonModuleAPI.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dpmdk/include/CommonModuleAPI.hpp b/dpmdk/include/CommonModuleAPI.hpp index dcf96ec..3ffcd45 100644 --- a/dpmdk/include/CommonModuleAPI.hpp +++ b/dpmdk/include/CommonModuleAPI.hpp @@ -175,7 +175,14 @@ default: level_str = "UNKNOWN"; break; \ std::cout << "[" << level_str << "] " << message << std::endl; \ } \ extern "C" const char* dpm_get_config(const char* section, const char* key) { \ -return nullptr; \ +if (!section || !key) return nullptr; \ +\ +/* Create environment variable name in format SECTION_KEY */ \ +std::string env_name = std::string(section) + "_" + std::string(key); \ +\ +/* Check if environment variable exists */ \ +const char* env_value = getenv(env_name.c_str()); \ +return env_value; /* Will be null if env var doesn't exist */ \ } \ extern "C" void dpm_set_logging_level(int level) { \ std::cout << "[INFO] Verbosity level ignored, as all standalone executions have maximum verbosity" << std::endl; \