blob: 3493c9b018483804de529a7fc565c6481babb7ea [file] [log] [blame]
{{+bindTo:partials.standard_nacl_api}}
<h1>PP_Var Struct Reference</h1>
<div id="doxygen-ref">
{{- dummy div to appease doxygen -}}
<div>
<!-- Generated by Doxygen 1.7.6.1 -->
</div>
<!--header-->
<div class="contents">
<!-- doxytag: class="PP_Var" --><h2>
Data Fields</h2><table class="memberdecls">
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga9815041477d810724e44da862f9852ed">PP_VarType</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p___var.html#a80a9be8f342e8d849d4911e5585a8123">type</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p___var.html#aa0b507acd514bb2644341721b838b870">padding</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">union <a class="el" href="union_p_p___var_value.html">PP_VarValue</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p___var.html#ada122d12bf6da5cf78699a170d188542">value</a></td></tr>
</table>
<hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
<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>
<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>
<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>
</div><hr /><h2>Field Documentation</h2>
<a class="anchor" id="aa0b507acd514bb2644341721b838b870"></a><!-- doxytag: member="PP_Var::padding" ref="aa0b507acd514bb2644341721b838b870" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int32_t <a class="el" href="struct_p_p___var.html#aa0b507acd514bb2644341721b838b870">PP_Var::padding</a></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The <code>padding</code> ensures <code>value</code> is aligned on an 8-byte boundary relative to the start of the struct. </p>
<p>Some compilers align doubles on 8-byte boundaries for 32-bit x86, and some align on 4-byte boundaries. </p>
</div>
</div>
<a class="anchor" id="a80a9be8f342e8d849d4911e5585a8123"></a><!-- doxytag: member="PP_Var::type" ref="a80a9be8f342e8d849d4911e5585a8123" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<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>
</tr>
</table>
</div>
<div class="memdoc">
</div>
</div>
<a class="anchor" id="ada122d12bf6da5cf78699a170d188542"></a><!-- doxytag: member="PP_Var::value" ref="ada122d12bf6da5cf78699a170d188542" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<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>
</tr>
</table>
</div>
<div class="memdoc">
<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>
<p>Only one of the fields of <code>value</code> is valid at a time based upon <code>type</code>. </p>
</div>
</div>
<hr />The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="pp__var_8h.html">pp_var.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}