| // Copyright 2019 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 llcpptest.protocol.test; |
| |
| using zx; |
| |
| type MyError = strict enum : int32 { |
| BAD_ERROR = 1; |
| REALLY_BAD_ERROR = 2; |
| }; |
| |
| type HandleStruct = resource struct { |
| h zx.handle:EVENT; |
| }; |
| |
| type VectorStruct = resource struct { |
| v vector<HandleStruct>; |
| }; |
| |
| type HandleTable = resource table { |
| 1: h zx.handle:EVENT; |
| }; |
| |
| type HandleUnion = strict resource union { |
| 1: h zx.handle:EVENT; |
| }; |
| |
| type HandleUnionStruct = resource struct { |
| u HandleUnion; |
| }; |
| |
| protocol Frobinator { |
| Frob(struct { |
| value string; |
| }); |
| Grob(struct { |
| value string; |
| }) -> (struct { |
| value string; |
| }); |
| -> Hrob(struct { |
| value string; |
| }); |
| TwoWayEmptyArg() -> (); |
| }; |
| |
| protocol HandleProvider { |
| GetHandle() -> (resource struct { |
| value HandleStruct; |
| }); |
| GetHandleVector(struct { |
| count uint32; |
| }) -> (resource struct { |
| value vector<HandleStruct>; |
| }); |
| GetHandleUnion() -> (resource struct { |
| value HandleUnionStruct; |
| }); |
| SwapHandle(HandleTable) -> (HandleUnion); |
| }; |
| |
| protocol EnumMethods { |
| SendEnum(struct { |
| e MyError; |
| }); |
| GetEnum() -> (struct { |
| e MyError; |
| }); |
| }; |