protobuf/python/google/protobuf/pyext/descriptor.cc
Go to the documentation of this file.
1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved.
3 // https://developers.google.com/protocol-buffers/
4 //
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.
30 
31 // Author: petar@google.com (Petar Petrov)
32 
33 #include <google/protobuf/pyext/descriptor.h>
34 
35 #define PY_SSIZE_T_CLEAN
36 #include <Python.h>
37 #include <frameobject.h>
38 
39 #include <cstdint>
40 #include <string>
41 #include <unordered_map>
42 
43 #include <google/protobuf/io/coded_stream.h>
44 #include <google/protobuf/descriptor.pb.h>
45 #include <google/protobuf/dynamic_message.h>
46 #include <google/protobuf/pyext/descriptor_containers.h>
47 #include <google/protobuf/pyext/descriptor_pool.h>
48 #include <google/protobuf/pyext/message.h>
49 #include <google/protobuf/pyext/message_factory.h>
50 #include <google/protobuf/pyext/scoped_pyobject_ptr.h>
51 #include <google/protobuf/stubs/hash.h>
52 
53 #define PyString_AsStringAndSize(ob, charpp, sizep) \
54  (PyUnicode_Check(ob) ? ((*(charpp) = const_cast<char*>( \
55  PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL \
56  ? -1 \
57  : 0) \
58  : PyBytes_AsStringAndSize(ob, (charpp), (sizep)))
59 
60 namespace google {
61 namespace protobuf {
62 namespace python {
63 
64 // Store interned descriptors, so that the same C++ descriptor yields the same
65 // Python object. Objects are not immortal: this map does not own the
66 // references, and items are deleted when the last reference to the object is
67 // released.
68 // This is enough to support the "is" operator on live objects.
69 // All descriptors are stored here.
70 std::unordered_map<const void*, PyObject*>* interned_descriptors;
71 
73  return PyUnicode_FromStringAndSize(str.c_str(), str.size());
74 }
75 
76 // Check that the calling Python code is the global scope of a _pb2.py module.
77 // This function is used to support the current code generated by the proto
78 // compiler, which creates descriptors, then update some properties.
79 // For example:
80 // message_descriptor = Descriptor(
81 // name='Message',
82 // fields = [FieldDescriptor(name='field')]
83 // message_descriptor.fields[0].containing_type = message_descriptor
84 //
85 // This code is still executed, but the descriptors now have no other storage
86 // than the (const) C++ pointer, and are immutable.
87 // So we let this code pass, by simply ignoring the new value.
88 //
89 // From user code, descriptors still look immutable.
90 //
91 // TODO(amauryfa): Change the proto2 compiler to remove the assignments, and
92 // remove this hack.
93 bool _CalledFromGeneratedFile(int stacklevel) {
94 #ifndef PYPY_VERSION
95  // This check is not critical and is somewhat difficult to implement correctly
96  // in PyPy.
97  PyFrameObject* frame = PyEval_GetFrame();
98  if (frame == NULL) {
99  return false;
100  }
101  while (stacklevel-- > 0) {
102  frame = frame->f_back;
103  if (frame == NULL) {
104  return false;
105  }
106  }
107 
108  if (frame->f_code->co_filename == NULL) {
109  return false;
110  }
111  char* filename;
112  Py_ssize_t filename_size;
113  if (PyString_AsStringAndSize(frame->f_code->co_filename,
114  &filename, &filename_size) < 0) {
115  // filename is not a string.
116  PyErr_Clear();
117  return false;
118  }
119  if ((filename_size < 3) ||
120  (strcmp(&filename[filename_size - 3], ".py") != 0)) {
121  // Cython's stack does not have .py file name and is not at global module
122  // scope.
123  return true;
124  }
125  if (filename_size < 7) {
126  // filename is too short.
127  return false;
128  }
129  if (strcmp(&filename[filename_size - 7], "_pb2.py") != 0) {
130  // Filename is not ending with _pb2.
131  return false;
132  }
133 
134  if (frame->f_globals != frame->f_locals) {
135  // Not at global module scope
136  return false;
137  }
138 #endif
139  return true;
140 }
141 
142 // If the calling code is not a _pb2.py file, raise AttributeError.
143 // To be used in attribute setters.
144 static int CheckCalledFromGeneratedFile(const char* attr_name) {
145  if (_CalledFromGeneratedFile(0)) {
146  return 0;
147  }
148  PyErr_Format(PyExc_AttributeError,
149  "attribute is not writable: %s", attr_name);
150  return -1;
151 }
152 
153 
154 #ifndef PyVarObject_HEAD_INIT
155 #define PyVarObject_HEAD_INIT(type, size) PyObject_HEAD_INIT(type) size,
156 #endif
157 #ifndef Py_TYPE
158 #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
159 #endif
160 
161 
162 // Helper functions for descriptor objects.
163 
164 // A set of templates to retrieve the C++ FileDescriptor of any descriptor.
165 template<class DescriptorClass>
166 const FileDescriptor* GetFileDescriptor(const DescriptorClass* descriptor) {
167  return descriptor->file();
168 }
169 template<>
171  return descriptor;
172 }
173 template<>
175  return descriptor->type()->file();
176 }
177 template<>
179  return descriptor->containing_type()->file();
180 }
181 template<>
183  return descriptor->service()->file();
184 }
185 
186 bool Reparse(
187  PyMessageFactory* message_factory, const Message& from, Message* to) {
188  // Reparse message.
189  std::string serialized;
190  from.SerializeToString(&serialized);
192  reinterpret_cast<const uint8_t*>(serialized.c_str()), serialized.size());
193  input.SetExtensionRegistry(message_factory->pool->pool,
194  message_factory->message_factory);
195  bool success = to->ParseFromCodedStream(&input);
196  if (!success) {
197  return false;
198  }
199  return true;
200 }
201 // Converts options into a Python protobuf, and cache the result.
202 //
203 // This is a bit tricky because options can contain extension fields defined in
204 // the same proto file. In this case the options parsed from the serialized_pb
205 // have unknown fields, and we need to parse them again.
206 //
207 // Always returns a new reference.
208 template<class DescriptorClass>
209 static PyObject* GetOrBuildOptions(const DescriptorClass *descriptor) {
210  // Options are cached in the pool that owns the descriptor.
211  // First search in the cache.
214  std::unordered_map<const void*, PyObject*>* descriptor_options =
215  caching_pool->descriptor_options;
216  if (descriptor_options->find(descriptor) != descriptor_options->end()) {
217  PyObject *value = (*descriptor_options)[descriptor];
218  Py_INCREF(value);
219  return value;
220  }
221 
222  // Similar to the C++ implementation, we return an Options object from the
223  // default (generated) factory, so that client code know that they can use
224  // extensions from generated files:
225  // d.GetOptions().Extensions[some_pb2.extension]
226  //
227  // The consequence is that extensions not defined in the default pool won't
228  // be available. If needed, we could add an optional 'message_factory'
229  // parameter to the GetOptions() function.
230  PyMessageFactory* message_factory =
232 
233  // Build the Options object: get its Python class, and make a copy of the C++
234  // read-only instance.
235  const Message& options(descriptor->options());
236  const Descriptor *message_type = options.GetDescriptor();
238  message_factory, message_type);
239  if (message_class == NULL) {
240  PyErr_Format(PyExc_TypeError, "Could not retrieve class for Options: %s",
241  message_type->full_name().c_str());
242  return NULL;
243  }
244  ScopedPyObjectPtr args(PyTuple_New(0));
246  PyObject_Call(message_class->AsPyObject(), args.get(), NULL));
247  Py_DECREF(message_class);
248  if (value == NULL) {
249  return NULL;
250  }
251  if (!PyObject_TypeCheck(value.get(), CMessage_Type)) {
252  PyErr_Format(PyExc_TypeError, "Invalid class for %s: %s",
253  message_type->full_name().c_str(),
254  Py_TYPE(value.get())->tp_name);
255  return NULL;
256  }
257  CMessage* cmsg = reinterpret_cast<CMessage*>(value.get());
258 
259  const Reflection* reflection = options.GetReflection();
260  const UnknownFieldSet& unknown_fields(reflection->GetUnknownFields(options));
261  if (unknown_fields.empty()) {
262  cmsg->message->CopyFrom(options);
263  } else {
264  // Reparse options string! XXX call cmessage::MergeFromString
265  if (!Reparse(message_factory, options, cmsg->message)) {
266  PyErr_Format(PyExc_ValueError, "Error reparsing Options message");
267  return NULL;
268  }
269  }
270 
271  // Cache the result.
272  Py_INCREF(value.get());
273  (*descriptor_options)[descriptor] = value.get();
274 
275  return value.release();
276 }
277 
278 // Copy the C++ descriptor to a Python message.
279 // The Python message is an instance of descriptor_pb2.DescriptorProto
280 // or similar.
281 template<class DescriptorProtoClass, class DescriptorClass>
282 static PyObject* CopyToPythonProto(const DescriptorClass *descriptor,
283  PyObject *target) {
284  const Descriptor* self_descriptor =
285  DescriptorProtoClass::default_instance().GetDescriptor();
286  CMessage* message = reinterpret_cast<CMessage*>(target);
287  if (!PyObject_TypeCheck(target, CMessage_Type) ||
288  message->message->GetDescriptor() != self_descriptor) {
289  PyErr_Format(PyExc_TypeError, "Not a %s message",
290  self_descriptor->full_name().c_str());
291  return NULL;
292  }
294  DescriptorProtoClass* descriptor_message =
295  static_cast<DescriptorProtoClass*>(message->message);
296  descriptor->CopyTo(descriptor_message);
297  // Custom options might in unknown extensions. Reparse
298  // the descriptor_message. Can't skip reparse when options unknown
299  // fields is empty, because they might in sub descriptors' options.
300  PyMessageFactory* message_factory =
302  if (!Reparse(message_factory, *descriptor_message, descriptor_message)) {
303  PyErr_Format(PyExc_ValueError, "Error reparsing descriptor message");
304  return nullptr;
305  }
306 
307  Py_RETURN_NONE;
308 }
309 
310 // All Descriptors classes share the same memory layout.
311 typedef struct PyBaseDescriptor {
312  PyObject_HEAD
313 
314  // Pointer to the C++ proto2 descriptor.
315  // Like all descriptors, it is owned by the global DescriptorPool.
316  const void* descriptor;
317 
318  // Owned reference to the DescriptorPool, to ensure it is kept alive.
321 
322 
323 // FileDescriptor structure "inherits" from the base descriptor.
324 typedef struct PyFileDescriptor {
326 
327  // The cached version of serialized pb. Either NULL, or a Bytes string.
328  // We own the reference.
329  PyObject *serialized_pb;
331 
332 
333 namespace descriptor {
334 
335 // Creates or retrieve a Python descriptor of the specified type.
336 // Objects are interned: the same descriptor will return the same object if it
337 // was kept alive.
338 // 'was_created' is an optional pointer to a bool, and is set to true if a new
339 // object was allocated.
340 // Always return a new reference.
341 template<class DescriptorClass>
342 PyObject* NewInternedDescriptor(PyTypeObject* type,
343  const DescriptorClass* descriptor,
344  bool* was_created) {
345  if (was_created) {
346  *was_created = false;
347  }
348  if (descriptor == NULL) {
349  PyErr_BadInternalCall();
350  return NULL;
351  }
352 
353  // See if the object is in the map of interned descriptors
356  if (it != interned_descriptors->end()) {
357  GOOGLE_DCHECK(Py_TYPE(it->second) == type);
358  Py_INCREF(it->second);
359  return it->second;
360  }
361  // Create a new descriptor object
362  PyBaseDescriptor* py_descriptor = PyObject_GC_New(
364  if (py_descriptor == NULL) {
365  return NULL;
366  }
367  py_descriptor->descriptor = descriptor;
368 
369  // and cache it.
370  interned_descriptors->insert(
371  std::make_pair(descriptor, reinterpret_cast<PyObject*>(py_descriptor)));
372 
373  // Ensures that the DescriptorPool stays alive.
376  if (pool == NULL) {
377  // Don't DECREF, the object is not fully initialized.
378  PyObject_Del(py_descriptor);
379  return NULL;
380  }
381  Py_INCREF(pool);
382  py_descriptor->pool = pool;
383 
384  PyObject_GC_Track(py_descriptor);
385 
386  if (was_created) {
387  *was_created = true;
388  }
389  return reinterpret_cast<PyObject*>(py_descriptor);
390 }
391 
392 static void Dealloc(PyObject* pself) {
393  PyBaseDescriptor* self = reinterpret_cast<PyBaseDescriptor*>(pself);
394  // Remove from interned dictionary
395  interned_descriptors->erase(self->descriptor);
396  Py_CLEAR(self->pool);
397  Py_TYPE(self)->tp_free(pself);
398 }
399 
400 static int GcTraverse(PyObject* pself, visitproc visit, void* arg) {
401  PyBaseDescriptor* self = reinterpret_cast<PyBaseDescriptor*>(pself);
402  Py_VISIT(self->pool);
403  return 0;
404 }
405 
406 static int GcClear(PyObject* pself) {
407  PyBaseDescriptor* self = reinterpret_cast<PyBaseDescriptor*>(pself);
408  Py_CLEAR(self->pool);
409  return 0;
410 }
411 
412 static PyGetSetDef Getters[] = {
413  {NULL}
414 };
415 
416 PyTypeObject PyBaseDescriptor_Type = {
417  PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME
418  ".DescriptorBase", // tp_name
419  sizeof(PyBaseDescriptor), // tp_basicsize
420  0, // tp_itemsize
421  (destructor)Dealloc, // tp_dealloc
422  0, // tp_print
423  0, // tp_getattr
424  0, // tp_setattr
425  0, // tp_compare
426  0, // tp_repr
427  0, // tp_as_number
428  0, // tp_as_sequence
429  0, // tp_as_mapping
430  0, // tp_hash
431  0, // tp_call
432  0, // tp_str
433  0, // tp_getattro
434  0, // tp_setattro
435  0, // tp_as_buffer
436  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, // tp_flags
437  "Descriptors base class", // tp_doc
438  GcTraverse, // tp_traverse
439  GcClear, // tp_clear
440  0, // tp_richcompare
441  0, // tp_weaklistoffset
442  0, // tp_iter
443  0, // tp_iternext
444  0, // tp_methods
445  0, // tp_members
446  Getters, // tp_getset
447 };
448 
449 } // namespace descriptor
450 
451 const void* PyDescriptor_AsVoidPtr(PyObject* obj) {
452  if (!PyObject_TypeCheck(obj, &descriptor::PyBaseDescriptor_Type)) {
453  PyErr_SetString(PyExc_TypeError, "Not a BaseDescriptor");
454  return NULL;
455  }
456  return reinterpret_cast<PyBaseDescriptor*>(obj)->descriptor;
457 }
458 
459 namespace message_descriptor {
460 
461 // Unchecked accessor to the C++ pointer.
463  return reinterpret_cast<const Descriptor*>(self->descriptor);
464 }
465 
466 static PyObject* GetName(PyBaseDescriptor* self, void *closure) {
467  return PyString_FromCppString(_GetDescriptor(self)->name());
468 }
469 
470 static PyObject* GetFullName(PyBaseDescriptor* self, void *closure) {
471  return PyString_FromCppString(_GetDescriptor(self)->full_name());
472 }
473 
474 static PyObject* GetFile(PyBaseDescriptor *self, void *closure) {
476 }
477 
478 static PyObject* GetConcreteClass(PyBaseDescriptor* self, void *closure) {
479  // Returns the canonical class for the given descriptor.
480  // This is the class that was registered with the primary descriptor pool
481  // which contains this descriptor.
482  // This might not be the one you expect! For example the returned object does
483  // not know about extensions defined in a custom pool.
486  _GetDescriptor(self)->file()->pool())->py_message_factory,
487  _GetDescriptor(self)));
488  Py_XINCREF(concrete_class);
489  return concrete_class->AsPyObject();
490 }
491 
492 static PyObject* GetFieldsByName(PyBaseDescriptor* self, void *closure) {
494 }
495 
497  void *closure) {
499 }
500 
501 static PyObject* GetFieldsByNumber(PyBaseDescriptor* self, void *closure) {
503 }
504 
505 static PyObject* GetFieldsSeq(PyBaseDescriptor* self, void *closure) {
506  return NewMessageFieldsSeq(_GetDescriptor(self));
507 }
508 
509 static PyObject* GetNestedTypesByName(PyBaseDescriptor* self, void *closure) {
511 }
512 
513 static PyObject* GetNestedTypesSeq(PyBaseDescriptor* self, void *closure) {
515 }
516 
517 static PyObject* GetExtensionsByName(PyBaseDescriptor* self, void *closure) {
519 }
520 
521 static PyObject* GetExtensions(PyBaseDescriptor* self, void *closure) {
523 }
524 
525 static PyObject* GetEnumsSeq(PyBaseDescriptor* self, void *closure) {
526  return NewMessageEnumsSeq(_GetDescriptor(self));
527 }
528 
529 static PyObject* GetEnumTypesByName(PyBaseDescriptor* self, void *closure) {
531 }
532 
533 static PyObject* GetEnumValuesByName(PyBaseDescriptor* self, void *closure) {
535 }
536 
537 static PyObject* GetOneofsByName(PyBaseDescriptor* self, void *closure) {
539 }
540 
541 static PyObject* GetOneofsSeq(PyBaseDescriptor* self, void *closure) {
542  return NewMessageOneofsSeq(_GetDescriptor(self));
543 }
544 
545 static PyObject* IsExtendable(PyBaseDescriptor *self, void *closure) {
546  if (_GetDescriptor(self)->extension_range_count() > 0) {
547  Py_RETURN_TRUE;
548  } else {
549  Py_RETURN_FALSE;
550  }
551 }
552 
553 static PyObject* GetExtensionRanges(PyBaseDescriptor *self, void *closure) {
554  const Descriptor* descriptor = _GetDescriptor(self);
555  PyObject* range_list = PyList_New(descriptor->extension_range_count());
556 
557  for (int i = 0; i < descriptor->extension_range_count(); i++) {
558  const Descriptor::ExtensionRange* range = descriptor->extension_range(i);
559  PyObject* start = PyLong_FromLong(range->start);
560  PyObject* end = PyLong_FromLong(range->end);
561  PyList_SetItem(range_list, i, PyTuple_Pack(2, start, end));
562  }
563 
564  return range_list;
565 }
566 
567 static PyObject* GetContainingType(PyBaseDescriptor *self, void *closure) {
568  const Descriptor* containing_type =
569  _GetDescriptor(self)->containing_type();
570  if (containing_type) {
572  } else {
573  Py_RETURN_NONE;
574  }
575 }
576 
577 static int SetContainingType(PyBaseDescriptor *self, PyObject *value,
578  void *closure) {
579  return CheckCalledFromGeneratedFile("containing_type");
580 }
581 
582 static PyObject* GetHasOptions(PyBaseDescriptor *self, void *closure) {
583  const MessageOptions& options(_GetDescriptor(self)->options());
585  Py_RETURN_TRUE;
586  } else {
587  Py_RETURN_FALSE;
588  }
589 }
590 static int SetHasOptions(PyBaseDescriptor *self, PyObject *value,
591  void *closure) {
592  return CheckCalledFromGeneratedFile("has_options");
593 }
594 
595 static PyObject* GetOptions(PyBaseDescriptor *self) {
596  return GetOrBuildOptions(_GetDescriptor(self));
597 }
598 
599 static int SetOptions(PyBaseDescriptor *self, PyObject *value,
600  void *closure) {
601  return CheckCalledFromGeneratedFile("_options");
602 }
603 
604 static int SetSerializedOptions(PyBaseDescriptor *self, PyObject *value,
605  void *closure) {
606  return CheckCalledFromGeneratedFile("_serialized_options");
607 }
608 
609 static PyObject* CopyToProto(PyBaseDescriptor *self, PyObject *target) {
610  return CopyToPythonProto<DescriptorProto>(_GetDescriptor(self), target);
611 }
612 
613 static PyObject* EnumValueName(PyBaseDescriptor *self, PyObject *args) {
614  const char *enum_name;
615  int number;
616  if (!PyArg_ParseTuple(args, "si", &enum_name, &number))
617  return NULL;
618  const EnumDescriptor *enum_type =
619  _GetDescriptor(self)->FindEnumTypeByName(enum_name);
620  if (enum_type == NULL) {
621  PyErr_SetString(PyExc_KeyError, enum_name);
622  return NULL;
623  }
624  const EnumValueDescriptor *enum_value =
625  enum_type->FindValueByNumber(number);
626  if (enum_value == NULL) {
627  PyErr_Format(PyExc_KeyError, "%d", number);
628  return NULL;
629  }
630  return PyString_FromCppString(enum_value->name());
631 }
632 
633 static PyObject* GetSyntax(PyBaseDescriptor *self, void *closure) {
634  return PyUnicode_InternFromString(
636 }
637 
638 static PyGetSetDef Getters[] = {
639  { "name", (getter)GetName, NULL, "Last name"},
640  { "full_name", (getter)GetFullName, NULL, "Full name"},
641  { "_concrete_class", (getter)GetConcreteClass, NULL, "concrete class"},
642  { "file", (getter)GetFile, NULL, "File descriptor"},
643 
644  { "fields", (getter)GetFieldsSeq, NULL, "Fields sequence"},
645  { "fields_by_name", (getter)GetFieldsByName, NULL, "Fields by name"},
646  { "fields_by_camelcase_name", (getter)GetFieldsByCamelcaseName, NULL,
647  "Fields by camelCase name"},
648  { "fields_by_number", (getter)GetFieldsByNumber, NULL, "Fields by number"},
649  { "nested_types", (getter)GetNestedTypesSeq, NULL, "Nested types sequence"},
650  { "nested_types_by_name", (getter)GetNestedTypesByName, NULL,
651  "Nested types by name"},
652  { "extensions", (getter)GetExtensions, NULL, "Extensions Sequence"},
653  { "extensions_by_name", (getter)GetExtensionsByName, NULL,
654  "Extensions by name"},
655  { "extension_ranges", (getter)GetExtensionRanges, NULL, "Extension ranges"},
656  { "enum_types", (getter)GetEnumsSeq, NULL, "Enum sequence"},
657  { "enum_types_by_name", (getter)GetEnumTypesByName, NULL,
658  "Enum types by name"},
659  { "enum_values_by_name", (getter)GetEnumValuesByName, NULL,
660  "Enum values by name"},
661  { "oneofs_by_name", (getter)GetOneofsByName, NULL, "Oneofs by name"},
662  { "oneofs", (getter)GetOneofsSeq, NULL, "Oneofs by name"},
663  { "containing_type", (getter)GetContainingType, (setter)SetContainingType,
664  "Containing type"},
665  { "is_extendable", (getter)IsExtendable, (setter)NULL},
666  { "has_options", (getter)GetHasOptions, (setter)SetHasOptions, "Has Options"},
667  { "_options", (getter)NULL, (setter)SetOptions, "Options"},
668  { "_serialized_options", (getter)NULL, (setter)SetSerializedOptions,
669  "Serialized Options"},
670  { "syntax", (getter)GetSyntax, (setter)NULL, "Syntax"},
671  {NULL}
672 };
673 
674 static PyMethodDef Methods[] = {
675  { "GetOptions", (PyCFunction)GetOptions, METH_NOARGS, },
676  { "CopyToProto", (PyCFunction)CopyToProto, METH_O, },
677  { "EnumValueName", (PyCFunction)EnumValueName, METH_VARARGS, },
678  {NULL}
679 };
680 
681 } // namespace message_descriptor
682 
683 PyTypeObject PyMessageDescriptor_Type = {
684  PyVarObject_HEAD_INIT(&PyType_Type, 0)
685  FULL_MODULE_NAME ".MessageDescriptor", // tp_name
686  sizeof(PyBaseDescriptor), // tp_basicsize
687  0, // tp_itemsize
688  0, // tp_dealloc
689  0, // tp_print
690  0, // tp_getattr
691  0, // tp_setattr
692  0, // tp_compare
693  0, // tp_repr
694  0, // tp_as_number
695  0, // tp_as_sequence
696  0, // tp_as_mapping
697  0, // tp_hash
698  0, // tp_call
699  0, // tp_str
700  0, // tp_getattro
701  0, // tp_setattro
702  0, // tp_as_buffer
703  Py_TPFLAGS_DEFAULT, // tp_flags
704  "A Message Descriptor", // tp_doc
705  0, // tp_traverse
706  0, // tp_clear
707  0, // tp_richcompare
708  0, // tp_weaklistoffset
709  0, // tp_iter
710  0, // tp_iternext
711  message_descriptor::Methods, // tp_methods
712  0, // tp_members
713  message_descriptor::Getters, // tp_getset
714  &descriptor::PyBaseDescriptor_Type, // tp_base
715 };
716 
718  const Descriptor* message_descriptor) {
720  &PyMessageDescriptor_Type, message_descriptor, NULL);
721 }
722 
724  if (!PyObject_TypeCheck(obj, &PyMessageDescriptor_Type)) {
725  PyErr_SetString(PyExc_TypeError, "Not a MessageDescriptor");
726  return NULL;
727  }
728  return reinterpret_cast<const Descriptor*>(
729  reinterpret_cast<PyBaseDescriptor*>(obj)->descriptor);
730 }
731 
732 namespace field_descriptor {
733 
734 // Unchecked accessor to the C++ pointer.
736  PyBaseDescriptor *self) {
737  return reinterpret_cast<const FieldDescriptor*>(self->descriptor);
738 }
739 
740 static PyObject* GetFullName(PyBaseDescriptor* self, void *closure) {
741  return PyString_FromCppString(_GetDescriptor(self)->full_name());
742 }
743 
744 static PyObject* GetName(PyBaseDescriptor *self, void *closure) {
745  return PyString_FromCppString(_GetDescriptor(self)->name());
746 }
747 
748 static PyObject* GetCamelcaseName(PyBaseDescriptor* self, void *closure) {
749  return PyString_FromCppString(_GetDescriptor(self)->camelcase_name());
750 }
751 
752 static PyObject* GetJsonName(PyBaseDescriptor* self, void *closure) {
753  return PyString_FromCppString(_GetDescriptor(self)->json_name());
754 }
755 
756 static PyObject* GetFile(PyBaseDescriptor *self, void *closure) {
758 }
759 
760 static PyObject* GetType(PyBaseDescriptor *self, void *closure) {
761  return PyLong_FromLong(_GetDescriptor(self)->type());
762 }
763 
764 static PyObject* GetCppType(PyBaseDescriptor *self, void *closure) {
765  return PyLong_FromLong(_GetDescriptor(self)->cpp_type());
766 }
767 
768 static PyObject* GetLabel(PyBaseDescriptor *self, void *closure) {
769  return PyLong_FromLong(_GetDescriptor(self)->label());
770 }
771 
772 static PyObject* GetNumber(PyBaseDescriptor *self, void *closure) {
773  return PyLong_FromLong(_GetDescriptor(self)->number());
774 }
775 
776 static PyObject* GetIndex(PyBaseDescriptor *self, void *closure) {
777  return PyLong_FromLong(_GetDescriptor(self)->index());
778 }
779 
780 static PyObject* GetID(PyBaseDescriptor *self, void *closure) {
781  return PyLong_FromVoidPtr(self);
782 }
783 
784 static PyObject* IsExtension(PyBaseDescriptor *self, void *closure) {
785  return PyBool_FromLong(_GetDescriptor(self)->is_extension());
786 }
787 
788 static PyObject* HasDefaultValue(PyBaseDescriptor *self, void *closure) {
789  return PyBool_FromLong(_GetDescriptor(self)->has_default_value());
790 }
791 
792 static PyObject* GetDefaultValue(PyBaseDescriptor *self, void *closure) {
793  PyObject *result;
794 
795  if (_GetDescriptor(self)->is_repeated()) {
796  return PyList_New(0);
797  }
798 
799 
800  switch (_GetDescriptor(self)->cpp_type()) {
802  int32_t value = _GetDescriptor(self)->default_value_int32();
803  result = PyLong_FromLong(value);
804  break;
805  }
807  int64_t value = _GetDescriptor(self)->default_value_int64();
808  result = PyLong_FromLongLong(value);
809  break;
810  }
812  uint32_t value = _GetDescriptor(self)->default_value_uint32();
813  result = PyLong_FromSsize_t(value);
814  break;
815  }
817  uint64_t value = _GetDescriptor(self)->default_value_uint64();
818  result = PyLong_FromUnsignedLongLong(value);
819  break;
820  }
822  float value = _GetDescriptor(self)->default_value_float();
823  result = PyFloat_FromDouble(value);
824  break;
825  }
827  double value = _GetDescriptor(self)->default_value_double();
828  result = PyFloat_FromDouble(value);
829  break;
830  }
832  bool value = _GetDescriptor(self)->default_value_bool();
833  result = PyBool_FromLong(value);
834  break;
835  }
837  const std::string& value = _GetDescriptor(self)->default_value_string();
839  break;
840  }
842  const EnumValueDescriptor* value =
843  _GetDescriptor(self)->default_value_enum();
844  result = PyLong_FromLong(value->number());
845  break;
846  }
848  Py_RETURN_NONE;
849  break;
850  }
851  default:
852  PyErr_Format(PyExc_NotImplementedError, "default value for %s",
853  _GetDescriptor(self)->full_name().c_str());
854  return NULL;
855  }
856  return result;
857 }
858 
859 static PyObject* GetCDescriptor(PyObject *self, void *closure) {
860  Py_INCREF(self);
861  return self;
862 }
863 
864 static PyObject *GetEnumType(PyBaseDescriptor *self, void *closure) {
865  const EnumDescriptor* enum_type = _GetDescriptor(self)->enum_type();
866  if (enum_type) {
868  } else {
869  Py_RETURN_NONE;
870  }
871 }
872 
873 static int SetEnumType(PyBaseDescriptor *self, PyObject *value, void *closure) {
874  return CheckCalledFromGeneratedFile("enum_type");
875 }
876 
877 static PyObject *GetMessageType(PyBaseDescriptor *self, void *closure) {
878  const Descriptor* message_type = _GetDescriptor(self)->message_type();
879  if (message_type) {
881  } else {
882  Py_RETURN_NONE;
883  }
884 }
885 
886 static int SetMessageType(PyBaseDescriptor *self, PyObject *value,
887  void *closure) {
888  return CheckCalledFromGeneratedFile("message_type");
889 }
890 
891 static PyObject* GetContainingType(PyBaseDescriptor *self, void *closure) {
892  const Descriptor* containing_type =
893  _GetDescriptor(self)->containing_type();
894  if (containing_type) {
896  } else {
897  Py_RETURN_NONE;
898  }
899 }
900 
901 static int SetContainingType(PyBaseDescriptor *self, PyObject *value,
902  void *closure) {
903  return CheckCalledFromGeneratedFile("containing_type");
904 }
905 
906 static PyObject* GetExtensionScope(PyBaseDescriptor *self, void *closure) {
907  const auto* desc = _GetDescriptor(self);
908  const Descriptor* extension_scope =
909  desc->is_extension() ? desc->extension_scope() : nullptr;
910  if (extension_scope) {
911  return PyMessageDescriptor_FromDescriptor(extension_scope);
912  } else {
913  Py_RETURN_NONE;
914  }
915 }
916 
917 static PyObject* GetContainingOneof(PyBaseDescriptor *self, void *closure) {
919  _GetDescriptor(self)->containing_oneof();
920  if (containing_oneof) {
922  } else {
923  Py_RETURN_NONE;
924  }
925 }
926 
927 static int SetContainingOneof(PyBaseDescriptor *self, PyObject *value,
928  void *closure) {
929  return CheckCalledFromGeneratedFile("containing_oneof");
930 }
931 
932 static PyObject* GetHasOptions(PyBaseDescriptor *self, void *closure) {
933  const FieldOptions& options(_GetDescriptor(self)->options());
935  Py_RETURN_TRUE;
936  } else {
937  Py_RETURN_FALSE;
938  }
939 }
940 static int SetHasOptions(PyBaseDescriptor *self, PyObject *value,
941  void *closure) {
942  return CheckCalledFromGeneratedFile("has_options");
943 }
944 
945 static PyObject* GetOptions(PyBaseDescriptor *self) {
946  return GetOrBuildOptions(_GetDescriptor(self));
947 }
948 
949 static int SetOptions(PyBaseDescriptor *self, PyObject *value,
950  void *closure) {
951  return CheckCalledFromGeneratedFile("_options");
952 }
953 
954 static int SetSerializedOptions(PyBaseDescriptor *self, PyObject *value,
955  void *closure) {
956  return CheckCalledFromGeneratedFile("_serialized_options");
957 }
958 
959 static PyGetSetDef Getters[] = {
960  { "full_name", (getter)GetFullName, NULL, "Full name"},
961  { "name", (getter)GetName, NULL, "Unqualified name"},
962  { "camelcase_name", (getter)GetCamelcaseName, NULL, "Camelcase name"},
963  { "json_name", (getter)GetJsonName, NULL, "Json name"},
964  { "file", (getter)GetFile, NULL, "File Descriptor"},
965  { "type", (getter)GetType, NULL, "C++ Type"},
966  { "cpp_type", (getter)GetCppType, NULL, "C++ Type"},
967  { "label", (getter)GetLabel, NULL, "Label"},
968  { "number", (getter)GetNumber, NULL, "Number"},
969  { "index", (getter)GetIndex, NULL, "Index"},
970  { "default_value", (getter)GetDefaultValue, NULL, "Default Value"},
971  { "has_default_value", (getter)HasDefaultValue},
972  { "is_extension", (getter)IsExtension, NULL, "ID"},
973  { "id", (getter)GetID, NULL, "ID"},
974  { "_cdescriptor", (getter)GetCDescriptor, NULL, "HAACK REMOVE ME"},
975 
976  { "message_type", (getter)GetMessageType, (setter)SetMessageType,
977  "Message type"},
978  { "enum_type", (getter)GetEnumType, (setter)SetEnumType, "Enum type"},
979  { "containing_type", (getter)GetContainingType, (setter)SetContainingType,
980  "Containing type"},
981  { "extension_scope", (getter)GetExtensionScope, (setter)NULL,
982  "Extension scope"},
983  { "containing_oneof", (getter)GetContainingOneof, (setter)SetContainingOneof,
984  "Containing oneof"},
985  { "has_options", (getter)GetHasOptions, (setter)SetHasOptions, "Has Options"},
986  { "_options", (getter)NULL, (setter)SetOptions, "Options"},
987  { "_serialized_options", (getter)NULL, (setter)SetSerializedOptions,
988  "Serialized Options"},
989  {NULL}
990 };
991 
992 static PyMethodDef Methods[] = {
993  { "GetOptions", (PyCFunction)GetOptions, METH_NOARGS, },
994  {NULL}
995 };
996 
997 } // namespace field_descriptor
998 
999 PyTypeObject PyFieldDescriptor_Type = {
1000  PyVarObject_HEAD_INIT(&PyType_Type, 0)
1001  FULL_MODULE_NAME ".FieldDescriptor", // tp_name
1002  sizeof(PyBaseDescriptor), // tp_basicsize
1003  0, // tp_itemsize
1004  0, // tp_dealloc
1005  0, // tp_print
1006  0, // tp_getattr
1007  0, // tp_setattr
1008  0, // tp_compare
1009  0, // tp_repr
1010  0, // tp_as_number
1011  0, // tp_as_sequence
1012  0, // tp_as_mapping
1013  0, // tp_hash
1014  0, // tp_call
1015  0, // tp_str
1016  0, // tp_getattro
1017  0, // tp_setattro
1018  0, // tp_as_buffer
1019  Py_TPFLAGS_DEFAULT, // tp_flags
1020  "A Field Descriptor", // tp_doc
1021  0, // tp_traverse
1022  0, // tp_clear
1023  0, // tp_richcompare
1024  0, // tp_weaklistoffset
1025  0, // tp_iter
1026  0, // tp_iternext
1027  field_descriptor::Methods, // tp_methods
1028  0, // tp_members
1029  field_descriptor::Getters, // tp_getset
1030  &descriptor::PyBaseDescriptor_Type, // tp_base
1031 };
1032 
1034  const FieldDescriptor* field_descriptor) {
1036  &PyFieldDescriptor_Type, field_descriptor, NULL);
1037 }
1038 
1040  if (!PyObject_TypeCheck(obj, &PyFieldDescriptor_Type)) {
1041  PyErr_SetString(PyExc_TypeError, "Not a FieldDescriptor");
1042  return NULL;
1043  }
1044  return reinterpret_cast<const FieldDescriptor*>(
1045  reinterpret_cast<PyBaseDescriptor*>(obj)->descriptor);
1046 }
1047 
1048 namespace enum_descriptor {
1049 
1050 // Unchecked accessor to the C++ pointer.
1052  PyBaseDescriptor *self) {
1053  return reinterpret_cast<const EnumDescriptor*>(self->descriptor);
1054 }
1055 
1056 static PyObject* GetFullName(PyBaseDescriptor* self, void *closure) {
1057  return PyString_FromCppString(_GetDescriptor(self)->full_name());
1058 }
1059 
1060 static PyObject* GetName(PyBaseDescriptor *self, void *closure) {
1061  return PyString_FromCppString(_GetDescriptor(self)->name());
1062 }
1063 
1064 static PyObject* GetFile(PyBaseDescriptor *self, void *closure) {
1066 }
1067 
1068 static PyObject* GetEnumvaluesByName(PyBaseDescriptor* self, void *closure) {
1069  return NewEnumValuesByName(_GetDescriptor(self));
1070 }
1071 
1072 static PyObject* GetEnumvaluesByNumber(PyBaseDescriptor* self, void *closure) {
1073  return NewEnumValuesByNumber(_GetDescriptor(self));
1074 }
1075 
1076 static PyObject* GetEnumvaluesSeq(PyBaseDescriptor* self, void *closure) {
1077  return NewEnumValuesSeq(_GetDescriptor(self));
1078 }
1079 
1080 static PyObject* GetContainingType(PyBaseDescriptor *self, void *closure) {
1081  const Descriptor* containing_type =
1082  _GetDescriptor(self)->containing_type();
1083  if (containing_type) {
1085  } else {
1086  Py_RETURN_NONE;
1087  }
1088 }
1089 
1090 static int SetContainingType(PyBaseDescriptor *self, PyObject *value,
1091  void *closure) {
1092  return CheckCalledFromGeneratedFile("containing_type");
1093 }
1094 
1095 
1096 static PyObject* GetHasOptions(PyBaseDescriptor *self, void *closure) {
1097  const EnumOptions& options(_GetDescriptor(self)->options());
1099  Py_RETURN_TRUE;
1100  } else {
1101  Py_RETURN_FALSE;
1102  }
1103 }
1104 static int SetHasOptions(PyBaseDescriptor *self, PyObject *value,
1105  void *closure) {
1106  return CheckCalledFromGeneratedFile("has_options");
1107 }
1108 
1109 static PyObject* GetOptions(PyBaseDescriptor *self) {
1110  return GetOrBuildOptions(_GetDescriptor(self));
1111 }
1112 
1113 static int SetOptions(PyBaseDescriptor *self, PyObject *value,
1114  void *closure) {
1115  return CheckCalledFromGeneratedFile("_options");
1116 }
1117 
1118 static int SetSerializedOptions(PyBaseDescriptor *self, PyObject *value,
1119  void *closure) {
1120  return CheckCalledFromGeneratedFile("_serialized_options");
1121 }
1122 
1123 static PyObject* CopyToProto(PyBaseDescriptor *self, PyObject *target) {
1124  return CopyToPythonProto<EnumDescriptorProto>(_GetDescriptor(self), target);
1125 }
1126 
1127 static PyMethodDef Methods[] = {
1128  { "GetOptions", (PyCFunction)GetOptions, METH_NOARGS, },
1129  { "CopyToProto", (PyCFunction)CopyToProto, METH_O, },
1130  {NULL}
1131 };
1132 
1133 static PyGetSetDef Getters[] = {
1134  { "full_name", (getter)GetFullName, NULL, "Full name"},
1135  { "name", (getter)GetName, NULL, "last name"},
1136  { "file", (getter)GetFile, NULL, "File descriptor"},
1137  { "values", (getter)GetEnumvaluesSeq, NULL, "values"},
1138  { "values_by_name", (getter)GetEnumvaluesByName, NULL,
1139  "Enum values by name"},
1140  { "values_by_number", (getter)GetEnumvaluesByNumber, NULL,
1141  "Enum values by number"},
1142 
1143  { "containing_type", (getter)GetContainingType, (setter)SetContainingType,
1144  "Containing type"},
1145  { "has_options", (getter)GetHasOptions, (setter)SetHasOptions, "Has Options"},
1146  { "_options", (getter)NULL, (setter)SetOptions, "Options"},
1147  { "_serialized_options", (getter)NULL, (setter)SetSerializedOptions,
1148  "Serialized Options"},
1149  {NULL}
1150 };
1151 
1152 } // namespace enum_descriptor
1153 
1154 PyTypeObject PyEnumDescriptor_Type = {
1155  PyVarObject_HEAD_INIT(&PyType_Type, 0)
1156  FULL_MODULE_NAME ".EnumDescriptor", // tp_name
1157  sizeof(PyBaseDescriptor), // tp_basicsize
1158  0, // tp_itemsize
1159  0, // tp_dealloc
1160  0, // tp_print
1161  0, // tp_getattr
1162  0, // tp_setattr
1163  0, // tp_compare
1164  0, // tp_repr
1165  0, // tp_as_number
1166  0, // tp_as_sequence
1167  0, // tp_as_mapping
1168  0, // tp_hash
1169  0, // tp_call
1170  0, // tp_str
1171  0, // tp_getattro
1172  0, // tp_setattro
1173  0, // tp_as_buffer
1174  Py_TPFLAGS_DEFAULT, // tp_flags
1175  "A Enum Descriptor", // tp_doc
1176  0, // tp_traverse
1177  0, // tp_clear
1178  0, // tp_richcompare
1179  0, // tp_weaklistoffset
1180  0, // tp_iter
1181  0, // tp_iternext
1182  enum_descriptor::Methods, // tp_methods
1183  0, // tp_members
1184  enum_descriptor::Getters, // tp_getset
1185  &descriptor::PyBaseDescriptor_Type, // tp_base
1186 };
1187 
1192 }
1193 
1195  if (!PyObject_TypeCheck(obj, &PyEnumDescriptor_Type)) {
1196  PyErr_SetString(PyExc_TypeError, "Not an EnumDescriptor");
1197  return NULL;
1198  }
1199  return reinterpret_cast<const EnumDescriptor*>(
1200  reinterpret_cast<PyBaseDescriptor*>(obj)->descriptor);
1201 }
1202 
1203 namespace enumvalue_descriptor {
1204 
1205 // Unchecked accessor to the C++ pointer.
1207  PyBaseDescriptor *self) {
1208  return reinterpret_cast<const EnumValueDescriptor*>(self->descriptor);
1209 }
1210 
1211 static PyObject* GetName(PyBaseDescriptor *self, void *closure) {
1212  return PyString_FromCppString(_GetDescriptor(self)->name());
1213 }
1214 
1215 static PyObject* GetNumber(PyBaseDescriptor *self, void *closure) {
1216  return PyLong_FromLong(_GetDescriptor(self)->number());
1217 }
1218 
1219 static PyObject* GetIndex(PyBaseDescriptor *self, void *closure) {
1220  return PyLong_FromLong(_GetDescriptor(self)->index());
1221 }
1222 
1223 static PyObject* GetType(PyBaseDescriptor *self, void *closure) {
1225 }
1226 
1227 static PyObject* GetHasOptions(PyBaseDescriptor *self, void *closure) {
1230  Py_RETURN_TRUE;
1231  } else {
1232  Py_RETURN_FALSE;
1233  }
1234 }
1235 static int SetHasOptions(PyBaseDescriptor *self, PyObject *value,
1236  void *closure) {
1237  return CheckCalledFromGeneratedFile("has_options");
1238 }
1239 
1240 static PyObject* GetOptions(PyBaseDescriptor *self) {
1241  return GetOrBuildOptions(_GetDescriptor(self));
1242 }
1243 
1244 static int SetOptions(PyBaseDescriptor *self, PyObject *value,
1245  void *closure) {
1246  return CheckCalledFromGeneratedFile("_options");
1247 }
1248 
1249 static int SetSerializedOptions(PyBaseDescriptor *self, PyObject *value,
1250  void *closure) {
1251  return CheckCalledFromGeneratedFile("_serialized_options");
1252 }
1253 
1254 static PyGetSetDef Getters[] = {
1255  { "name", (getter)GetName, NULL, "name"},
1256  { "number", (getter)GetNumber, NULL, "number"},
1257  { "index", (getter)GetIndex, NULL, "index"},
1258  { "type", (getter)GetType, NULL, "index"},
1259 
1260  { "has_options", (getter)GetHasOptions, (setter)SetHasOptions, "Has Options"},
1261  { "_options", (getter)NULL, (setter)SetOptions, "Options"},
1262  { "_serialized_options", (getter)NULL, (setter)SetSerializedOptions,
1263  "Serialized Options"},
1264  {NULL}
1265 };
1266 
1267 static PyMethodDef Methods[] = {
1268  { "GetOptions", (PyCFunction)GetOptions, METH_NOARGS, },
1269  {NULL}
1270 };
1271 
1272 } // namespace enumvalue_descriptor
1273 
1274 PyTypeObject PyEnumValueDescriptor_Type = {
1275  PyVarObject_HEAD_INIT(&PyType_Type, 0)
1276  FULL_MODULE_NAME ".EnumValueDescriptor", // tp_name
1277  sizeof(PyBaseDescriptor), // tp_basicsize
1278  0, // tp_itemsize
1279  0, // tp_dealloc
1280  0, // tp_print
1281  0, // tp_getattr
1282  0, // tp_setattr
1283  0, // tp_compare
1284  0, // tp_repr
1285  0, // tp_as_number
1286  0, // tp_as_sequence
1287  0, // tp_as_mapping
1288  0, // tp_hash
1289  0, // tp_call
1290  0, // tp_str
1291  0, // tp_getattro
1292  0, // tp_setattro
1293  0, // tp_as_buffer
1294  Py_TPFLAGS_DEFAULT, // tp_flags
1295  "A EnumValue Descriptor", // tp_doc
1296  0, // tp_traverse
1297  0, // tp_clear
1298  0, // tp_richcompare
1299  0, // tp_weaklistoffset
1300  0, // tp_iter
1301  0, // tp_iternext
1302  enumvalue_descriptor::Methods, // tp_methods
1303  0, // tp_members
1304  enumvalue_descriptor::Getters, // tp_getset
1305  &descriptor::PyBaseDescriptor_Type, // tp_base
1306 };
1307 
1309  const EnumValueDescriptor* enumvalue_descriptor) {
1311  &PyEnumValueDescriptor_Type, enumvalue_descriptor, NULL);
1312 }
1313 
1314 namespace file_descriptor {
1315 
1316 // Unchecked accessor to the C++ pointer.
1318  return reinterpret_cast<const FileDescriptor*>(self->base.descriptor);
1319 }
1320 
1321 static void Dealloc(PyFileDescriptor* self) {
1322  Py_XDECREF(self->serialized_pb);
1323  descriptor::Dealloc(reinterpret_cast<PyObject*>(self));
1324 }
1325 
1326 static PyObject* GetPool(PyFileDescriptor *self, void *closure) {
1327  PyObject* pool = reinterpret_cast<PyObject*>(
1329  Py_XINCREF(pool);
1330  return pool;
1331 }
1332 
1333 static PyObject* GetName(PyFileDescriptor *self, void *closure) {
1334  return PyString_FromCppString(_GetDescriptor(self)->name());
1335 }
1336 
1337 static PyObject* GetPackage(PyFileDescriptor *self, void *closure) {
1338  return PyString_FromCppString(_GetDescriptor(self)->package());
1339 }
1340 
1341 static PyObject* GetSerializedPb(PyFileDescriptor *self, void *closure) {
1342  PyObject *serialized_pb = self->serialized_pb;
1343  if (serialized_pb != NULL) {
1344  Py_INCREF(serialized_pb);
1345  return serialized_pb;
1346  }
1347  FileDescriptorProto file_proto;
1348  _GetDescriptor(self)->CopyTo(&file_proto);
1350  file_proto.SerializePartialToString(&contents);
1351  self->serialized_pb = PyBytes_FromStringAndSize(
1352  contents.c_str(), contents.size());
1353  if (self->serialized_pb == NULL) {
1354  return NULL;
1355  }
1356  Py_INCREF(self->serialized_pb);
1357  return self->serialized_pb;
1358 }
1359 
1360 static PyObject* GetMessageTypesByName(PyFileDescriptor* self, void *closure) {
1362 }
1363 
1364 static PyObject* GetEnumTypesByName(PyFileDescriptor* self, void *closure) {
1365  return NewFileEnumTypesByName(_GetDescriptor(self));
1366 }
1367 
1368 static PyObject* GetExtensionsByName(PyFileDescriptor* self, void *closure) {
1370 }
1371 
1372 static PyObject* GetServicesByName(PyFileDescriptor* self, void *closure) {
1373  return NewFileServicesByName(_GetDescriptor(self));
1374 }
1375 
1376 static PyObject* GetDependencies(PyFileDescriptor* self, void *closure) {
1377  return NewFileDependencies(_GetDescriptor(self));
1378 }
1379 
1380 static PyObject* GetPublicDependencies(PyFileDescriptor* self, void *closure) {
1382 }
1383 
1384 static PyObject* GetHasOptions(PyFileDescriptor *self, void *closure) {
1385  const FileOptions& options(_GetDescriptor(self)->options());
1387  Py_RETURN_TRUE;
1388  } else {
1389  Py_RETURN_FALSE;
1390  }
1391 }
1392 static int SetHasOptions(PyFileDescriptor *self, PyObject *value,
1393  void *closure) {
1394  return CheckCalledFromGeneratedFile("has_options");
1395 }
1396 
1397 static PyObject* GetOptions(PyFileDescriptor *self) {
1398  return GetOrBuildOptions(_GetDescriptor(self));
1399 }
1400 
1401 static int SetOptions(PyFileDescriptor *self, PyObject *value,
1402  void *closure) {
1403  return CheckCalledFromGeneratedFile("_options");
1404 }
1405 
1406 static int SetSerializedOptions(PyFileDescriptor *self, PyObject *value,
1407  void *closure) {
1408  return CheckCalledFromGeneratedFile("_serialized_options");
1409 }
1410 
1411 static PyObject* GetSyntax(PyFileDescriptor *self, void *closure) {
1412  return PyUnicode_InternFromString(
1414 }
1415 
1416 static PyObject* CopyToProto(PyFileDescriptor *self, PyObject *target) {
1417  return CopyToPythonProto<FileDescriptorProto>(_GetDescriptor(self), target);
1418 }
1419 
1420 static PyGetSetDef Getters[] = {
1421  { "pool", (getter)GetPool, NULL, "pool"},
1422  { "name", (getter)GetName, NULL, "name"},
1423  { "package", (getter)GetPackage, NULL, "package"},
1424  { "serialized_pb", (getter)GetSerializedPb},
1425  { "message_types_by_name", (getter)GetMessageTypesByName, NULL,
1426  "Messages by name"},
1427  { "enum_types_by_name", (getter)GetEnumTypesByName, NULL, "Enums by name"},
1428  { "extensions_by_name", (getter)GetExtensionsByName, NULL,
1429  "Extensions by name"},
1430  { "services_by_name", (getter)GetServicesByName, NULL, "Services by name"},
1431  { "dependencies", (getter)GetDependencies, NULL, "Dependencies"},
1432  { "public_dependencies", (getter)GetPublicDependencies, NULL, "Dependencies"},
1433 
1434  { "has_options", (getter)GetHasOptions, (setter)SetHasOptions, "Has Options"},
1435  { "_options", (getter)NULL, (setter)SetOptions, "Options"},
1436  { "_serialized_options", (getter)NULL, (setter)SetSerializedOptions,
1437  "Serialized Options"},
1438  { "syntax", (getter)GetSyntax, (setter)NULL, "Syntax"},
1439  {NULL}
1440 };
1441 
1442 static PyMethodDef Methods[] = {
1443  { "GetOptions", (PyCFunction)GetOptions, METH_NOARGS, },
1444  { "CopyToProto", (PyCFunction)CopyToProto, METH_O, },
1445  {NULL}
1446 };
1447 
1448 } // namespace file_descriptor
1449 
1450 PyTypeObject PyFileDescriptor_Type = {
1451  PyVarObject_HEAD_INIT(&PyType_Type, 0) FULL_MODULE_NAME
1452  ".FileDescriptor", // tp_name
1453  sizeof(PyFileDescriptor), // tp_basicsize
1454  0, // tp_itemsize
1455  (destructor)file_descriptor::Dealloc, // tp_dealloc
1456  0, // tp_print
1457  0, // tp_getattr
1458  0, // tp_setattr
1459  0, // tp_compare
1460  0, // tp_repr
1461  0, // tp_as_number
1462  0, // tp_as_sequence
1463  0, // tp_as_mapping
1464  0, // tp_hash
1465  0, // tp_call
1466  0, // tp_str
1467  0, // tp_getattro
1468  0, // tp_setattro
1469  0, // tp_as_buffer
1470  Py_TPFLAGS_DEFAULT, // tp_flags
1471  "A File Descriptor", // tp_doc
1472  0, // tp_traverse
1473  0, // tp_clear
1474  0, // tp_richcompare
1475  0, // tp_weaklistoffset
1476  0, // tp_iter
1477  0, // tp_iternext
1478  file_descriptor::Methods, // tp_methods
1479  0, // tp_members
1480  file_descriptor::Getters, // tp_getset
1481  &descriptor::PyBaseDescriptor_Type, // tp_base
1482  0, // tp_dict
1483  0, // tp_descr_get
1484  0, // tp_descr_set
1485  0, // tp_dictoffset
1486  0, // tp_init
1487  0, // tp_alloc
1488  0, // tp_new
1489  PyObject_GC_Del, // tp_free
1490 };
1491 
1493  const FileDescriptor* file_descriptor) {
1494  return PyFileDescriptor_FromDescriptorWithSerializedPb(file_descriptor,
1495  NULL);
1496 }
1497 
1499  const FileDescriptor* file_descriptor, PyObject *serialized_pb) {
1500  bool was_created;
1501  PyObject* py_descriptor = descriptor::NewInternedDescriptor(
1502  &PyFileDescriptor_Type, file_descriptor, &was_created);
1503  if (py_descriptor == NULL) {
1504  return NULL;
1505  }
1506  if (was_created) {
1507  PyFileDescriptor* cfile_descriptor =
1508  reinterpret_cast<PyFileDescriptor*>(py_descriptor);
1509  Py_XINCREF(serialized_pb);
1510  cfile_descriptor->serialized_pb = serialized_pb;
1511  }
1512  // TODO(amauryfa): In the case of a cached object, check that serialized_pb
1513  // is the same as before.
1514 
1515  return py_descriptor;
1516 }
1517 
1519  if (!PyObject_TypeCheck(obj, &PyFileDescriptor_Type)) {
1520  PyErr_SetString(PyExc_TypeError, "Not a FileDescriptor");
1521  return NULL;
1522  }
1523  return reinterpret_cast<const FileDescriptor*>(
1524  reinterpret_cast<PyBaseDescriptor*>(obj)->descriptor);
1525 }
1526 
1527 namespace oneof_descriptor {
1528 
1529 // Unchecked accessor to the C++ pointer.
1531  PyBaseDescriptor *self) {
1532  return reinterpret_cast<const OneofDescriptor*>(self->descriptor);
1533 }
1534 
1535 static PyObject* GetName(PyBaseDescriptor* self, void *closure) {
1536  return PyString_FromCppString(_GetDescriptor(self)->name());
1537 }
1538 
1539 static PyObject* GetFullName(PyBaseDescriptor* self, void *closure) {
1540  return PyString_FromCppString(_GetDescriptor(self)->full_name());
1541 }
1542 
1543 static PyObject* GetIndex(PyBaseDescriptor *self, void *closure) {
1544  return PyLong_FromLong(_GetDescriptor(self)->index());
1545 }
1546 
1547 static PyObject* GetFields(PyBaseDescriptor* self, void *closure) {
1548  return NewOneofFieldsSeq(_GetDescriptor(self));
1549 }
1550 
1551 static PyObject* GetContainingType(PyBaseDescriptor *self, void *closure) {
1552  const Descriptor* containing_type =
1553  _GetDescriptor(self)->containing_type();
1554  if (containing_type) {
1556  } else {
1557  Py_RETURN_NONE;
1558  }
1559 }
1560 
1561 static PyObject* GetHasOptions(PyBaseDescriptor *self, void *closure) {
1562  const OneofOptions& options(_GetDescriptor(self)->options());
1564  Py_RETURN_TRUE;
1565  } else {
1566  Py_RETURN_FALSE;
1567  }
1568 }
1569 static int SetHasOptions(PyBaseDescriptor *self, PyObject *value,
1570  void *closure) {
1571  return CheckCalledFromGeneratedFile("has_options");
1572 }
1573 
1574 static PyObject* GetOptions(PyBaseDescriptor *self) {
1575  return GetOrBuildOptions(_GetDescriptor(self));
1576 }
1577 
1578 static int SetOptions(PyBaseDescriptor *self, PyObject *value,
1579  void *closure) {
1580  return CheckCalledFromGeneratedFile("_options");
1581 }
1582 
1583 static int SetSerializedOptions(PyBaseDescriptor *self, PyObject *value,
1584  void *closure) {
1585  return CheckCalledFromGeneratedFile("_serialized_options");
1586 }
1587 
1588 static PyGetSetDef Getters[] = {
1589  { "name", (getter)GetName, NULL, "Name"},
1590  { "full_name", (getter)GetFullName, NULL, "Full name"},
1591  { "index", (getter)GetIndex, NULL, "Index"},
1592 
1593  { "containing_type", (getter)GetContainingType, NULL, "Containing type"},
1594  { "has_options", (getter)GetHasOptions, (setter)SetHasOptions, "Has Options"},
1595  { "_options", (getter)NULL, (setter)SetOptions, "Options"},
1596  { "_serialized_options", (getter)NULL, (setter)SetSerializedOptions,
1597  "Serialized Options"},
1598  { "fields", (getter)GetFields, NULL, "Fields"},
1599  {NULL}
1600 };
1601 
1602 static PyMethodDef Methods[] = {
1603  { "GetOptions", (PyCFunction)GetOptions, METH_NOARGS },
1604  {NULL}
1605 };
1606 
1607 } // namespace oneof_descriptor
1608 
1609 PyTypeObject PyOneofDescriptor_Type = {
1610  PyVarObject_HEAD_INIT(&PyType_Type, 0)
1611  FULL_MODULE_NAME ".OneofDescriptor", // tp_name
1612  sizeof(PyBaseDescriptor), // tp_basicsize
1613  0, // tp_itemsize
1614  0, // tp_dealloc
1615  0, // tp_print
1616  0, // tp_getattr
1617  0, // tp_setattr
1618  0, // tp_compare
1619  0, // tp_repr
1620  0, // tp_as_number
1621  0, // tp_as_sequence
1622  0, // tp_as_mapping
1623  0, // tp_hash
1624  0, // tp_call
1625  0, // tp_str
1626  0, // tp_getattro
1627  0, // tp_setattro
1628  0, // tp_as_buffer
1629  Py_TPFLAGS_DEFAULT, // tp_flags
1630  "A Oneof Descriptor", // tp_doc
1631  0, // tp_traverse
1632  0, // tp_clear
1633  0, // tp_richcompare
1634  0, // tp_weaklistoffset
1635  0, // tp_iter
1636  0, // tp_iternext
1637  oneof_descriptor::Methods, // tp_methods
1638  0, // tp_members
1639  oneof_descriptor::Getters, // tp_getset
1640  &descriptor::PyBaseDescriptor_Type, // tp_base
1641 };
1642 
1644  const OneofDescriptor* oneof_descriptor) {
1646  &PyOneofDescriptor_Type, oneof_descriptor, NULL);
1647 }
1648 
1649 namespace service_descriptor {
1650 
1651 // Unchecked accessor to the C++ pointer.
1653  PyBaseDescriptor *self) {
1654  return reinterpret_cast<const ServiceDescriptor*>(self->descriptor);
1655 }
1656 
1657 static PyObject* GetName(PyBaseDescriptor* self, void *closure) {
1658  return PyString_FromCppString(_GetDescriptor(self)->name());
1659 }
1660 
1661 static PyObject* GetFullName(PyBaseDescriptor* self, void *closure) {
1662  return PyString_FromCppString(_GetDescriptor(self)->full_name());
1663 }
1664 
1665 static PyObject* GetFile(PyBaseDescriptor *self, void *closure) {
1667 }
1668 
1669 static PyObject* GetIndex(PyBaseDescriptor *self, void *closure) {
1670  return PyLong_FromLong(_GetDescriptor(self)->index());
1671 }
1672 
1673 static PyObject* GetMethods(PyBaseDescriptor* self, void *closure) {
1674  return NewServiceMethodsSeq(_GetDescriptor(self));
1675 }
1676 
1677 static PyObject* GetMethodsByName(PyBaseDescriptor* self, void *closure) {
1679 }
1680 
1681 static PyObject* FindMethodByName(PyBaseDescriptor *self, PyObject* arg) {
1682  Py_ssize_t name_size;
1683  char* name;
1684  if (PyString_AsStringAndSize(arg, &name, &name_size) < 0) {
1685  return NULL;
1686  }
1687 
1688  const MethodDescriptor* method_descriptor =
1689  _GetDescriptor(self)->FindMethodByName(StringParam(name, name_size));
1690  if (method_descriptor == NULL) {
1691  PyErr_Format(PyExc_KeyError, "Couldn't find method %.200s", name);
1692  return NULL;
1693  }
1694 
1695  return PyMethodDescriptor_FromDescriptor(method_descriptor);
1696 }
1697 
1698 static PyObject* GetOptions(PyBaseDescriptor *self) {
1699  return GetOrBuildOptions(_GetDescriptor(self));
1700 }
1701 
1702 static PyObject* CopyToProto(PyBaseDescriptor *self, PyObject *target) {
1703  return CopyToPythonProto<ServiceDescriptorProto>(_GetDescriptor(self),
1704  target);
1705 }
1706 
1707 static PyGetSetDef Getters[] = {
1708  { "name", (getter)GetName, NULL, "Name", NULL},
1709  { "full_name", (getter)GetFullName, NULL, "Full name", NULL},
1710  { "file", (getter)GetFile, NULL, "File descriptor"},
1711  { "index", (getter)GetIndex, NULL, "Index", NULL},
1712 
1713  { "methods", (getter)GetMethods, NULL, "Methods", NULL},
1714  { "methods_by_name", (getter)GetMethodsByName, NULL, "Methods by name", NULL},
1715  {NULL}
1716 };
1717 
1718 static PyMethodDef Methods[] = {
1719  { "GetOptions", (PyCFunction)GetOptions, METH_NOARGS },
1720  { "CopyToProto", (PyCFunction)CopyToProto, METH_O, },
1721  { "FindMethodByName", (PyCFunction)FindMethodByName, METH_O },
1722  {NULL}
1723 };
1724 
1725 } // namespace service_descriptor
1726 
1727 PyTypeObject PyServiceDescriptor_Type = {
1728  PyVarObject_HEAD_INIT(&PyType_Type, 0)
1729  FULL_MODULE_NAME ".ServiceDescriptor", // tp_name
1730  sizeof(PyBaseDescriptor), // tp_basicsize
1731  0, // tp_itemsize
1732  0, // tp_dealloc
1733  0, // tp_print
1734  0, // tp_getattr
1735  0, // tp_setattr
1736  0, // tp_compare
1737  0, // tp_repr
1738  0, // tp_as_number
1739  0, // tp_as_sequence
1740  0, // tp_as_mapping
1741  0, // tp_hash
1742  0, // tp_call
1743  0, // tp_str
1744  0, // tp_getattro
1745  0, // tp_setattro
1746  0, // tp_as_buffer
1747  Py_TPFLAGS_DEFAULT, // tp_flags
1748  "A Service Descriptor", // tp_doc
1749  0, // tp_traverse
1750  0, // tp_clear
1751  0, // tp_richcompare
1752  0, // tp_weaklistoffset
1753  0, // tp_iter
1754  0, // tp_iternext
1755  service_descriptor::Methods, // tp_methods
1756  0, // tp_members
1757  service_descriptor::Getters, // tp_getset
1758  &descriptor::PyBaseDescriptor_Type, // tp_base
1759 };
1760 
1762  const ServiceDescriptor* service_descriptor) {
1764  &PyServiceDescriptor_Type, service_descriptor, NULL);
1765 }
1766 
1768  if (!PyObject_TypeCheck(obj, &PyServiceDescriptor_Type)) {
1769  PyErr_SetString(PyExc_TypeError, "Not a ServiceDescriptor");
1770  return NULL;
1771  }
1772  return reinterpret_cast<const ServiceDescriptor*>(
1773  reinterpret_cast<PyBaseDescriptor*>(obj)->descriptor);
1774 }
1775 
1776 namespace method_descriptor {
1777 
1778 // Unchecked accessor to the C++ pointer.
1780  PyBaseDescriptor *self) {
1781  return reinterpret_cast<const MethodDescriptor*>(self->descriptor);
1782 }
1783 
1784 static PyObject* GetName(PyBaseDescriptor* self, void *closure) {
1785  return PyString_FromCppString(_GetDescriptor(self)->name());
1786 }
1787 
1788 static PyObject* GetFullName(PyBaseDescriptor* self, void *closure) {
1789  return PyString_FromCppString(_GetDescriptor(self)->full_name());
1790 }
1791 
1792 static PyObject* GetIndex(PyBaseDescriptor *self, void *closure) {
1793  return PyLong_FromLong(_GetDescriptor(self)->index());
1794 }
1795 
1796 static PyObject* GetContainingService(PyBaseDescriptor *self, void *closure) {
1797  const ServiceDescriptor* containing_service =
1798  _GetDescriptor(self)->service();
1799  return PyServiceDescriptor_FromDescriptor(containing_service);
1800 }
1801 
1802 static PyObject* GetInputType(PyBaseDescriptor *self, void *closure) {
1803  const Descriptor* input_type = _GetDescriptor(self)->input_type();
1804  return PyMessageDescriptor_FromDescriptor(input_type);
1805 }
1806 
1807 static PyObject* GetOutputType(PyBaseDescriptor *self, void *closure) {
1808  const Descriptor* output_type = _GetDescriptor(self)->output_type();
1809  return PyMessageDescriptor_FromDescriptor(output_type);
1810 }
1811 
1812 static PyObject* GetOptions(PyBaseDescriptor *self) {
1813  return GetOrBuildOptions(_GetDescriptor(self));
1814 }
1815 
1816 static PyObject* CopyToProto(PyBaseDescriptor *self, PyObject *target) {
1817  return CopyToPythonProto<MethodDescriptorProto>(_GetDescriptor(self), target);
1818 }
1819 
1820 static PyGetSetDef Getters[] = {
1821  { "name", (getter)GetName, NULL, "Name", NULL},
1822  { "full_name", (getter)GetFullName, NULL, "Full name", NULL},
1823  { "index", (getter)GetIndex, NULL, "Index", NULL},
1824  { "containing_service", (getter)GetContainingService, NULL,
1825  "Containing service", NULL},
1826  { "input_type", (getter)GetInputType, NULL, "Input type", NULL},
1827  { "output_type", (getter)GetOutputType, NULL, "Output type", NULL},
1828  {NULL}
1829 };
1830 
1831 static PyMethodDef Methods[] = {
1832  { "GetOptions", (PyCFunction)GetOptions, METH_NOARGS, },
1833  { "CopyToProto", (PyCFunction)CopyToProto, METH_O, },
1834  {NULL}
1835 };
1836 
1837 } // namespace method_descriptor
1838 
1839 PyTypeObject PyMethodDescriptor_Type = {
1840  PyVarObject_HEAD_INIT(&PyType_Type, 0)
1841  FULL_MODULE_NAME ".MethodDescriptor", // tp_name
1842  sizeof(PyBaseDescriptor), // tp_basicsize
1843  0, // tp_itemsize
1844  0, // tp_dealloc
1845  0, // tp_print
1846  0, // tp_getattr
1847  0, // tp_setattr
1848  0, // tp_compare
1849  0, // tp_repr
1850  0, // tp_as_number
1851  0, // tp_as_sequence
1852  0, // tp_as_mapping
1853  0, // tp_hash
1854  0, // tp_call
1855  0, // tp_str
1856  0, // tp_getattro
1857  0, // tp_setattro
1858  0, // tp_as_buffer
1859  Py_TPFLAGS_DEFAULT, // tp_flags
1860  "A Method Descriptor", // tp_doc
1861  0, // tp_traverse
1862  0, // tp_clear
1863  0, // tp_richcompare
1864  0, // tp_weaklistoffset
1865  0, // tp_iter
1866  0, // tp_iternext
1867  method_descriptor::Methods, // tp_methods
1868  0, // tp_members
1869  method_descriptor::Getters, // tp_getset
1870  &descriptor::PyBaseDescriptor_Type, // tp_base
1871 };
1872 
1874  const MethodDescriptor* method_descriptor) {
1876  &PyMethodDescriptor_Type, method_descriptor, NULL);
1877 }
1878 
1879 // Add a enum values to a type dictionary.
1880 static bool AddEnumValues(PyTypeObject *type,
1882  for (int i = 0; i < enum_descriptor->value_count(); ++i) {
1883  const EnumValueDescriptor* value = enum_descriptor->value(i);
1884  ScopedPyObjectPtr obj(PyLong_FromLong(value->number()));
1885  if (obj == NULL) {
1886  return false;
1887  }
1888  if (PyDict_SetItemString(type->tp_dict, value->name().c_str(), obj.get()) <
1889  0) {
1890  return false;
1891  }
1892  }
1893  return true;
1894 }
1895 
1896 static bool AddIntConstant(PyTypeObject *type, const char* name, int value) {
1897  ScopedPyObjectPtr obj(PyLong_FromLong(value));
1898  if (PyDict_SetItemString(type->tp_dict, name, obj.get()) < 0) {
1899  return false;
1900  }
1901  return true;
1902 }
1903 
1904 
1905 bool InitDescriptor() {
1906  if (PyType_Ready(&PyMessageDescriptor_Type) < 0)
1907  return false;
1908 
1909  if (PyType_Ready(&PyFieldDescriptor_Type) < 0)
1910  return false;
1911 
1914  return false;
1915  }
1918  return false;
1919  }
1920 #define ADD_FIELDDESC_CONSTANT(NAME) AddIntConstant( \
1921  &PyFieldDescriptor_Type, #NAME, FieldDescriptor::NAME)
1922  if (!ADD_FIELDDESC_CONSTANT(CPPTYPE_INT32) ||
1923  !ADD_FIELDDESC_CONSTANT(CPPTYPE_INT64) ||
1924  !ADD_FIELDDESC_CONSTANT(CPPTYPE_UINT32) ||
1925  !ADD_FIELDDESC_CONSTANT(CPPTYPE_UINT64) ||
1926  !ADD_FIELDDESC_CONSTANT(CPPTYPE_DOUBLE) ||
1927  !ADD_FIELDDESC_CONSTANT(CPPTYPE_FLOAT) ||
1928  !ADD_FIELDDESC_CONSTANT(CPPTYPE_BOOL) ||
1929  !ADD_FIELDDESC_CONSTANT(CPPTYPE_ENUM) ||
1930  !ADD_FIELDDESC_CONSTANT(CPPTYPE_STRING) ||
1931  !ADD_FIELDDESC_CONSTANT(CPPTYPE_MESSAGE)) {
1932  return false;
1933  }
1934 #undef ADD_FIELDDESC_CONSTANT
1935 
1936  if (PyType_Ready(&PyEnumDescriptor_Type) < 0)
1937  return false;
1938 
1939  if (PyType_Ready(&PyEnumValueDescriptor_Type) < 0)
1940  return false;
1941 
1942  if (PyType_Ready(&PyFileDescriptor_Type) < 0)
1943  return false;
1944 
1945  if (PyType_Ready(&PyOneofDescriptor_Type) < 0)
1946  return false;
1947 
1948  if (PyType_Ready(&PyServiceDescriptor_Type) < 0)
1949  return false;
1950 
1951  if (PyType_Ready(&PyMethodDescriptor_Type) < 0)
1952  return false;
1953 
1955  return false;
1956 
1957  // Initialize globals defined in this file.
1958  interned_descriptors = new std::unordered_map<const void*, PyObject*>;
1959 
1960  return true;
1961 }
1962 
1963 } // namespace python
1964 } // namespace protobuf
1965 } // namespace google
google::protobuf::Descriptor::full_name
const std::string & full_name() const
google::protobuf::python::message_descriptor::NewMessageExtensionsSeq
PyObject * NewMessageExtensionsSeq(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1256
xds_interop_client.str
str
Definition: xds_interop_client.py:487
google::protobuf::python::file_descriptor::GetSyntax
static PyObject * GetSyntax(PyFileDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1411
google::protobuf::python::file_descriptor::NewFileDependencies
PyObject * NewFileDependencies(const FileDescriptor *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1733
google::protobuf::python::message_descriptor::NewMessageOneofsSeq
PyObject * NewMessageOneofsSeq(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1308
_gevent_test_main.result
result
Definition: _gevent_test_main.py:96
google::protobuf::python::message_descriptor::GetNestedTypesByName
static PyObject * GetNestedTypesByName(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:509
obj
OPENSSL_EXPORT const ASN1_OBJECT * obj
Definition: x509.h:1671
google::protobuf::python::PyBaseDescriptor::descriptor
const PyObject_HEAD void * descriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:321
FieldDescriptorProto::Type_descriptor
static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor * Type_descriptor()
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:2028
google::protobuf::python::PyString_FromCppString
PyObject * PyString_FromCppString(const string &str)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:78
google::protobuf::python::message_descriptor::GetNestedTypesSeq
static PyObject * GetNestedTypesSeq(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:513
FileOptions::default_instance
static const FileOptions & default_instance()
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.cc:6483
filename
const char * filename
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:135
google::protobuf::python::PyServiceDescriptor_Type
PyTypeObject PyServiceDescriptor_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1731
regen-readme.it
it
Definition: regen-readme.py:15
google::protobuf::value
const Descriptor::ReservedRange value
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1954
google::protobuf::FieldDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:515
google::protobuf::python::message_descriptor::GetFieldsByNumber
static PyObject * GetFieldsByNumber(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:501
google::protobuf::python::file_descriptor::NewFileMessageTypesByName
PyObject * NewFileMessageTypesByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1553
google::protobuf::python::message_descriptor::GetFieldsByCamelcaseName
static PyObject * GetFieldsByCamelcaseName(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:496
google::protobuf::python::PyBaseDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:316
const
#define const
Definition: bloaty/third_party/zlib/zconf.h:230
google::protobuf::python::message_descriptor::GetExtensionRanges
static PyObject * GetExtensionRanges(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:553
PyString_AsStringAndSize
#define PyString_AsStringAndSize(ob, charpp, sizep)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:53
google::protobuf::python::PyMessageFactory
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message_factory.h:49
google::protobuf::python::descriptor::NewInternedDescriptor
PyObject * NewInternedDescriptor(PyTypeObject *type, const DescriptorClass *descriptor, bool *was_created)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:347
google::protobuf::FieldDescriptor::CPPTYPE_STRING
@ CPPTYPE_STRING
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:562
google::protobuf::python::enumvalue_descriptor::GetNumber
static PyObject * GetNumber(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1215
google::protobuf::python::oneof_descriptor::GetFields
static PyObject * GetFields(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1547
file
const grpc_generator::File * file
Definition: python_private_generator.h:38
google::protobuf::FileDescriptor::SyntaxName
static const char * SyntaxName(Syntax syntax)
google::protobuf::python::method_descriptor::_GetDescriptor
static const MethodDescriptor * _GetDescriptor(PyBaseDescriptor *self)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1779
google::protobuf::python::PyFileDescriptor::serialized_pb
PyObject * serialized_pb
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:334
google::protobuf::python::PyEnumValueDescriptor_Type
PyTypeObject PyEnumValueDescriptor_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1278
google::protobuf::python::file_descriptor::GetExtensionsByName
static PyObject * GetExtensionsByName(PyFileDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1368
google::protobuf::python::PyServiceDescriptor_FromDescriptor
PyObject * PyServiceDescriptor_FromDescriptor(const ServiceDescriptor *service_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1765
google::protobuf::python::oneof_descriptor::NewOneofFieldsSeq
PyObject * NewOneofFieldsSeq(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1433
google::protobuf::python::message_descriptor::EnumValueName
static PyObject * EnumValueName(PyBaseDescriptor *self, PyObject *args)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:613
capstone.range
range
Definition: third_party/bloaty/third_party/capstone/bindings/python/capstone/__init__.py:6
google::protobuf::python::oneof_descriptor::SetSerializedOptions
static int SetSerializedOptions(PyBaseDescriptor *self, PyObject *value, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1583
google::protobuf::python::file_descriptor::GetPublicDependencies
static PyObject * GetPublicDependencies(PyFileDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1380
google::protobuf::python::GetDefaultDescriptorPool
PyDescriptorPool * GetDefaultDescriptorPool()
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:751
google::protobuf::python::file_descriptor::NewFileEnumTypesByName
PyObject * NewFileEnumTypesByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1601
google::protobuf::python::CMessage
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:100
ADD_FIELDDESC_CONSTANT
#define ADD_FIELDDESC_CONSTANT(NAME)
google::protobuf::python::field_descriptor::GetJsonName
static PyObject * GetJsonName(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:752
google::protobuf::python::method_descriptor::GetFullName
static PyObject * GetFullName(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1788
google::protobuf::python::ToStringObject
PyObject * ToStringObject(const FieldDescriptor *descriptor, const string &value)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:799
FieldOptions
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:4590
google::protobuf::python::CheckCalledFromGeneratedFile
static int CheckCalledFromGeneratedFile(const char *attr_name)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:150
GOOGLE_DCHECK
#define GOOGLE_DCHECK
Definition: bloaty/third_party/protobuf/src/google/protobuf/stubs/logging.h:194
phone_pb2.message_type
message_type
Definition: phone_pb2.py:200
google::protobuf::python::file_descriptor::NewFilePublicDependencies
PyObject * NewFilePublicDependencies(const FileDescriptor *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1769
PyVarObject_HEAD_INIT
#define PyVarObject_HEAD_INIT(type, size)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:155
options
double_dict options[]
Definition: capstone_test.c:55
google::protobuf::python::service_descriptor::NewServiceMethodsByName
PyObject * NewServiceMethodsByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1495
FileOptions
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:3696
google::protobuf::python::PyFieldDescriptor_AsDescriptor
const FieldDescriptor * PyFieldDescriptor_AsDescriptor(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1043
FileDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:128
google::protobuf::python::PyMethodDescriptor_FromDescriptor
PyObject * PyMethodDescriptor_FromDescriptor(const MethodDescriptor *method_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1877
google::protobuf::python::message_descriptor::NewMessageNestedTypesSeq
PyObject * NewMessageNestedTypesSeq(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1077
testing::internal::string
::std::string string
Definition: bloaty/third_party/protobuf/third_party/googletest/googletest/include/gtest/internal/gtest-port.h:881
google::protobuf::python::PyDescriptorPool
struct google::protobuf::python::PyDescriptorPool PyDescriptorPool
google::protobuf::python::PyBaseDescriptor::pool
PyDescriptorPool * pool
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:324
google::protobuf::python::PyEnumValueDescriptor_FromDescriptor
PyObject * PyEnumValueDescriptor_FromDescriptor(const EnumValueDescriptor *enumvalue_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1312
google::protobuf
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:12
google::protobuf::MethodDescriptor::CopyTo
void CopyTo(MethodDescriptorProto *proto) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.cc:2204
google::protobuf::python::enum_descriptor::NewEnumValuesByNumber
PyObject * NewEnumValuesByNumber(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1379
google::protobuf::python::field_descriptor::GetMessageType
static PyObject * GetMessageType(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:877
google::protobuf::python::message_descriptor::NewMessageExtensionsByName
PyObject * NewMessageExtensionsByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1252
google::protobuf::OneofDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:843
google::protobuf::python::PyFileDescriptor
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:329
setup.name
name
Definition: setup.py:542
FULL_MODULE_NAME
#define FULL_MODULE_NAME
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:331
google::protobuf::python::message_descriptor::NewMessageEnumsByName
PyObject * NewMessageEnumsByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1129
google::protobuf::python::message_descriptor::NewMessageNestedTypesByName
PyObject * NewMessageNestedTypesByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1081
to
size_t to
Definition: abseil-cpp/absl/container/internal/layout_test.cc:1385
OneofOptions::default_instance
static const OneofOptions & default_instance()
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.cc:8086
google::protobuf::MethodDescriptor::output_type
const Descriptor * output_type() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.cc:7249
google::protobuf::python::ScopedPythonPtr
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/scoped_pyobject_ptr.h:46
google::protobuf::python::file_descriptor::GetMessageTypesByName
static PyObject * GetMessageTypesByName(PyFileDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1360
google::protobuf::python::PyDescriptorPool
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.h:56
google::protobuf::Reflection
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.h:397
uint8_t
unsigned char uint8_t
Definition: stdint-msvc2008.h:78
iterator
const typedef MCPhysReg * iterator
Definition: MCRegisterInfo.h:27
google::protobuf::python::CMessageClass
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:148
google::protobuf::python::oneof_descriptor::GetContainingType
static PyObject * GetContainingType(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1551
EnumValue
Definition: bloaty/third_party/protobuf/src/google/protobuf/type.pb.h:1105
google::protobuf::python::field_descriptor::GetContainingOneof
static PyObject * GetContainingOneof(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:917
google::protobuf::python::descriptor::PyBaseDescriptor_Type
PyTypeObject PyBaseDescriptor_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:421
google::protobuf::python::field_descriptor::SetMessageType
static int SetMessageType(PyBaseDescriptor *self, PyObject *value, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:886
message
char * message
Definition: libuv/docs/code/tty-gravity/main.c:12
FieldOptions::default_instance
static const FieldOptions & default_instance()
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.cc:7687
google::protobuf::python::PyEnumDescriptor_FromDescriptor
PyObject * PyEnumDescriptor_FromDescriptor(const EnumDescriptor *enum_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1192
Enum
Definition: bloaty/third_party/protobuf/src/google/protobuf/type.pb.h:867
Descriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:121
EnumOptions
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:5086
google::protobuf::python::field_descriptor::IsExtension
static PyObject * IsExtension(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:784
google::protobuf::python::PyFieldDescriptor_FromDescriptor
PyObject * PyFieldDescriptor_FromDescriptor(const FieldDescriptor *field_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1037
google::protobuf::python::enum_descriptor::GetEnumvaluesByName
static PyObject * GetEnumvaluesByName(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1068
google::protobuf::python::AddEnumValues
static bool AddEnumValues(PyTypeObject *type, const EnumDescriptor *enum_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1884
google::protobuf::python::PyMessageDescriptor_FromDescriptor
PyObject * PyMessageDescriptor_FromDescriptor(const Descriptor *message_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:722
google::protobuf::python::PyFileDescriptor_Type
PyTypeObject PyFileDescriptor_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1454
uint32_t
unsigned int uint32_t
Definition: stdint-msvc2008.h:80
google::protobuf::EnumValueDescriptor::name
const std::string & name() const
google::protobuf::python::method_descriptor::Methods
static PyMethodDef Methods[]
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1831
from
size_t from
Definition: abseil-cpp/absl/container/internal/layout_test.cc:1384
Oneof
struct Oneof Oneof
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:664
FieldDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:133
google::protobuf::ServiceDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1152
google::protobuf::python::message_descriptor::GetEnumsSeq
static PyObject * GetEnumsSeq(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:525
google::protobuf::python::field_descriptor::GetEnumType
static PyObject * GetEnumType(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:864
start
static uint64_t start
Definition: benchmark-pound.c:74
google::protobuf::python::GetDescriptorPool_FromPool
PyDescriptorPool * GetDescriptorPool_FromPool(const DescriptorPool *pool)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.cc:755
EnumValueOptions::default_instance
static const EnumValueOptions & default_instance()
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.cc:8628
google::protobuf::python::message_descriptor::IsExtendable
static PyObject * IsExtendable(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:545
google::protobuf::python::service_descriptor::FindMethodByName
static PyObject * FindMethodByName(PyBaseDescriptor *self, PyObject *arg)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1681
asyncio_get_stats.args
args
Definition: asyncio_get_stats.py:40
benchmark.syntax
syntax
Definition: benchmark.py:90
google::protobuf::python::PyMessageDescriptor_AsDescriptor
const Descriptor * PyMessageDescriptor_AsDescriptor(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:728
google::protobuf::python::InitDescriptorMappingTypes
bool InitDescriptorMappingTypes()
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1779
google::protobuf::python::message_descriptor::NewMessageFieldsByNumber
PyObject * NewMessageFieldsByNumber(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1025
end
char * end
Definition: abseil-cpp/absl/strings/internal/str_format/float_conversion.cc:1008
MessageOptions::default_instance
static const MessageOptions & default_instance()
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.cc:7325
google::protobuf::python::field_descriptor::SetContainingOneof
static int SetContainingOneof(PyBaseDescriptor *self, PyObject *value, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:927
gen_synthetic_protos.label
label
Definition: gen_synthetic_protos.py:102
int64_t
signed __int64 int64_t
Definition: stdint-msvc2008.h:89
absl::string_view::size
constexpr size_type size() const noexcept
Definition: abseil-cpp/absl/strings/string_view.h:277
gen_stats_data.c_str
def c_str(s, encoding='ascii')
Definition: gen_stats_data.py:38
google::protobuf::python::enumvalue_descriptor::GetType
static PyObject * GetType(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1223
google::protobuf::python::enum_descriptor::GetEnumvaluesByNumber
static PyObject * GetEnumvaluesByNumber(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1072
google::protobuf::python::CMessageClass::AsPyObject
PyObject * AsPyObject()
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:166
google::protobuf::python::service_descriptor::GetMethodsByName
static PyObject * GetMethodsByName(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1677
google::protobuf::python::PyFileDescriptor
struct google::protobuf::python::PyFileDescriptor PyFileDescriptor
google::protobuf::python::enum_descriptor::SetContainingType
static int SetContainingType(PyBaseDescriptor *self, PyObject *value, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1090
google::protobuf::python::message_descriptor::GetEnumValuesByName
static PyObject * GetEnumValuesByName(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:533
google::protobuf::python::PyBaseDescriptor
struct google::protobuf::python::PyBaseDescriptor PyBaseDescriptor
google::protobuf::python::CMessage_Type
PyTypeObject * CMessage_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:2847
google::protobuf::python::PyDescriptorPool::py_message_factory
PyMessageFactory * py_message_factory
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.h:77
grpc::protobuf::MethodDescriptor
GRPC_CUSTOM_METHODDESCRIPTOR MethodDescriptor
Definition: include/grpcpp/impl/codegen/config_protobuf.h:87
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
google::protobuf::python::message_descriptor::GetConcreteClass
static PyObject * GetConcreteClass(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:478
grpc::protobuf::io::CodedInputStream
GRPC_CUSTOM_CODEDINPUTSTREAM CodedInputStream
Definition: include/grpcpp/impl/codegen/config_protobuf.h:102
MessageOptions
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:4359
google::protobuf::Reflection::GetUnknownFields
const UnknownFieldSet & GetUnknownFields(const Message &message) const
Definition: bloaty/third_party/protobuf/src/google/protobuf/generated_message_reflection.cc:232
google::protobuf::python::PyEnumDescriptor_Type
PyTypeObject PyEnumDescriptor_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1158
google::protobuf::python::CopyToPythonProto
static PyObject * CopyToPythonProto(const DescriptorClass *descriptor, PyObject *target)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:287
arg
Definition: cmdline.cc:40
number
int32_t number
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:850
EnumValueDescriptor
Definition: protobuf/php/ext/google/protobuf/def.c:63
google::protobuf::MethodDescriptor::service
const ServiceDescriptor * service() const
google::protobuf::python::field_descriptor::GetCppType
static PyObject * GetCppType(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:764
gen_synthetic_protos.base
base
Definition: gen_synthetic_protos.py:31
google::protobuf::python::field_descriptor::GetID
static PyObject * GetID(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:780
Py_TYPE
#define Py_TYPE(ob)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:158
phone_pb2.containing_type
containing_type
Definition: phone_pb2.py:199
google::protobuf::python::field_descriptor::GetExtensionScope
static PyObject * GetExtensionScope(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:906
google::protobuf::python::message_descriptor::GetExtensions
static PyObject * GetExtensions(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:521
google::protobuf::FieldDescriptor::CPPTYPE_UINT64
@ CPPTYPE_UINT64
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:557
EnumOptions::default_instance
static const EnumOptions & default_instance()
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.cc:8331
FileDescriptorProto
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:501
google::protobuf::python::enum_descriptor::NewEnumValuesByName
PyObject * NewEnumValuesByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1375
google::protobuf::python::message_factory::GetOrCreateMessageClass
CMessageClass * GetOrCreateMessageClass(PyMessageFactory *self, const Descriptor *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message_factory.cc:155
google::protobuf::python::field_descriptor::GetLabel
static PyObject * GetLabel(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:768
EnumDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:143
google::protobuf::python::field_descriptor::SetEnumType
static int SetEnumType(PyBaseDescriptor *self, PyObject *value, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:873
google::protobuf::MethodDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1234
google::protobuf::python::PyMessageDescriptor_Type
PyTypeObject PyMessageDescriptor_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:688
google::protobuf::python::method_descriptor::GetIndex
static PyObject * GetIndex(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1792
google::protobuf::Service
Definition: bloaty/third_party/protobuf/src/google/protobuf/service.h:132
google::protobuf::python::cmessage::AssureWritable
int AssureWritable(CMessage *self)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.cc:898
google::protobuf::python::descriptor::Dealloc
static void Dealloc(PyObject *pself)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:397
google::protobuf::python::method_descriptor::GetOutputType
static PyObject * GetOutputType(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1807
google::protobuf::python::message_descriptor::NewMessageFieldsByName
PyObject * NewMessageFieldsByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1016
google::protobuf::python::GetOrBuildOptions
static PyObject * GetOrBuildOptions(const DescriptorClass *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:215
google::protobuf::python::descriptor::GcClear
static int GcClear(PyObject *pself)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:411
google::protobuf::python::PyFieldDescriptor_Type
PyTypeObject PyFieldDescriptor_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1003
google::protobuf::python::message_descriptor::NewMessageFieldsSeq
PyObject * NewMessageFieldsSeq(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1029
google::protobuf::python::service_descriptor::GetFile
static PyObject * GetFile(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1665
google::protobuf::python::GetFileDescriptor
const FileDescriptor * GetFileDescriptor(const DescriptorClass *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:172
google::protobuf::python::PyFileDescriptor_FromDescriptor
PyObject * PyFileDescriptor_FromDescriptor(const FileDescriptor *file_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1496
google::protobuf::FieldDescriptor::CPPTYPE_INT64
@ CPPTYPE_INT64
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:555
google::protobuf::python::message_descriptor::GetOneofsSeq
static PyObject * GetOneofsSeq(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:541
google::protobuf::python::method_descriptor::GetInputType
static PyObject * GetInputType(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1802
google::protobuf::python::PyDescriptorPool::descriptor_options
std::unordered_map< const void *, PyObject * > * descriptor_options
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_pool.h:82
google::protobuf::python::field_descriptor::GetCamelcaseName
static PyObject * GetCamelcaseName(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:748
google::protobuf::Message::CopyFrom
virtual void CopyFrom(const Message &from)
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.cc:97
google::protobuf::python::oneof_descriptor::GetHasOptions
static PyObject * GetHasOptions(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1561
contents
string_view contents
Definition: elf.cc:597
google::protobuf::Message
Definition: bloaty/third_party/protobuf/src/google/protobuf/message.h:205
google::protobuf::python::AddIntConstant
static bool AddIntConstant(PyTypeObject *type, const char *name, int value)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1900
google::protobuf::python::InitDescriptor
bool InitDescriptor()
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1909
google::protobuf::FieldDescriptor::CPPTYPE_UINT32
@ CPPTYPE_UINT32
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:556
google::protobuf::python::interned_descriptors
std::unordered_map< const void *, PyObject * > * interned_descriptors
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:76
google::protobuf::FieldDescriptor::CPPTYPE_FLOAT
@ CPPTYPE_FLOAT
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:559
google::protobuf::python::message_descriptor::GetFieldsByName
static PyObject * GetFieldsByName(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:492
google::protobuf::python::oneof_descriptor::SetOptions
static int SetOptions(PyBaseDescriptor *self, PyObject *value, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1578
google::protobuf::MethodDescriptor::input_type
const Descriptor * input_type() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.cc:7245
google::protobuf::python::PyFileDescriptor_AsDescriptor
const FileDescriptor * PyFileDescriptor_AsDescriptor(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1522
OneofDescriptor
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/protobuf.h:138
google::protobuf::python::PyOneofDescriptor_FromDescriptor
PyObject * PyOneofDescriptor_FromDescriptor(const OneofDescriptor *oneof_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1647
google::protobuf::python::file_descriptor::GetEnumTypesByName
static PyObject * GetEnumTypesByName(PyFileDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1364
google::protobuf::python::PyDescriptor_AsVoidPtr
const void * PyDescriptor_AsVoidPtr(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:456
EnumValueOptions
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:5287
google::protobuf::UnknownFieldSet::empty
bool empty() const
Definition: bloaty/third_party/protobuf/src/google/protobuf/unknown_field_set.h:302
google::protobuf::python::enum_descriptor::GetEnumvaluesSeq
static PyObject * GetEnumvaluesSeq(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1076
google::protobuf::python::PyEnumDescriptor_AsDescriptor
const EnumDescriptor * PyEnumDescriptor_AsDescriptor(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1198
phone_pb2.containing_oneof
containing_oneof
Definition: phone_pb2.py:204
google::protobuf::python::PyFileDescriptor_FromDescriptorWithSerializedPb
PyObject * PyFileDescriptor_FromDescriptorWithSerializedPb(const FileDescriptor *file_descriptor, PyObject *serialized_pb)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1502
google::protobuf::FieldDescriptor::CPPTYPE_BOOL
@ CPPTYPE_BOOL
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:560
index
int index
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:1184
google::protobuf::FieldDescriptor::CPPTYPE_DOUBLE
@ CPPTYPE_DOUBLE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:558
google::protobuf::python::message_descriptor::GetFieldsSeq
static PyObject * GetFieldsSeq(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:505
google::protobuf::python::file_descriptor::GetSerializedPb
static PyObject * GetSerializedPb(PyFileDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1341
google::protobuf::python::method_descriptor::GetName
static PyObject * GetName(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1784
google::protobuf::python::PyServiceDescriptor_AsDescriptor
const ServiceDescriptor * PyServiceDescriptor_AsDescriptor(PyObject *obj)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1771
google::protobuf::python::file_descriptor::GetServicesByName
static PyObject * GetServicesByName(PyFileDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1372
google::protobuf::python::PyOneofDescriptor_Type
PyTypeObject PyOneofDescriptor_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1613
google::protobuf::python::PyFileDescriptor::base
PyBaseDescriptor base
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:330
google::protobuf::python::_CalledFromGeneratedFile
bool _CalledFromGeneratedFile(int stacklevel)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:99
google::protobuf::FieldDescriptor::CPPTYPE_ENUM
@ CPPTYPE_ENUM
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:561
google::protobuf::UnknownFieldSet
Definition: bloaty/third_party/protobuf/src/google/protobuf/unknown_field_set.h:81
google::protobuf::python::message_descriptor::GetOneofsByName
static PyObject * GetOneofsByName(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:537
google::protobuf::python::StringParam
std::string StringParam
Definition: protobuf/python/google/protobuf/pyext/descriptor.h:46
A
Definition: miscompile_with_no_unique_address_test.cc:23
google::protobuf::python::Reparse
bool Reparse(PyMessageFactory *message_factory, const Message &from, Message *to)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:192
google::protobuf::File
Definition: bloaty/third_party/protobuf/src/google/protobuf/testing/file.h:46
google::protobuf::EnumValueDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1075
google::protobuf::Descriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:231
frame
static void frame(frame_handler *handler, unsigned char *payload, size_t payload_length, size_t write_length)
Definition: frame_handler_test.cc:65
desc
#define desc
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set.h:338
OneofOptions
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:4915
closure
Definition: proxy.cc:59
google::protobuf::python::method_descriptor::GetContainingService
static PyObject * GetContainingService(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1796
google::protobuf::python::file_descriptor::NewFileExtensionsByName
PyObject * NewFileExtensionsByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1649
google::protobuf::python::service_descriptor::GetMethods
static PyObject * GetMethods(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1673
input
std::string input
Definition: bloaty/third_party/protobuf/src/google/protobuf/io/tokenizer_unittest.cc:197
google::protobuf::python::message_descriptor::NewMessageOneofsByName
PyObject * NewMessageOneofsByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1304
google::protobuf::python::descriptor::Getters
static PyGetSetDef Getters[]
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:417
google::protobuf::python::file_descriptor::GetDependencies
static PyObject * GetDependencies(PyFileDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1376
pool
InternalDescriptorPool * pool
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/protobuf.h:807
google::protobuf::FileDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:1320
google::protobuf::python::field_descriptor::HasDefaultValue
static PyObject * HasDefaultValue(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:788
FieldDescriptorProto::Label_descriptor
static const ::PROTOBUF_NAMESPACE_ID::EnumDescriptor * Label_descriptor()
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.pb.h:2060
google::protobuf::python::file_descriptor::GetPackage
static PyObject * GetPackage(PyFileDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1337
google::protobuf::FieldDescriptor::CPPTYPE_MESSAGE
@ CPPTYPE_MESSAGE
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:563
google::protobuf::python::method_descriptor::CopyToProto
static PyObject * CopyToProto(PyBaseDescriptor *self, PyObject *target)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1816
google::protobuf::python::field_descriptor::GetCDescriptor
static PyObject * GetCDescriptor(PyObject *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:859
google::protobuf::python::descriptor::GcTraverse
static int GcTraverse(PyObject *pself, visitproc visit, void *arg)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:405
Field
Definition: bloaty/third_party/protobuf/src/google/protobuf/type.pb.h:446
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
google::protobuf::python::file_descriptor::NewFileServicesByName
PyObject * NewFileServicesByName(const FileDescriptor *descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1697
absl::visit
variant_internal::VisitResult< Visitor, Variants... > visit(Visitor &&vis, Variants &&... vars)
Definition: abseil-cpp/absl/types/variant.h:430
google::protobuf::python::PyMethodDescriptor_Type
PyTypeObject PyMethodDescriptor_Type
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor.cc:1843
google::protobuf::python::method_descriptor::GetOptions
static PyObject * GetOptions(PyBaseDescriptor *self)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1812
google::protobuf::python::message_descriptor::NewMessageEnumValuesByName
PyObject * NewMessageEnumValuesByName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1204
self
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END intern self
Definition: bloaty/third_party/protobuf/php/ext/google/protobuf/map.c:543
google::protobuf::python::service_descriptor::NewServiceMethodsSeq
PyObject * NewServiceMethodsSeq(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1491
int32_t
signed int int32_t
Definition: stdint-msvc2008.h:77
google::protobuf::python::message_descriptor::NewMessageFieldsByCamelcaseName
PyObject * NewMessageFieldsByCamelcaseName(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1020
google::protobuf::EnumDescriptor
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:918
enum_descriptor
VALUE enum_descriptor(VALUE self)
Definition: bloaty/third_party/protobuf/ruby/ext/google/protobuf_c/message.c:794
phone_pb2.enum_type
enum_type
Definition: phone_pb2.py:198
GetPool
static DescriptorPool * GetPool(const zval *this_ptr)
Definition: protobuf/php/ext/google/protobuf/def.c:729
google::protobuf::python::oneof_descriptor::SetHasOptions
static int SetHasOptions(PyBaseDescriptor *self, PyObject *value, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:1569
descriptor
static const char descriptor[1336]
Definition: certs.upbdefs.c:16
grpc::protobuf::ServiceDescriptor
GRPC_CUSTOM_SERVICEDESCRIPTOR ServiceDescriptor
Definition: include/grpcpp/impl/codegen/config_protobuf.h:88
setup.target
target
Definition: third_party/bloaty/third_party/protobuf/python/setup.py:179
Method
Definition: bloaty/third_party/protobuf/src/google/protobuf/api.pb.h:320
google::protobuf::python::message_factory::GetMessageClass
CMessageClass * GetMessageClass(PyMessageFactory *self, const Descriptor *message_descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message_factory.cc:223
google
Definition: bloaty/third_party/protobuf/benchmarks/util/data_proto2_to_proto3_util.h:11
google::protobuf::python::message_descriptor::NewMessageEnumsSeq
PyObject * NewMessageEnumsSeq(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1133
Message
Definition: protobuf/php/ext/google/protobuf/message.c:53
google::protobuf::python::field_descriptor::GetDefaultValue
static PyObject * GetDefaultValue(PyBaseDescriptor *self, void *closure)
Definition: protobuf/python/google/protobuf/pyext/descriptor.cc:792
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
google::protobuf.internal::cpp_type
FieldDescriptor::CppType cpp_type(FieldType type)
Definition: bloaty/third_party/protobuf/src/google/protobuf/extension_set_heavy.cc:133
google::protobuf::python::CMessage::message
Message * message
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/message.h:104
google::protobuf::FieldDescriptor::CPPTYPE_INT32
@ CPPTYPE_INT32
Definition: bloaty/third_party/protobuf/src/google/protobuf/descriptor.h:554
google::protobuf::python::enum_descriptor::NewEnumValuesSeq
PyObject * NewEnumValuesSeq(ParentDescriptor descriptor)
Definition: bloaty/third_party/protobuf/python/google/protobuf/pyext/descriptor_containers.cc:1383


grpc
Author(s):
autogenerated on Fri May 16 2025 02:58:10