31 #define PY_SSIZE_T_CLEAN
34 #include <google/protobuf/message_lite.h>
35 #include <google/protobuf/pyext/descriptor.h>
36 #include <google/protobuf/pyext/descriptor_pool.h>
37 #include <google/protobuf/pyext/message.h>
38 #include <google/protobuf/pyext/message_factory.h>
39 #include <google/protobuf/proto_api.h>
52 PyObject*
desc)
const override {
56 PyObject* enum_desc)
const override {
69 PyObject* py_message_factory)
const override {
72 PyObject* NewMessageOwnedExternally(
75 msg, py_message_factory);
77 PyObject* DescriptorPool_FromPool(
86 "python-proto2 is a module that can be used to enhance proto2 Python API\n"
89 "It provides access to the protocol buffers C++ reflection API that\n"
90 "implements the basic protocol buffer functions.";
93 {
"SetAllowOversizeProtos",
95 "Enable/disable oversize proto parsing."},
99 static struct PyModuleDef
_module = {PyModuleDef_HEAD_INIT,
122 if (PyObject* api = PyCapsule_New(
125 delete (ApiImplementation*)PyCapsule_GetPointer(
128 PyModule_AddObject(
m,
"proto_API", api);