Jump to: navigation, search

Howto:Extend Nasal

26 bytes added, 12:40, 28 January 2010
In FlightGear, the simplest way to add new extension functions is to look at the existing functions in [ $FG_SRC/Scripting]/NasalSys.cxx (src/Scripting/NasalSys.cxx).
There is a static table of function pointers (named funcs[]) referencing extension functions, along with their corresponding names in Nasal.
The following is a copy of the extension function list, taken in 05/2009:
So, the basic format is "name"(string), function_pointer - whereas "name" refers to the internal name used by Nasal and its scriptscripts, and "function_pointer" has to use the right function signature and is a pointer to the implementation of the Nasal function in C/C++ code space:
// The function signature for an extension function:

Navigation menu