]> git.mxchange.org Git - simgear.git/blobdiff - simgear/nasal/string.c
cppbind.Ghost: clean up a bit
[simgear.git] / simgear / nasal / string.c
index 4855054cddd24cc1983eb0d373056c64c7b66bf3..ce8b5ac252721919a91293196b8ba29b277d1604 100644 (file)
@@ -320,3 +320,27 @@ static int fromnum(double val, unsigned char* s)
     *ptr = 0;
     return ptr - s;
 }
+
+
+//------------------------------------------------------------------------------
+static naRef string_methods;
+static int init = 0; // As we can't use naNil() for static initialization we
+                     // need a separate variable for saving whether we have
+                     // already initialized.
+
+//------------------------------------------------------------------------------
+naRef naInit_string(naContext c)
+{
+  string_methods = naNewHash(c);
+  init = 1;
+  return string_methods;
+}
+
+//------------------------------------------------------------------------------
+naRef getStringMethods(naContext c)
+{
+  if( !init )
+    return naNil();
+
+  return string_methods;
+}