Pepper_56_C_interfaces
Pepper_56_C_interfaces
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
pp_var.h
Go to the documentation of this file.
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2  * Use of this source code is governed by a BSD-style license that can be
3  * found in the LICENSE file.
4  */
5 
6 /* From pp_var.idl modified Thu Oct 20 13:57:04 2016. */
7 
8 #ifndef PPAPI_C_PP_VAR_H_
9 #define PPAPI_C_PP_VAR_H_
10 
11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_macros.h"
13 #include "ppapi/c/pp_stdint.h"
14 
30 typedef enum {
107 } PP_VarType;
108 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VarType, 4);
121 union PP_VarValue {
133  int32_t as_int;
139  double as_double;
149  int64_t as_id;
150 };
151 
166 struct PP_Var {
167  PP_VarType type;
174  int32_t padding;
181 };
182 PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_Var, 16);
198 PP_INLINE struct PP_Var PP_MakeUndefined(void) {
199  struct PP_Var result = { PP_VARTYPE_UNDEFINED, 0, {PP_FALSE} };
200  return result;
201 }
202 
209 PP_INLINE struct PP_Var PP_MakeNull(void) {
210  struct PP_Var result = { PP_VARTYPE_NULL, 0, {PP_FALSE} };
211  return result;
212 }
213 
223 PP_INLINE struct PP_Var PP_MakeBool(PP_Bool value) {
224  struct PP_Var result = { PP_VARTYPE_BOOL, 0, {PP_FALSE} };
225  result.value.as_bool = value;
226  return result;
227 }
228 
237 PP_INLINE struct PP_Var PP_MakeInt32(int32_t value) {
238  struct PP_Var result = { PP_VARTYPE_INT32, 0, {PP_FALSE} };
239  result.value.as_int = value;
240  return result;
241 }
242 
251 PP_INLINE struct PP_Var PP_MakeDouble(double value) {
252  struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} };
253  result.value.as_double = value;
254  return result;
255 }
260 #endif /* PPAPI_C_PP_VAR_H_ */
261 
PP_INLINE struct PP_Var PP_MakeInt32(int32_t value)
Definition: pp_var.h:237
PP_Bool as_bool
Definition: pp_var.h:127
PP_INLINE struct PP_Var PP_MakeNull(void)
Definition: pp_var.h:209
Definition: pp_var.h:121
Definition: pp_var.h:47
Definition: pp_var.h:73
int32_t padding
Definition: pp_var.h:174
PP_VarType
Definition: pp_var.h:30
int32_t as_int
Definition: pp_var.h:133
int64_t as_id
Definition: pp_var.h:149
union PP_VarValue value
Definition: pp_var.h:180
Definition: pp_var.h:34
PP_INLINE struct PP_Var PP_MakeDouble(double value)
Definition: pp_var.h:251
double as_double
Definition: pp_var.h:139
Definition: pp_var.h:166
PP_INLINE struct PP_Var PP_MakeUndefined(void)
Definition: pp_var.h:198
Definition: pp_var.h:59
Definition: pp_var.h:39
PP_Bool
Definition: pp_bool.h:30
PP_INLINE struct PP_Var PP_MakeBool(PP_Bool value)
Definition: pp_var.h:223
Definition: pp_var.h:43
Definition: pp_var.h:52
Definition: pp_var.h:90
Definition: pp_var.h:81
Definition: pp_var.h:106
Definition: pp_var.h:66