| // Copyright 2020 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| library conformance; |
| |
| // TODO(fxbug.dev/36441): Allow bindings to compile on host with handles. |
| |
| resource struct SingleHandle { |
| handle h; |
| }; |
| |
| resource struct SingleOptionalHandle { |
| handle? h; |
| }; |
| |
| resource struct ArrayOfHandles { |
| array<handle>:3 a; |
| }; |
| |
| resource struct ArrayOfOptionalHandles { |
| array<handle?>:3 a; |
| }; |
| |
| resource struct VectorOfHandles { |
| vector<handle> v; |
| }; |
| |
| resource struct VectorOfOptionalHandles { |
| vector<handle?> v; |
| }; |
| |
| // This is not a reference to library zx to avoid complexity in the test data. |
| // A local handle is defined here that contains subtypes that this test cares |
| // about. |
| enum obj_type : uint32 { |
| NONE = 0; |
| CHANNEL = 4; |
| EVENT = 5; |
| }; |
| |
| resource_definition handle : uint32 { |
| properties { |
| obj_type subtype; |
| }; |
| }; |
| |
| resource struct MultipleHandleSubtypes { |
| handle untyped; |
| handle:EVENT event; |
| handle:CHANNEL channel; |
| }; |
| |
| resource table ReservedFieldTable { |
| 1: reserved; |
| }; |
| |
| resource struct ReservedFieldTableStruct { |
| ReservedFieldTable table; |
| }; |