blob: 7ff524305c6e44b9f1400c9ea1b96af411cbdbcc [file] [log] [blame]
// 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;
};
closed protocol Frobinator {
strict Frob(struct {
value string;
});
strict Grob(struct {
value string;
}) -> (struct {
value string;
});
strict -> Hrob(struct {
value string;
});
strict TwoWayEmptyArg() -> ();
};
closed protocol HandleProvider {
strict GetHandle() -> (resource struct {
value HandleStruct;
});
strict GetHandleVector(struct {
count uint32;
}) -> (resource struct {
value vector<HandleStruct>;
});
strict GetHandleUnion() -> (resource struct {
value HandleUnionStruct;
});
strict SwapHandle(HandleTable) -> (HandleUnion);
};
closed protocol EnumMethods {
strict SendEnum(struct {
e MyError;
});
strict GetEnum() -> (struct {
e MyError;
});
};