// This file is part of Protocol Buffers for CHICKEN // Copyright (c) 2013 by Thomas Chust. All rights reserved. // // Permission is hereby granted, free of charge, to any person // obtaining a copy of this software and associated documentation // files (the Software), to deal in the Software without restriction, // including without limitation the rights to use, copy, modify, // merge, publish, distribute, sublicense, and/or sell copies of the // Software, and to permit persons to whom the Software is furnished // to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS // BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. package extend.protobuf.chicken; import "extend/protobuf/bigint.proto"; // Generic value container. To allow streaming, exactly a single // field must be set. message Value { enum Special { VOID = 1; NULL = 2; EOF = 3; FALSE = 4; TRUE = 5; } optional Special special = 1; optional uint32 char = 2; optional sint64 fixnum = 3; optional Complex number = 5; optional string string = 6; optional Symbol symbol = 7; optional Pair pair = 8; optional Vector vector = 9; optional HashTable hash_table = 10; optional Procedure procedure = 11; optional string lambda_info = 12; optional bytes u8vector = 16; optional bytes s8vector = 17; repeated uint32 u16vector = 18 [packed = true]; repeated sint32 s16vector = 19 [packed = true]; repeated uint32 u32vector = 20 [packed = true]; repeated sint32 s32vector = 21 [packed = true]; repeated uint64 u64vector = 22 [packed = true]; repeated sint64 s64vector = 23 [packed = true]; repeated float f32vector = 24 [packed = true]; repeated double f64vector = 25 [packed = true]; optional bytes blob = 26; optional Custom custom = 13; optional Vector record = 14; optional uint64 shared = 15; } // Arbitrary precision real numeric value. Either numer or flonum should be set. message Real { optional sint64 numer = 1 [(extend.protobuf.max_size) = 0]; optional sint64 denom = 2 [default = 1, (extend.protobuf.max_size) = 0]; optional double flonum = 3; } // Arbitrary precision complex numeric value. message Complex { optional Real real = 1; optional Real imag = 2; } // Symbol or keyword. message Symbol { enum Type { INTERNED = 1; UNINTERNED = 2; KEYWORD = 3; } required string id = 1; optional Type type = 2 [default = INTERNED]; } // Pair of values. message Pair { required Value car = 1; required Value cdr = 2; } // Vector of generic values. message Vector { repeated Value slot = 1; } // Associative array of generic keys and values. In order to maintain // stability of reference numbers, (de-)serialization routines always // process the test, hash and initial values before all slot values in // sequence. The pairs constituting the slots are not tracked with // reference numbers. message HashTable { repeated Pair slot = 1; optional Value test = 2; // default = equal? optional Value hash = 3; // default = equal?-hash optional double min_load = 4 [default = 0.5]; optional double max_load = 5 [default = 0.8]; optional bool weak_keys = 6 [default = false]; // for future extensions optional bool weak_values = 7 [default = false]; // for future extensions optional Value initial = 8; // default = #f } // Closure with generic upvalues and code identifier. message Procedure { repeated Value slot = 1; required string id = 2; } // Custom serialized value. In order to maintain stability of // reference numbers, (de-)serialization always processes the custom // reader before the custom data. message Custom { required bytes data = 1; optional Value reader = 2; }