Pepper_47_C_interfaces
|
#include <pp_var.h>
Public Attributes | |
PP_VarType | type |
int32_t | padding |
union PP_VarValue | value |
The PP_VAR
struct is a variant data type and can contain any value of one of the types named in the PP_VarType
enum. This structure is for passing data between native code which can be strongly typed and the browser (JavaScript) which isn't strongly typed.
JavaScript has a "number" type for holding a number, and does not differentiate between floating point and integer numbers. The JavaScript operations will try to optimize operations by using integers when possible, but could end up with doubles. Therefore, you can't assume a numeric PP_Var
will be the type you expect. Your code should be capable of handling either int32_t or double for numeric PP_Vars sent from JavaScript.
int32_t PP_Var::padding |
PP_VarType PP_Var::type |
union PP_VarValue PP_Var::value |
This value
represents the contents of the PP_Var. Only one of the fields of value
is valid at a time based upon type
.
Definition at line 180 of file pp_var.h.
Referenced by PP_MakeBool(), PP_MakeDouble(), and PP_MakeInt32().