1 {{+bindTo:partials.standard_nacl_api}} 2 <h1>PP_Var Struct Reference</h1> 3 <div id="doxygen-ref"> 4 {{- dummy div to appease doxygen -}} 5 <div> 6 <!-- Generated by Doxygen 1.7.6.1 --> 7 8 9 </div> 10 <!--header--> 11 <div class="contents"> 12 <!-- doxytag: class="PP_Var" --><h2> 13 Data Fields</h2><table class="memberdecls"> 14 15 <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga9815041477d810724e44da862f9852ed">PP_VarType</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p___var.html#a80a9be8f342e8d849d4911e5585a8123">type</a></td></tr> 16 <tr><td class="memItemLeft" align="right" valign="top">int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p___var.html#aa0b507acd514bb2644341721b838b870">padding</a></td></tr> 17 <tr><td class="memItemLeft" align="right" valign="top">union <a class="el" href="union_p_p___var_value.html">PP_VarValue</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p___var.html#ada122d12bf6da5cf78699a170d188542">value</a></td></tr> 18 </table> 19 <hr /><a name="details" id="details"></a><h2>Detailed Description</h2> 20 <div class="textblock"><p>The <code>PP_VAR</code> struct is a variant data type and can contain any value of one of the types named in the <code>PP_VarType</code> enum. </p> 21 <p>This structure is for passing data between native code which can be strongly typed and the browser (JavaScript) which isn't strongly typed.</p> 22 <p>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 <code><a class="el" href="struct_p_p___var.html" title="The PP_VAR struct is a variant data type and can contain any value of one of the types named in the P...">PP_Var</a></code> 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. </p> 23 </div><hr /><h2>Field Documentation</h2> 24 <a class="anchor" id="aa0b507acd514bb2644341721b838b870"></a><!-- doxytag: member="PP_Var::padding" ref="aa0b507acd514bb2644341721b838b870" args="" --> 25 <div class="memitem"> 26 <div class="memproto"> 27 <table class="memname"> 28 <tr> 29 <td class="memname">int32_t <a class="el" href="struct_p_p___var.html#aa0b507acd514bb2644341721b838b870">PP_Var::padding</a></td> 30 </tr> 31 </table> 32 </div> 33 <div class="memdoc"> 34 <p>The <code>padding</code> ensures <code>value</code> is aligned on an 8-byte boundary relative to the start of the struct. </p> 35 <p>Some compilers align doubles on 8-byte boundaries for 32-bit x86, and some align on 4-byte boundaries. </p> 36 </div> 37 </div> 38 <a class="anchor" id="a80a9be8f342e8d849d4911e5585a8123"></a><!-- doxytag: member="PP_Var::type" ref="a80a9be8f342e8d849d4911e5585a8123" args="" --> 39 <div class="memitem"> 40 <div class="memproto"> 41 <table class="memname"> 42 <tr> 43 <td class="memname"><a class="el" href="group___enums.html#ga9815041477d810724e44da862f9852ed">PP_VarType</a> <a class="el" href="struct_p_p___var.html#a80a9be8f342e8d849d4911e5585a8123">PP_Var::type</a></td> 44 </tr> 45 </table> 46 </div> 47 <div class="memdoc"> 48 </div> 49 </div> 50 <a class="anchor" id="ada122d12bf6da5cf78699a170d188542"></a><!-- doxytag: member="PP_Var::value" ref="ada122d12bf6da5cf78699a170d188542" args="" --> 51 <div class="memitem"> 52 <div class="memproto"> 53 <table class="memname"> 54 <tr> 55 <td class="memname">union <a class="el" href="union_p_p___var_value.html">PP_VarValue</a> <a class="el" href="struct_p_p___var.html#ada122d12bf6da5cf78699a170d188542">PP_Var::value</a></td> 56 </tr> 57 </table> 58 </div> 59 <div class="memdoc"> 60 <p>This <code>value</code> represents the contents of the <a class="el" href="struct_p_p___var.html" title="The PP_VAR struct is a variant data type and can contain any value of one of the types named in the P...">PP_Var</a>. </p> 61 <p>Only one of the fields of <code>value</code> is valid at a time based upon <code>type</code>. </p> 62 </div> 63 </div> 64 <hr />The documentation for this struct was generated from the following file:<ul> 65 <li><a class="el" href="pp__var_8h.html">pp_var.h</a></li> 66 </ul> 67 </div><!-- contents --> 68 </div> 69 {{/partials.standard_nacl_api}} 70