瀏覽代碼

expose config_express

David Rose 24 年之前
父節點
當前提交
d7ad60572c
共有 3 個文件被更改,包括 17 次插入1 次删除
  1. 2 1
      panda/src/express/config_express.N
  2. 9 0
      panda/src/express/config_express.cxx
  3. 6 0
      panda/src/express/config_express.h

+ 2 - 1
panda/src/express/config_express.N

@@ -4,4 +4,5 @@ forcetype Notify
 forcetype NotifyCategory
 forcetype NotifyCategory
 forcetype NotifySeverity
 forcetype NotifySeverity
 
 
-
+forcetype ConfigExpress
+renametype ConfigExpress ConfigExpress

+ 9 - 0
panda/src/express/config_express.cxx

@@ -110,3 +110,12 @@ const int patchfile_buffer_size =
 
 
 const int patchfile_zone_size =
 const int patchfile_zone_size =
         config_express.GetInt("patchfile-zone-size", 10000);
         config_express.GetInt("patchfile-zone-size", 10000);
+
+
+// Returns the configure object for accessing config variables from a
+// scripting language.
+ConfigExpress &
+get_config_express() {
+  return config_express;
+}
+

+ 6 - 0
panda/src/express/config_express.h

@@ -42,4 +42,10 @@ extern const int patchfile_increment_size;
 extern const int patchfile_buffer_size;
 extern const int patchfile_buffer_size;
 extern const int patchfile_zone_size;
 extern const int patchfile_zone_size;
 
 
+// Expose the Config variable for Python access.
+BEGIN_PUBLISH
+typedef Config::Config<ConfigureGetConfig_config_express> ConfigExpress;
+EXPCL_PANDAEXPRESS ConfigExpress &get_config_express();
+END_PUBLISH
+
 #endif /* __CONFIG_UTIL_H__ */
 #endif /* __CONFIG_UTIL_H__ */