xref: /aosp_15_r20/external/nanopb-c/tests/cyclic_messages/cyclic.proto (revision c8d645cafcee3f91213d30caa0fe303887010b9b)
1// Test structures with cyclic references.
2// These can only be handled in pointer/callback mode,
3// see associated .options files.
4
5syntax = "proto2";
6
7message TreeNode
8{
9    optional int32 leaf = 1;
10    optional TreeNode left = 2;
11    optional TreeNode right = 3;
12}
13
14message Dictionary
15{
16    repeated KeyValuePair dictItem = 1;
17}
18
19message KeyValuePair
20{
21    required string key = 1;
22    optional string stringValue = 2;
23    optional int32 intValue = 3;
24    optional Dictionary dictValue = 4;
25    optional TreeNode treeValue = 5;
26}
27
28