/** Copyright (c) 2010 Scott A. Crosby. <scott@sacrosby.com>

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 "AS IS", 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.

*/

syntax = "proto2";

option java_package = "crosby.binary";
package OSMPBF;

//protoc --java_out=../.. fileformat.proto


//
//  STORAGE LAYER: Storing primitives.
//

message Blob {
  optional int32 raw_size = 2; // When compressed, the uncompressed size

  oneof data {
    bytes raw = 1; // No compression

    // Possible compressed versions of the data.
    bytes zlib_data = 3;

    // For LZMA compressed data (optional)
    bytes lzma_data = 4;

    // Formerly used for bzip2 compressed data. Deprecated in 2010.
    bytes OBSOLETE_bzip2_data = 5 [deprecated = true]; // Don't reuse this tag number.

    // For LZ4 compressed data (optional)
    bytes lz4_data = 6;

    // For ZSTD compressed data (optional)
    bytes zstd_data = 7;
  }
}

/* A file contains an sequence of fileblock headers, each prefixed by
their length in network byte order, followed by a data block
containing the actual data. Types starting with a "_" are reserved.
*/

message BlobHeader {
  required string type = 1;
  optional bytes indexdata = 2;
  required int32 datasize = 3;
}

