106f6ba60Sopenharmony_ci/* 206f6ba60Sopenharmony_ci * Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved. 306f6ba60Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 406f6ba60Sopenharmony_ci * you may not use this file except in compliance with the License. 506f6ba60Sopenharmony_ci * You may obtain a copy of the License at 606f6ba60Sopenharmony_ci * 706f6ba60Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 806f6ba60Sopenharmony_ci * 906f6ba60Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1006f6ba60Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1106f6ba60Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1206f6ba60Sopenharmony_ci * See the License for the specific language governing permissions and 1306f6ba60Sopenharmony_ci * limitations under the License. 1406f6ba60Sopenharmony_ci */ 1506f6ba60Sopenharmony_ci 1606f6ba60Sopenharmony_cisyntax = "proto3"; 1706f6ba60Sopenharmony_ci 1806f6ba60Sopenharmony_cioption optimize_for = LITE_RUNTIME; 1906f6ba60Sopenharmony_ci 2006f6ba60Sopenharmony_cienum NUM { 2106f6ba60Sopenharmony_ci ZERO = 0; 2206f6ba60Sopenharmony_ci ONE = 1; 2306f6ba60Sopenharmony_ci TWO = 2; 2406f6ba60Sopenharmony_ci THREE = 3; 2506f6ba60Sopenharmony_ci FOUR = 4; 2606f6ba60Sopenharmony_ci} 2706f6ba60Sopenharmony_ci 2806f6ba60Sopenharmony_cimessage SubMessage { 2906f6ba60Sopenharmony_ci int32 vint_int32 = 1; 3006f6ba60Sopenharmony_ci int64 vint_int64 = 2; 3106f6ba60Sopenharmony_ci uint32 vint_uint32 = 3; 3206f6ba60Sopenharmony_ci uint64 vint_uint64 = 4; 3306f6ba60Sopenharmony_ci} 3406f6ba60Sopenharmony_ci 3506f6ba60Sopenharmony_cimessage ExampleMessage { 3606f6ba60Sopenharmony_ci // https://developers.google.com/protocol-buffers/docs/encoding 3706f6ba60Sopenharmony_ci // ID Name Used For 3806f6ba60Sopenharmony_ci // 0 VARINT int32, int64, uint32, uint64, sint32, sint64, bool, enum 3906f6ba60Sopenharmony_ci int32 vint_int32 = 1; 4006f6ba60Sopenharmony_ci int64 vint_int64 = 2; 4106f6ba60Sopenharmony_ci uint32 vint_uint32 = 3; 4206f6ba60Sopenharmony_ci uint64 vint_uint64 = 4; 4306f6ba60Sopenharmony_ci sint32 vint_sint32 = 5; 4406f6ba60Sopenharmony_ci sint64 vint_sint64 = 6; 4506f6ba60Sopenharmony_ci bool vint_bool = 7; 4606f6ba60Sopenharmony_ci NUM vint_enum = 8; 4706f6ba60Sopenharmony_ci 4806f6ba60Sopenharmony_ci // 1 I64 fixed64, sfixed64, double 4906f6ba60Sopenharmony_ci fixed64 I64_fixed64 = 11; 5006f6ba60Sopenharmony_ci sfixed64 I64_sfixed64 = 12; 5106f6ba60Sopenharmony_ci double I64_double = 13; 5206f6ba60Sopenharmony_ci 5306f6ba60Sopenharmony_ci // 2 LEN string, bytes, embedded messages, packed repeated fields 5406f6ba60Sopenharmony_ci string LEN_string = 21; 5506f6ba60Sopenharmony_ci bytes LEN_bytes = 22; // maybe need identified by protoC 5606f6ba60Sopenharmony_ci SubMessage LEN_sub = 23; 5706f6ba60Sopenharmony_ci // repeated sint32 repeated_signed_vint = 24; // repeated signed(zigzag) not supported in libprotobuf 5806f6ba60Sopenharmony_ci repeated int32 LEN_repeated_packed_signed_vint = 25; // [packed = true] 5906f6ba60Sopenharmony_ci repeated uint32 LEN_repeated_packed_unsigned_vint = 26; // [packed = true] 6006f6ba60Sopenharmony_ci repeated fixed64 LEN_repeated_packed_fixed = 27; // [packed = true] 6106f6ba60Sopenharmony_ci repeated SubMessage repeated_LEN_sub = 28; 6206f6ba60Sopenharmony_ci 6306f6ba60Sopenharmony_ci // 5 I32 fixed32, sfixed32, float 6406f6ba60Sopenharmony_ci fixed32 I32_fixed32 = 51; 6506f6ba60Sopenharmony_ci sfixed32 I32_sfixed32 = 52; 6606f6ba60Sopenharmony_ci float I32_float = 53; 6706f6ba60Sopenharmony_ci 6806f6ba60Sopenharmony_ci // 6 oneof 6906f6ba60Sopenharmony_ci oneof oneoffield { 7006f6ba60Sopenharmony_ci fixed64 oneof_fixed64 = 61; 7106f6ba60Sopenharmony_ci string oneof_string = 62; 7206f6ba60Sopenharmony_ci SubMessage oneof_sub = 63; 7306f6ba60Sopenharmony_ci } 7406f6ba60Sopenharmony_ci 7506f6ba60Sopenharmony_ci repeated ExampleMessage repeated_Example = 100; 7606f6ba60Sopenharmony_ci 7706f6ba60Sopenharmony_ci} 78