}
/**
+ * @brief Load configuration with default values
+ */
+static void load_conf_default(void)
+{
+ static int default_loaded = 0;
+
+ if (default_loaded) return;
+
+ default_loaded = 1;
+
+ config.reserved_mem_size = DEFAULT_RESV_MEM_SIZE;
+
+ config.test_mode = DEFAULT_TEST_MODE;
+
+ strncpy (config.working_dir, DEFAULT_WORKING_DIR, strlen(DEFAULT_WORKING_DIR));
+ config.working_dir[strlen(DEFAULT_WORKING_DIR)] = '\x00';
+
+ strncpy (config.log_dir, DEFAULT_LOG_DIR, strlen(DEFAULT_LOG_DIR));
+ config.log_dir[strlen(DEFAULT_LOG_DIR)] = '\x00';
+}
+
+/**
* @brief Load the configuration from /etc/npu-engine.ini and env-vars.
* @detail Refer to the header file for more detail.
*/
}
/**
- * @brief Load configuration with default values
- */
-void load_conf_default(void)
-{
- static int default_loaded = 0;
-
- if (default_loaded) return;
-
- default_loaded = 1;
-
- config.reserved_mem_size = DEFAULT_RESV_MEM_SIZE;
-
- config.test_mode = DEFAULT_TEST_MODE;
-
- strncpy (config.working_dir, DEFAULT_WORKING_DIR, strlen(DEFAULT_WORKING_DIR));
- config.working_dir[strlen(DEFAULT_WORKING_DIR)] = '\x00';
-
- strncpy (config.log_dir, DEFAULT_LOG_DIR, strlen(DEFAULT_LOG_DIR));
- config.log_dir[strlen(DEFAULT_LOG_DIR)] = '\x00';
-}
-
-/**
* @brief Check if the current running mose is 'test'
* @return 1 if in the 'test' mode, otherwise 0
* @note The behavior of calling before loading default configuration is undefined.
int is_test_mode(void)
{
return config.test_mode;
-}
\ No newline at end of file
+}