Index: third_party/protobuf/python/google/protobuf/pyext/python_descriptor.h |
diff --git a/third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.h b/third_party/protobuf/python/google/protobuf/pyext/python_descriptor.h |
similarity index 58% |
rename from third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.h |
rename to third_party/protobuf/python/google/protobuf/pyext/python_descriptor.h |
index bcba82da57abfcea9f03f53807670a592daffda2..5232680f36ecfdcaa0b114621ed8741260d70342 100644 |
--- a/third_party/protobuf/src/google/protobuf/compiler/objectivec/objectivec_oneof.h |
+++ b/third_party/protobuf/python/google/protobuf/pyext/python_descriptor.h |
@@ -1,6 +1,6 @@ |
// Protocol Buffers - Google's data interchange format |
// Copyright 2008 Google Inc. All rights reserved. |
-// https://developers.google.com/protocol-buffers/ |
+// http://code.google.com/p/protobuf/ |
// |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
@@ -28,50 +28,60 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-#ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ONEOF_H__ |
-#define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ONEOF_H__ |
+// Author: petar@google.com (Petar Petrov) |
+ |
+#ifndef GOOGLE_PROTOBUF_PYTHON_DESCRIPTOR_H__ |
+#define GOOGLE_PROTOBUF_PYTHON_DESCRIPTOR_H__ |
+ |
+#include <Python.h> |
+#include <structmember.h> |
-#include <string> |
-#include <set> |
-#include <vector> |
#include <google/protobuf/descriptor.h> |
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) |
+typedef int Py_ssize_t; |
+#define PY_SSIZE_T_MAX INT_MAX |
+#define PY_SSIZE_T_MIN INT_MIN |
+#endif |
+ |
namespace google { |
namespace protobuf { |
-namespace io { |
-class Printer; // printer.h |
-} |
-} |
+namespace python { |
-namespace protobuf { |
-namespace compiler { |
-namespace objectivec { |
+typedef struct { |
+ PyObject_HEAD |
-class OneofGenerator { |
- public: |
- explicit OneofGenerator(const OneofDescriptor* descriptor); |
- ~OneofGenerator(); |
+ // The proto2 descriptor that this object represents. |
+ const google::protobuf::FieldDescriptor* descriptor; |
- void SetOneofIndexBase(int index_base); |
+ // Full name of the field (PyString). |
+ PyObject* full_name; |
- void GenerateCaseEnum(io::Printer* printer); |
+ // Name of the field (PyString). |
+ PyObject* name; |
- void GeneratePublicCasePropertyDeclaration(io::Printer* printer); |
- void GenerateClearFunctionDeclaration(io::Printer* printer); |
+ // C++ type of the field (PyLong). |
+ PyObject* cpp_type; |
- void GeneratePropertyImplementation(io::Printer* printer); |
- void GenerateClearFunctionImplementation(io::Printer* printer); |
- void GenerateDescription(io::Printer* printer); |
+ // Name of the field (PyLong). |
+ PyObject* label; |
- private: |
- const OneofDescriptor* descriptor_; |
- map<string, string> variables_; |
+ // Identity of the descriptor (PyLong used as a poiner). |
+ PyObject* id; |
+} CFieldDescriptor; |
- GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(OneofGenerator); |
-}; |
+extern PyTypeObject CFieldDescriptor_Type; |
-} // namespace objectivec |
-} // namespace compiler |
+extern PyTypeObject CDescriptorPool_Type; |
+ |
+ |
+PyObject* Python_NewCDescriptorPool(PyObject* ignored, PyObject* args); |
+PyObject* Python_BuildFile(PyObject* ignored, PyObject* args); |
+bool InitDescriptor(); |
+google::protobuf::DescriptorPool* GetDescriptorPool(); |
+ |
+} // namespace python |
} // namespace protobuf |
+ |
} // namespace google |
-#endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ONEOF_H__ |
+#endif // GOOGLE_PROTOBUF_PYTHON_DESCRIPTOR_H__ |