FlightGear next
nasal-props.cxx File Reference
#include "config.h"
#include <cstring>
#include <simgear/nasal/nasal.h>
#include <simgear/props/props.hxx>
#include <simgear/props/vectorPropTemplates.hxx>
#include <Main/globals.hxx>
#include "NasalSys.hxx"
#include "NasalSys_private.hxx"

Go to the source code of this file.

Macros

#define NASTR(s)
 
#define NODENOARG()
 
#define NODEARG()
 
#define MOVETARGET(cond1, create)
 

Functions

static void propNodeGhostDestroy (void *ghost)
 
naRef propNodeGhostCreate (naContext c, SGPropertyNode *ghost)
 
SGPropertyNode * ghostToPropNode (naRef ref)
 
static naRef f_getType (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_isNumeric (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_isInt (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_getAttribute (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_setAttribute (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_getName (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_getIndex (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_equals (naContext c, naRef me, int argc, naRef *args)
 
template<typename T>
naRef makeVectorFromVec (naContext c, const T &vec)
 
static naRef f_getValue (naContext c, naRef me, int argc, naRef *args)
 
template<typename T>
makeVecFromVector (naRef vector)
 
static std::string s_val_description (naRef val)
 
static naRef f_setValueHelper (naContext c, SGPropertyNode_ptr node, naRef val)
 
static naRef f_setValue (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_setIntValue (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_setBoolValue (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_toggleBoolValue (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_setDoubleValue (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_adjustValue (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_setChildrenHelper (naContext c, SGPropertyNode_ptr node, char *name, naRef val)
 
static naRef f_setValuesHelper (naContext c, SGPropertyNode_ptr node, naRef hash)
 
static naRef f_setValues (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_setChildren (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_getParent (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_getChild (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_getChildren (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_addChild (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_addChildren (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_removeChild (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_removeChildren (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_removeAllChildren (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_alias (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_unalias (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_location (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_getAliasTarget (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_getNode (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_new (naContext c, naRef me, int argc, naRef *args)
 
static naRef f_globals (naContext c, naRef me, int argc, naRef *args)
 

Variables

naGhostType PropNodeGhostType = { propNodeGhostDestroy, "prop", nullptr, nullptr }
 
struct { 
 
   naCFunction   func 
 
   const char *   name 
 
propfuncs [] 
 

Macro Definition Documentation

◆ MOVETARGET

#define MOVETARGET ( cond1,
create )
Value:
if(cond1) { \
naRef name = naVec_get(argv, 0); \
if(naIsString(name)) { \
try { \
node = node->getNode(naStr_data(name), create); \
} catch(const string& err) { \
naRuntimeError(c, (char *)err.c_str()); \
return naNil(); \
} \
if(!node) return naNil(); \
naVec_removefirst(argv); /* pop only if we were successful */ \
} \
}
const char * name

Definition at line 86 of file nasal-props.cxx.

◆ NASTR

#define NASTR ( s)
Value:
s ? naStr_fromdata(naNewString(c),(char*)(s),strlen(s)) : naNil()

Definition at line 56 of file nasal-props.cxx.

◆ NODEARG

#define NODEARG ( )
Value:
NODENOARG(); \
naRef argv = args[1]
#define NODENOARG()

Definition at line 71 of file nasal-props.cxx.

◆ NODENOARG

#define NODENOARG ( )
Value:
if(argc < 2 || !naIsGhost(args[0]) || \
naGhost_type(args[0]) != &PropNodeGhostType) \
naRuntimeError(c, "bad argument to props function"); \
SGPropertyNode_ptr node = static_cast<SGPropertyNode*>(naGhost_ptr(args[0]));
naGhostType PropNodeGhostType

Definition at line 65 of file nasal-props.cxx.

Function Documentation

◆ f_addChild()

static naRef f_addChild ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 640 of file nasal-props.cxx.

◆ f_addChildren()

static naRef f_addChildren ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 669 of file nasal-props.cxx.

◆ f_adjustValue()

static naRef f_adjustValue ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 448 of file nasal-props.cxx.

◆ f_alias()

static naRef f_alias ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 796 of file nasal-props.cxx.

◆ f_equals()

static naRef f_equals ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 276 of file nasal-props.cxx.

◆ f_getAliasTarget()

static naRef f_getAliasTarget ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 846 of file nasal-props.cxx.

◆ f_getAttribute()

static naRef f_getAttribute ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 170 of file nasal-props.cxx.

◆ f_getChild()

static naRef f_getChild ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 582 of file nasal-props.cxx.

◆ f_getChildren()

static naRef f_getChildren ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 609 of file nasal-props.cxx.

◆ f_getIndex()

static naRef f_getIndex ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 267 of file nasal-props.cxx.

◆ f_getName()

static naRef f_getName ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 257 of file nasal-props.cxx.

◆ f_getNode()

static naRef f_getNode ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 858 of file nasal-props.cxx.

◆ f_getParent()

static naRef f_getParent ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 566 of file nasal-props.cxx.

◆ f_getType()

static naRef f_getType ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 106 of file nasal-props.cxx.

◆ f_getValue()

static naRef f_getValue ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 305 of file nasal-props.cxx.

◆ f_globals()

static naRef f_globals ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 889 of file nasal-props.cxx.

◆ f_isInt()

static naRef f_isInt ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 153 of file nasal-props.cxx.

◆ f_isNumeric()

static naRef f_isNumeric ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 133 of file nasal-props.cxx.

◆ f_location()

static naRef f_location ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 835 of file nasal-props.cxx.

◆ f_new()

static naRef f_new ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 878 of file nasal-props.cxx.

◆ f_removeAllChildren()

static naRef f_removeAllChildren ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 783 of file nasal-props.cxx.

◆ f_removeChild()

static naRef f_removeChild ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 713 of file nasal-props.cxx.

◆ f_removeChildren()

static naRef f_removeChildren ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 740 of file nasal-props.cxx.

◆ f_setAttribute()

static naRef f_setAttribute ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 215 of file nasal-props.cxx.

◆ f_setBoolValue()

static naRef f_setBoolValue ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 411 of file nasal-props.cxx.

◆ f_setChildren()

static naRef f_setChildren ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 551 of file nasal-props.cxx.

◆ f_setChildrenHelper()

static naRef f_setChildrenHelper ( naContext c,
SGPropertyNode_ptr node,
char * name,
naRef val )
static

Definition at line 513 of file nasal-props.cxx.

◆ f_setDoubleValue()

static naRef f_setDoubleValue ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 433 of file nasal-props.cxx.

◆ f_setIntValue()

static naRef f_setIntValue ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 393 of file nasal-props.cxx.

◆ f_setValue()

static naRef f_setValue ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 385 of file nasal-props.cxx.

◆ f_setValueHelper()

static naRef f_setValueHelper ( naContext c,
SGPropertyNode_ptr node,
naRef val )
static

Definition at line 350 of file nasal-props.cxx.

◆ f_setValues()

static naRef f_setValues ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 505 of file nasal-props.cxx.

◆ f_setValuesHelper()

static naRef f_setValuesHelper ( naContext c,
SGPropertyNode_ptr node,
naRef hash )
static

Definition at line 483 of file nasal-props.cxx.

◆ f_toggleBoolValue()

static naRef f_toggleBoolValue ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 419 of file nasal-props.cxx.

◆ f_unalias()

static naRef f_unalias ( naContext c,
naRef me,
int argc,
naRef * args )
static

Definition at line 828 of file nasal-props.cxx.

◆ ghostToPropNode()

SGPropertyNode * ghostToPropNode ( naRef ref)

Definition at line 48 of file nasal-props.cxx.

◆ makeVecFromVector()

template<typename T>
T makeVecFromVector ( naRef vector)

Definition at line 314 of file nasal-props.cxx.

◆ makeVectorFromVec()

template<typename T>
naRef makeVectorFromVec ( naContext c,
const T & vec )

Definition at line 289 of file nasal-props.cxx.

◆ propNodeGhostCreate()

naRef propNodeGhostCreate ( naContext c,
SGPropertyNode * ghost )

Definition at line 36 of file nasal-props.cxx.

◆ propNodeGhostDestroy()

static void propNodeGhostDestroy ( void * ghost)
static

Definition at line 28 of file nasal-props.cxx.

◆ s_val_description()

static std::string s_val_description ( naRef val)
static

Definition at line 330 of file nasal-props.cxx.

Variable Documentation

◆ func

naCFunction func

Definition at line 895 of file nasal-props.cxx.

◆ name

const char* name

Definition at line 896 of file nasal-props.cxx.

◆ [struct]

struct { ... } propfuncs[]

◆ PropNodeGhostType

naGhostType PropNodeGhostType = { propNodeGhostDestroy, "prop", nullptr, nullptr }

Definition at line 34 of file nasal-props.cxx.