~ubuntu-branches/debian/squeeze/protobuf/squeeze

« back to all changes in this revision

Viewing changes to src/google/protobuf/descriptor.proto

  • Committer: Bazaar Package Importer
  • Author(s): Julien Cristau
  • Date: 2009-06-02 16:19:00 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090602161900-vm176i3ryt35yk91
Tags: 2.0.3-2.2
* Non-maintainer upload.
* Fix FTBFS from -2.1: don't fail when we can't clean up the java build,
  such as when openjdk isn't installed.
* Disable parallel builds, because libtool is made of fail (if binary-arch
  and build-indep run concurrently, we relink a library while it's being
  used; that doesn't work so well).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// Protocol Buffers - Google's data interchange format
2
 
// Copyright 2008 Google Inc.
 
2
// Copyright 2008 Google Inc.  All rights reserved.
3
3
// http://code.google.com/p/protobuf/
4
4
//
5
 
// Licensed under the Apache License, Version 2.0 (the "License");
6
 
// you may not use this file except in compliance with the License.
7
 
// You may obtain a copy of the License at
8
 
//
9
 
//      http://www.apache.org/licenses/LICENSE-2.0
10
 
//
11
 
// Unless required by applicable law or agreed to in writing, software
12
 
// distributed under the License is distributed on an "AS IS" BASIS,
13
 
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 
// See the License for the specific language governing permissions and
15
 
// limitations under the License.
 
5
// Redistribution and use in source and binary forms, with or without
 
6
// modification, are permitted provided that the following conditions are
 
7
// met:
 
8
//
 
9
//     * Redistributions of source code must retain the above copyright
 
10
// notice, this list of conditions and the following disclaimer.
 
11
//     * Redistributions in binary form must reproduce the above
 
12
// copyright notice, this list of conditions and the following disclaimer
 
13
// in the documentation and/or other materials provided with the
 
14
// distribution.
 
15
//     * Neither the name of Google Inc. nor the names of its
 
16
// contributors may be used to endorse or promote products derived from
 
17
// this software without specific prior written permission.
 
18
//
 
19
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
20
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
21
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 
22
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 
23
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 
24
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 
25
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 
26
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 
27
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 
28
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 
29
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16
30
 
17
31
// Author: kenton@google.com (Kenton Varda)
18
32
//  Based on original Protocol Buffers design by
32
46
// algorithms don't work during bootstrapping.
33
47
option optimize_for = SPEED;
34
48
 
 
49
// The protocol compiler can output a FileDescriptorSet containing the .proto
 
50
// files it parses.
 
51
message FileDescriptorSet {
 
52
  repeated FileDescriptorProto file = 1;
 
53
}
 
54
 
35
55
// Describes a complete .proto file.
36
56
message FileDescriptorProto {
37
57
  optional string name = 1;       // file name, relative to root of source tree
179
199
// Each of the definitions above may have "options" attached.  These are
180
200
// just annotations which may cause code to be generated slightly differently
181
201
// or may contain hints for code that manipulates protocol messages.
 
202
//
 
203
// Clients may define custom options as extensions of the *Options messages.
 
204
// These extensions may not yet be known at parsing time, so the parser cannot
 
205
// store the values in them.  Instead it stores them in a field in the *Options
 
206
// message called uninterpreted_option. This field must have the same name
 
207
// across all *Options messages. We then use this field to populate the
 
208
// extensions when we build a descriptor, at which point all protos have been
 
209
// parsed and so all extensions are known.
 
210
//
 
211
// Extension numbers for custom options may be chosen as follows:
 
212
// * For options which will only be used within a single application or
 
213
//   organization, or for experimental options, use field numbers 50000
 
214
//   through 99999.  It is up to you to ensure that you do not use the
 
215
//   same number for multiple options.
 
216
// * For options which will be published and used publicly by multiple
 
217
//   independent entities, e-mail kenton@google.com to reserve extension
 
218
//   numbers.  Simply tell me how many you need and I'll send you back a
 
219
//   set of numbers to use -- there's no need to explain how you intend to
 
220
//   use them.  If this turns out to be popular, a web service will be set up
 
221
//   to automatically assign option numbers.
182
222
 
183
 
// TODO(kenton):  Allow extensions to options.
184
223
 
185
224
message FileOptions {
186
225
 
212
251
    CODE_SIZE = 2;  // Use ReflectionOps to implement these methods.
213
252
  }
214
253
  optional OptimizeMode optimize_for = 9 [default=CODE_SIZE];
 
254
 
 
255
 
 
256
  // The parser stores options it doesn't recognize here. See above.
 
257
  repeated UninterpretedOption uninterpreted_option = 999;
 
258
 
 
259
  // Clients can define custom options in extensions of this message. See above.
 
260
  extensions 1000 to max;
215
261
}
216
262
 
217
263
message MessageOptions {
234
280
  // Because this is an option, the above two restrictions are not enforced by
235
281
  // the protocol compiler.
236
282
  optional bool message_set_wire_format = 1 [default=false];
 
283
 
 
284
  // The parser stores options it doesn't recognize here. See above.
 
285
  repeated UninterpretedOption uninterpreted_option = 999;
 
286
 
 
287
  // Clients can define custom options in extensions of this message. See above.
 
288
  extensions 1000 to max;
237
289
}
238
290
 
239
291
message FieldOptions {
261
313
  // In this situation, the map key for Item will be set to "name".
262
314
  // TODO: Fully-implement this, then remove the "experimental_" prefix.
263
315
  optional string experimental_map_key = 9;
 
316
 
 
317
  // The parser stores options it doesn't recognize here. See above.
 
318
  repeated UninterpretedOption uninterpreted_option = 999;
 
319
 
 
320
  // Clients can define custom options in extensions of this message. See above.
 
321
  extensions 1000 to max;
264
322
}
265
323
 
266
324
message EnumOptions {
 
325
  // The parser stores options it doesn't recognize here. See above.
 
326
  repeated UninterpretedOption uninterpreted_option = 999;
 
327
 
 
328
  // Clients can define custom options in extensions of this message. See above.
 
329
  extensions 1000 to max;
267
330
}
268
331
 
269
332
message EnumValueOptions {
 
333
  // The parser stores options it doesn't recognize here. See above.
 
334
  repeated UninterpretedOption uninterpreted_option = 999;
 
335
 
 
336
  // Clients can define custom options in extensions of this message. See above.
 
337
  extensions 1000 to max;
270
338
}
271
339
 
272
340
message ServiceOptions {
275
343
  //   framework.  We apologize for hoarding these numbers to ourselves, but
276
344
  //   we were already using them long before we decided to release Protocol
277
345
  //   Buffers.
 
346
 
 
347
  // The parser stores options it doesn't recognize here. See above.
 
348
  repeated UninterpretedOption uninterpreted_option = 999;
 
349
 
 
350
  // Clients can define custom options in extensions of this message. See above.
 
351
  extensions 1000 to max;
278
352
}
279
353
 
280
354
message MethodOptions {
283
357
  //   framework.  We apologize for hoarding these numbers to ourselves, but
284
358
  //   we were already using them long before we decided to release Protocol
285
359
  //   Buffers.
 
360
 
 
361
  // The parser stores options it doesn't recognize here. See above.
 
362
  repeated UninterpretedOption uninterpreted_option = 999;
 
363
 
 
364
  // Clients can define custom options in extensions of this message. See above.
 
365
  extensions 1000 to max;
 
366
}
 
367
 
 
368
// A message representing a option the parser does not recognize. This only
 
369
// appears in options protos created by the compiler::Parser class.
 
370
// DescriptorPool resolves these when building Descriptor objects. Therefore,
 
371
// options protos in descriptor objects (e.g. returned by Descriptor::options(),
 
372
// or produced by Descriptor::CopyTo()) will never have UninterpretedOptions
 
373
// in them.
 
374
message UninterpretedOption {
 
375
  // The name of the uninterpreted option.  Each string represents a segment in
 
376
  // a dot-separated name.  is_extension is true iff a segment represents an
 
377
  // extension (denoted with parentheses in options specs in .proto files).
 
378
  // E.g.,{ ["foo", false], ["bar.baz", true], ["qux", false] } represents
 
379
  // "foo.(bar.baz).qux".
 
380
  message NamePart {
 
381
    required string name_part = 1;
 
382
    required bool is_extension = 2;
 
383
  }
 
384
  repeated NamePart name = 2;
 
385
 
 
386
  // The value of the uninterpreted option, in whatever type the tokenizer
 
387
  // identified it as during parsing. Exactly one of these should be set.
 
388
  optional string identifier_value = 3;
 
389
  optional uint64 positive_int_value = 4;
 
390
  optional int64 negative_int_value = 5;
 
391
  optional double double_value = 6;
 
392
  optional bytes string_value = 7;
286
393
}