2 * Copyright (c) 2011 The Chromium Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
8 * This file will test that the pnacl-generated wrapper functions match
9 * the comments in this IDL.
24 [passByValue
, returnByValue
] struct some_struct
{
34 [union, passByValue
, returnByValue
] struct some_union
{
41 * Pnacl_M15_PPB_Iface_struct_wrap_foo1(int32_t a, struct some_struct* b) {
42 * const struct PPB_Iface_struct_wrap_2_0 *iface =
43 * Pnacl_WrapperInfo_PPB_Iface_struct_wrap_2_0.real_iface;
44 * return iface->foo1(a, *b);
48 interface PPB_Iface_struct_wrap
{
49 int32_t foo1
(int32_t a
, [in] some_struct b
);
54 * Pnacl_M15_PPB_Iface_union_wrap_foo1(int32_t a, union some_union* b) {
55 * const struct PPB_Iface_union_wrap_2_0 *iface =
56 * Pnacl_WrapperInfo_PPB_Iface_union_wrap_2_0.real_iface;
57 * return iface->foo1(a, *b);
61 interface PPB_Iface_union_wrap
{
62 int32_t foo1
(int32_t a
, [in] some_union b
);
67 interface PPB_Iface_nowrap
{
68 int32_t foo1
(int32_t a
, [in] some_struct2 b
);
74 * int32_t Pnacl_M13_PPB_SomeWrap_foo1(struct some_struct* a) {
75 * const struct PPB_SomeWrap_0_0 *iface =
76 * Pnacl_WrapperInfo_PPB_SomeWrap_0_0.real_iface;
77 * return iface->foo1(*a);
81 * void Pnacl_M13_PPB_SomeWrap_foo2(struct some_struct* _struct_result,
83 * const struct PPB_SomeWrap_0_0 *iface =
84 * Pnacl_WrapperInfo_PPB_SomeWrap_0_0.real_iface;
85 * *_struct_result = iface->foo2(a);
89 interface PPB_SomeWrap
{
90 int32_t foo1
([in] some_struct a
);
91 some_struct foo2
([in] int32_t a
);
93 /* Not generating wrapper methods for PPB_SomeWrap_1_0 */
95 int32_t foo1
([in] some_struct
[] a
);
97 void foo2
([in] int32_t a
, [out] some_struct b
);
99 /* Not generating wrapper methods for PPB_SomeWrap */
101 int32_t foo1
([in] some_struct2 a
);
106 * static int32_t Pnacl_M13_PPP_SomeWrap_foo1(struct some_struct a) {
107 * const struct PPP_SomeWrap_0_0 *iface =
108 * Pnacl_WrapperInfo_PPP_SomeWrap_0_0.real_iface;
109 * int32_t (*temp_fp)(struct some_struct* a) =
110 * ((int32_t (*)(struct some_struct* a))iface->foo1);
111 * return temp_fp(&a);
114 * static struct some_struct Pnacl_M13_PPP_SomeWrap_foo2(int32_t a) {
115 * const struct PPP_SomeWrap_0_0 *iface =
116 * Pnacl_WrapperInfo_PPP_SomeWrap_0_0.real_iface;
117 * void (*temp_fp)(struct some_struct* _struct_result, int32_t a) =
118 * ((void (*)(struct some_struct* _struct_result, int32_t a))iface->foo2);
119 * struct some_struct _struct_result;
120 * temp_fp(&_struct_result, a);
121 * return _struct_result;
124 * static struct some_struct Pnacl_M14_PPP_SomeWrap_foo2(int32_t a) {
125 * const struct PPP_SomeWrap_1_0 *iface =
126 * Pnacl_WrapperInfo_PPP_SomeWrap_1_0.real_iface;
127 * void (*temp_fp)(struct some_struct* _struct_result, int32_t a) =
128 * ((void (*)(struct some_struct* _struct_result, int32_t a))iface->foo2);
129 * struct some_struct _struct_result;
130 * temp_fp(&_struct_result, a);
131 * return _struct_result;
134 * static int32_t Pnacl_M14_PPP_SomeWrap_foo1(const struct some_struct a[]) {
135 * const struct PPP_SomeWrap_1_0 *iface =
136 * Pnacl_WrapperInfo_PPP_SomeWrap_1_0.real_iface;
137 * int32_t (*temp_fp)(const struct some_struct a[]) =
138 * ((int32_t (*)(const struct some_struct a[]))iface->foo1);
143 interface PPP_SomeWrap
{
144 int32_t foo1
([in] some_struct a
);
145 some_struct foo2
([in] int32_t a
);
148 int32_t foo1
([in] some_struct
[] a
);
150 /* Not generating wrapper interface for PPP_SomeWrap */
152 int32_t foo1
([in] some_struct2 a
);
154 void foo2
([in] int32_t a
);
157 [no_interface_string
]
158 interface PPP_NoIFString
{
159 int32_t Dummy
([in] some_struct a
);