sgs_PushPath [function]
SGSBOOL sgs_PushPath( sgs_Context* C, sgs_Variable var, const char* path, ... )
Push the variable specified by starting point var
and traversal path path
, return if successful.
The safety of this function is similar to that of the printf
family of functions. Be explicit in what types you pass to the variable argument list to avoid errors.
- The syntax of
path
: a list of letters, specifying a sub-variable to request (o,p,s,i,k,n).
Table of accepted letters
letter | property? | variable arguments | virtual machine access mode / description |
---|---|---|---|
o | yes | SizeVal | integer property |
p | yes | C string | string property |
s | yes | SizeVal, buffer | special string property |
i | no | SizeVal | integer index |
k | no | C string | string index |
n | no | SizeVal, buffer | special string index |
- Legend:
- SizeVal: sgs_SizeVal / int32_t
- C string: null-terminated char* string
- buffer: char* byte array, size is specified in the previous argument
- property?: if yes, property access is used (object.property), otherwise index access is used (object[index])