]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/util.cxx
Merge commit 'refs/merge-requests/13' of git://gitorious.org/fg/flightgear into next
[flightgear.git] / src / Main / util.cxx
index 909cbad12657fb5f0daa46cc46792ad2e29dee52..7c20530a36e5b59e6e92c0611ac00c2b5ed439cf 100644 (file)
@@ -25,7 +25,7 @@
 #include <cstdlib>
 
 #include <vector>
-SG_USING_STD(vector);
+using std::vector;
 
 #include <simgear/debug/logstream.hxx>
 
@@ -105,19 +105,6 @@ fgSetupWind (double min_hdg, double max_hdg, double speed, double gust)
               speed);
 }
 
-
-void
-fgExit (int status)
-{
-#ifdef OSG_LIBRARY_STATIC
-    osgDB::Registry::instance( true);
-#endif
-
-    SG_LOG(SG_GENERAL, SG_INFO, "Exiting FlightGear with status " << status);
-    std::exit(status);
-}
-
-
 // Originally written by Alex Perry.
 double
 fgGetLowPass (double current, double target, double timeratio)
@@ -198,12 +185,20 @@ fgUnescape (const char *s)
 }
 
 
+// Write out path to validation node and read it back in. A Nasal
+// listener is supposed to replace the path with a validated version
+// or an empty string otherwise.
 const char *fgValidatePath (const char *str, bool write)
 {
     static SGPropertyNode_ptr r, w;
     if (!r) {
         r = fgGetNode("/sim/paths/validate/read", true);
+        r->setAttribute(SGPropertyNode::READ, true);
+        r->setAttribute(SGPropertyNode::WRITE, true);
+
         w = fgGetNode("/sim/paths/validate/write", true);
+        w->setAttribute(SGPropertyNode::READ, true);
+        w->setAttribute(SGPropertyNode::WRITE, true);
     }
     SGPropertyNode *prop = write ? w : r;
     prop->setStringValue(str);