Erik Hofman writes: > >David Megginson wrote: >> >> Erik -- what do your bindings look like? > >You mean the code to bind a JavaScript function to a C function: > >static JSBool >_fgs_set(JSContext *cx, JSObject *obj, uintN argc, jsval >*argv, jsval *rval) >{ > const char *node, *str; > > if (argc != 2) > return JS_FALSE; > > if ((node = JS_GetStringBytes(JS_ValueToString(cx, >argv[0]))) == NULL) > return JS_FALSE; > > if ((str = JS_GetStringBytes(JS_ValueToString(cx, >argv[1]))) == NULL) > return JS_FALSE; > > _fgs_root_node->setStringValue(node, str); > *rval = BOOLEAN_TO_JSVAL( true ); > > return JS_TRUE; >} > > >or do you mean: > >fgfs.set >fgfs.setBoolean >fgfs.get >fgfs.getBoolean >
Eric Have you looked at SWIG ??? The reason I ask is this looks nearly identical to the code SWIG would output for JavaScript from a SWIG interface file for fgSetString(char * , char *) The beauty of using SWIG is that the same interface file would support JavaScript, Perl, Python, TCL-Tk, Mzscheme, guile ... giving a choice of which Interpreter was compiled in. Cheers Norman _______________________________________________ Flightgear-devel mailing list [EMAIL PROTECTED] http://mail.flightgear.org/mailman/listinfo/flightgear-devel