}
bool
-FGScriptMgr::run (const char * script)
+FGScriptMgr::run (const char * script) const
{
-#if defined(FG_PSL_STRING_COMPILE)
// FIXME: detect and report errors
pslProgram program(extensions);
if (program.compile(script, globals->get_fg_root().c_str()) > 0)
while (program.step() != PSL_PROGRAM_END)
;
return true;
-#else
- SG_LOG(SG_INPUT, SG_ALERT, "Input-binding scripts not supported");
- return false;
-#endif
+}
+
+bool
+FGScriptMgr::run_inline (const char * script) const
+{
+ string s = "int main () {\n";
+ s += script;
+ s += "\n return 0;\n}\n";
+ return run(s.c_str());
}