| // Copyright 2021 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 test.external; |
| |
| using zx; |
| |
| type StrictButtons = strict bits : uint32 { |
| PLAY = 0b001; |
| PAUSE = 0b010; |
| STOP = 0b100; |
| }; |
| |
| type FlexibleButtons = flexible bits : uint32 { |
| PLAY = 0b001; |
| PAUSE = 0b010; |
| STOP = 0b100; |
| }; |
| |
| type StrictAnimal = strict enum : int32 { |
| DOG = 0; |
| CAT = 1; |
| FROG = 2; |
| }; |
| |
| type FlexibleAnimal = flexible enum : int32 { |
| DOG = 0; |
| CAT = 1; |
| FROG = 2; |
| }; |
| |
| type FlexibleEmptyEnum = flexible enum : int32 {}; |
| |
| type Coordinate = struct { |
| x uint8; |
| y uint8; |
| }; |
| |
| type StrictValueThing = strict union { |
| 1: number uint32; |
| 2: name string; |
| }; |
| |
| type FlexibleValueThing = flexible union { |
| 1: number uint32; |
| 2: name string; |
| }; |
| |
| type StrictResourceThing = strict resource union { |
| 1: number uint32; |
| 2: name string; |
| }; |
| |
| type FlexibleResourceThing = flexible resource union { |
| 1: number uint32; |
| 2: name string; |
| }; |
| |
| type ValueRecord = table { |
| 1: name string; |
| 2: age uint8; |
| }; |
| |
| type ResourceRecord = resource table { |
| 1: name string; |
| 2: age uint8; |
| }; |
| |
| type StructWithHandles = resource struct { |
| v vector<zx.Handle:CHANNEL>; |
| }; |