├── .gitignore ├── DAPI Injector ├── DAPI Injector.vcxproj ├── DAPI Injector.vcxproj.filters └── Source │ ├── Injector.cpp │ ├── Injector.h │ └── main.cpp ├── DAPI.sln ├── DAPI ├── DAPI.vcxproj ├── DAPI.vcxproj.filters └── Source │ ├── DLLMain.cpp │ ├── Detours.cpp │ ├── Detours.h │ ├── DiabloStructs.h │ ├── Game.h │ ├── GameData.h │ ├── Item.h │ ├── Player.h │ ├── Server.cpp │ ├── Server.h │ ├── Towner.h │ └── Trigger.h ├── DAPIBackendCore ├── DAPIBackendCore.vcxproj ├── DAPIBackendCore.vcxproj.filters ├── DAPIProtoClient.cpp └── DAPIProtoClient.h ├── DAPIFrontendClient ├── DAPIFrontendClient.vcxproj ├── DAPIFrontendClient.vcxproj.filters ├── ProtoClient.cpp └── ProtoClient.h ├── DAPILIB ├── DAPILIB.vcxproj ├── DAPILIB.vcxproj.filters └── source │ ├── Command.cpp │ ├── Command.h │ ├── DAPI.h │ ├── Enums.h │ ├── Game.cpp │ ├── Game.h │ ├── GameData.h │ ├── Item.cpp │ ├── Item.h │ ├── ItemData.h │ ├── Missile.h │ ├── MissileData.h │ ├── Monster.h │ ├── MonsterData.h │ ├── Object.h │ ├── ObjectData.h │ ├── Player.cpp │ ├── Player.h │ ├── PlayerData.cpp │ ├── PlayerData.h │ ├── Portal.cpp │ ├── Portal.h │ ├── PortalData.h │ ├── Quest.h │ ├── QuestData.h │ ├── Spell.cpp │ ├── Spell.h │ ├── Tile.cpp │ ├── Tile.h │ ├── TileData.h │ ├── Towner.cpp │ ├── Towner.h │ ├── TownerData.h │ ├── Trigger.h │ └── TriggerData.h ├── ExampleAIClient ├── ExampleAIClient.vcxproj ├── ExampleAIClient.vcxproj.filters └── main.cpp ├── Messages ├── Messages.vcxproj ├── Messages.vcxproj.filters ├── command.proto ├── data.proto ├── game.proto ├── generated │ └── cpp │ │ ├── command.pb.cc │ │ ├── command.pb.h │ │ ├── data.pb.cc │ │ ├── data.pb.h │ │ ├── game.pb.cc │ │ ├── game.pb.h │ │ ├── init.pb.cc │ │ ├── init.pb.h │ │ ├── message.pb.cc │ │ └── message.pb.h ├── init.proto ├── message.proto └── proto │ └── protoc-3.6.0-win32 │ ├── bin │ └── protoc.exe │ ├── include │ └── google │ │ └── protobuf │ │ ├── any.proto │ │ ├── api.proto │ │ ├── compiler │ │ └── plugin.proto │ │ ├── descriptor.proto │ │ ├── duration.proto │ │ ├── empty.proto │ │ ├── field_mask.proto │ │ ├── source_context.proto │ │ ├── struct.proto │ │ ├── timestamp.proto │ │ ├── type.proto │ │ └── wrappers.proto │ └── readme.txt ├── New DAPI ├── New DAPI.vcxproj └── New DAPI.vcxproj.filters ├── README ├── SFML-2.5.1 ├── SFML.vcxproj ├── SFML.vcxproj.filters ├── include │ └── SFML │ │ ├── Config.hpp │ │ ├── Network.hpp │ │ └── Network │ │ ├── IpAddress.hpp │ │ ├── Packet.hpp │ │ ├── Socket.hpp │ │ ├── SocketHandle.hpp │ │ ├── SocketSelector.hpp │ │ ├── TcpListener.hpp │ │ ├── TcpSocket.hpp │ │ └── UdpSocket.hpp ├── license.md ├── readme.md └── src │ └── SFML │ └── Network │ ├── IpAddress.cpp │ ├── Packet.cpp │ ├── Socket.cpp │ ├── SocketImpl.hpp │ ├── SocketSelector.cpp │ ├── TcpListener.cpp │ ├── TcpSocket.cpp │ ├── UdpSocket.cpp │ ├── Unix │ ├── SocketImpl.hpp │ └── SocketImplUnix.cpp │ └── Win32 │ ├── SFML_Winsock.hpp │ ├── SocketImpl.hpp │ └── SocketImplWin32.cpp └── libprotobuf-lite ├── libprotobuf-lite.cmake ├── libprotobuf-lite.vcxproj ├── libprotobuf-lite.vcxproj.filters └── src ├── Makefile.am ├── README.md ├── google └── protobuf │ ├── any.cc │ ├── any.h │ ├── any.pb.cc │ ├── any.pb.h │ ├── any.proto │ ├── any_test.proto │ ├── api.pb.cc │ ├── api.pb.h │ ├── api.proto │ ├── arena.cc │ ├── arena.h │ ├── arena_impl.h │ ├── arena_test_util.cc │ ├── arena_test_util.h │ ├── arenastring.cc │ ├── arenastring.h │ ├── compiler │ ├── annotation_test_util.cc │ ├── annotation_test_util.h │ ├── code_generator.cc │ ├── code_generator.h │ ├── command_line_interface.cc │ ├── command_line_interface.h │ ├── command_line_interface_unittest.cc │ ├── cpp │ │ ├── cpp_bootstrap_unittest.cc │ │ ├── cpp_enum.cc │ │ ├── cpp_enum.h │ │ ├── cpp_enum_field.cc │ │ ├── cpp_enum_field.h │ │ ├── cpp_extension.cc │ │ ├── cpp_extension.h │ │ ├── cpp_field.cc │ │ ├── cpp_field.h │ │ ├── cpp_file.cc │ │ ├── cpp_file.h │ │ ├── cpp_generator.cc │ │ ├── cpp_generator.h │ │ ├── cpp_helpers.cc │ │ ├── cpp_helpers.h │ │ ├── cpp_map_field.cc │ │ ├── cpp_map_field.h │ │ ├── cpp_message.cc │ │ ├── cpp_message.h │ │ ├── cpp_message_field.cc │ │ ├── cpp_message_field.h │ │ ├── cpp_message_layout_helper.h │ │ ├── cpp_move_unittest.cc │ │ ├── cpp_options.h │ │ ├── cpp_padding_optimizer.cc │ │ ├── cpp_padding_optimizer.h │ │ ├── cpp_plugin_unittest.cc │ │ ├── cpp_primitive_field.cc │ │ ├── cpp_primitive_field.h │ │ ├── cpp_service.cc │ │ ├── cpp_service.h │ │ ├── cpp_string_field.cc │ │ ├── cpp_string_field.h │ │ ├── cpp_test_bad_identifiers.proto │ │ ├── cpp_test_large_enum_value.proto │ │ ├── cpp_unittest.cc │ │ ├── cpp_unittest.h │ │ ├── cpp_unittest.inc │ │ └── metadata_test.cc │ ├── csharp │ │ ├── csharp_bootstrap_unittest.cc │ │ ├── csharp_doc_comment.cc │ │ ├── csharp_doc_comment.h │ │ ├── csharp_enum.cc │ │ ├── csharp_enum.h │ │ ├── csharp_enum_field.cc │ │ ├── csharp_enum_field.h │ │ ├── csharp_field_base.cc │ │ ├── csharp_field_base.h │ │ ├── csharp_generator.cc │ │ ├── csharp_generator.h │ │ ├── csharp_generator_unittest.cc │ │ ├── csharp_helpers.cc │ │ ├── csharp_helpers.h │ │ ├── csharp_map_field.cc │ │ ├── csharp_map_field.h │ │ ├── csharp_message.cc │ │ ├── csharp_message.h │ │ ├── csharp_message_field.cc │ │ ├── csharp_message_field.h │ │ ├── csharp_names.h │ │ ├── csharp_options.h │ │ ├── csharp_primitive_field.cc │ │ ├── csharp_primitive_field.h │ │ ├── csharp_reflection_class.cc │ │ ├── csharp_reflection_class.h │ │ ├── csharp_repeated_enum_field.cc │ │ ├── csharp_repeated_enum_field.h │ │ ├── csharp_repeated_message_field.cc │ │ ├── csharp_repeated_message_field.h │ │ ├── csharp_repeated_primitive_field.cc │ │ ├── csharp_repeated_primitive_field.h │ │ ├── csharp_source_generator_base.cc │ │ ├── csharp_source_generator_base.h │ │ ├── csharp_wrapper_field.cc │ │ └── csharp_wrapper_field.h │ ├── importer.cc │ ├── importer.h │ ├── importer_unittest.cc │ ├── java │ │ ├── java_context.cc │ │ ├── java_context.h │ │ ├── java_doc_comment.cc │ │ ├── java_doc_comment.h │ │ ├── java_doc_comment_unittest.cc │ │ ├── java_enum.cc │ │ ├── java_enum.h │ │ ├── java_enum_field.cc │ │ ├── java_enum_field.h │ │ ├── java_enum_field_lite.cc │ │ ├── java_enum_field_lite.h │ │ ├── java_enum_lite.cc │ │ ├── java_enum_lite.h │ │ ├── java_extension.cc │ │ ├── java_extension.h │ │ ├── java_extension_lite.cc │ │ ├── java_extension_lite.h │ │ ├── java_field.cc │ │ ├── java_field.h │ │ ├── java_file.cc │ │ ├── java_file.h │ │ ├── java_generator.cc │ │ ├── java_generator.h │ │ ├── java_generator_factory.cc │ │ ├── java_generator_factory.h │ │ ├── java_helpers.cc │ │ ├── java_helpers.h │ │ ├── java_lazy_message_field.cc │ │ ├── java_lazy_message_field.h │ │ ├── java_lazy_message_field_lite.cc │ │ ├── java_lazy_message_field_lite.h │ │ ├── java_map_field.cc │ │ ├── java_map_field.h │ │ ├── java_map_field_lite.cc │ │ ├── java_map_field_lite.h │ │ ├── java_message.cc │ │ ├── java_message.h │ │ ├── java_message_builder.cc │ │ ├── java_message_builder.h │ │ ├── java_message_builder_lite.cc │ │ ├── java_message_builder_lite.h │ │ ├── java_message_field.cc │ │ ├── java_message_field.h │ │ ├── java_message_field_lite.cc │ │ ├── java_message_field_lite.h │ │ ├── java_message_lite.cc │ │ ├── java_message_lite.h │ │ ├── java_name_resolver.cc │ │ ├── java_name_resolver.h │ │ ├── java_names.h │ │ ├── java_options.h │ │ ├── java_plugin_unittest.cc │ │ ├── java_primitive_field.cc │ │ ├── java_primitive_field.h │ │ ├── java_primitive_field_lite.cc │ │ ├── java_primitive_field_lite.h │ │ ├── java_service.cc │ │ ├── java_service.h │ │ ├── java_shared_code_generator.cc │ │ ├── java_shared_code_generator.h │ │ ├── java_string_field.cc │ │ ├── java_string_field.h │ │ ├── java_string_field_lite.cc │ │ └── java_string_field_lite.h │ ├── js │ │ ├── embed.cc │ │ ├── js_generator.cc │ │ ├── js_generator.h │ │ ├── well_known_types │ │ │ ├── any.js │ │ │ ├── struct.js │ │ │ └── timestamp.js │ │ └── well_known_types_embed.h │ ├── main.cc │ ├── mock_code_generator.cc │ ├── mock_code_generator.h │ ├── objectivec │ │ ├── objectivec_enum.cc │ │ ├── objectivec_enum.h │ │ ├── objectivec_enum_field.cc │ │ ├── objectivec_enum_field.h │ │ ├── objectivec_extension.cc │ │ ├── objectivec_extension.h │ │ ├── objectivec_field.cc │ │ ├── objectivec_field.h │ │ ├── objectivec_file.cc │ │ ├── objectivec_file.h │ │ ├── objectivec_generator.cc │ │ ├── objectivec_generator.h │ │ ├── objectivec_helpers.cc │ │ ├── objectivec_helpers.h │ │ ├── objectivec_helpers_unittest.cc │ │ ├── objectivec_map_field.cc │ │ ├── objectivec_map_field.h │ │ ├── objectivec_message.cc │ │ ├── objectivec_message.h │ │ ├── objectivec_message_field.cc │ │ ├── objectivec_message_field.h │ │ ├── objectivec_oneof.cc │ │ ├── objectivec_oneof.h │ │ ├── objectivec_primitive_field.cc │ │ └── objectivec_primitive_field.h │ ├── package_info.h │ ├── parser.cc │ ├── parser.h │ ├── parser_unittest.cc │ ├── php │ │ ├── php_generator.cc │ │ └── php_generator.h │ ├── plugin.cc │ ├── plugin.h │ ├── plugin.pb.cc │ ├── plugin.pb.h │ ├── plugin.proto │ ├── python │ │ ├── python_generator.cc │ │ ├── python_generator.h │ │ └── python_plugin_unittest.cc │ ├── ruby │ │ ├── ruby_generated_code.proto │ │ ├── ruby_generated_code_pb.rb │ │ ├── ruby_generator.cc │ │ ├── ruby_generator.h │ │ └── ruby_generator_unittest.cc │ ├── subprocess.cc │ ├── subprocess.h │ ├── test_plugin.cc │ ├── zip_output_unittest.sh │ ├── zip_writer.cc │ └── zip_writer.h │ ├── descriptor.cc │ ├── descriptor.h │ ├── descriptor.pb.cc │ ├── descriptor.pb.h │ ├── descriptor.proto │ ├── descriptor_database.cc │ ├── descriptor_database.h │ ├── duration.pb.cc │ ├── duration.pb.h │ ├── duration.proto │ ├── dynamic_message.cc │ ├── dynamic_message.h │ ├── empty.pb.cc │ ├── empty.pb.h │ ├── empty.proto │ ├── extension_set.cc │ ├── extension_set.h │ ├── extension_set_heavy.cc │ ├── field_mask.pb.cc │ ├── field_mask.pb.h │ ├── field_mask.proto │ ├── generated_enum_reflection.h │ ├── generated_enum_util.h │ ├── generated_message_reflection.cc │ ├── generated_message_reflection.h │ ├── generated_message_table_driven.cc │ ├── generated_message_table_driven.h │ ├── generated_message_table_driven_lite.cc │ ├── generated_message_table_driven_lite.h │ ├── generated_message_util.cc │ ├── generated_message_util.h │ ├── has_bits.h │ ├── implicit_weak_message.cc │ ├── implicit_weak_message.h │ ├── inlined_string_field.h │ ├── io │ ├── coded_stream.cc │ ├── coded_stream.h │ ├── coded_stream_inl.h │ ├── gzip_stream.cc │ ├── gzip_stream_unittest.sh │ ├── package_info.h │ ├── printer.cc │ ├── printer.h │ ├── strtod.cc │ ├── strtod.h │ ├── tokenizer.cc │ ├── tokenizer.h │ ├── zero_copy_stream.cc │ ├── zero_copy_stream.h │ ├── zero_copy_stream_impl.cc │ ├── zero_copy_stream_impl.h │ ├── zero_copy_stream_impl_lite.cc │ └── zero_copy_stream_impl_lite.h │ ├── map.h │ ├── map_entry.h │ ├── map_entry_lite.h │ ├── map_field.cc │ ├── map_field.h │ ├── map_field_inl.h │ ├── map_field_lite.h │ ├── map_lite_unittest.proto │ ├── map_proto2_unittest.proto │ ├── map_test_util_impl.h │ ├── map_type_handler.h │ ├── map_unittest.proto │ ├── message.cc │ ├── message.h │ ├── message_lite.cc │ ├── message_lite.h │ ├── message_unittest.inc │ ├── metadata.h │ ├── metadata_lite.h │ ├── package_info.h │ ├── reflection.h │ ├── reflection_internal.h │ ├── reflection_ops.cc │ ├── reflection_ops.h │ ├── repeated_field.cc │ ├── repeated_field.h │ ├── service.cc │ ├── service.h │ ├── source_context.pb.cc │ ├── source_context.pb.h │ ├── source_context.proto │ ├── struct.pb.cc │ ├── struct.pb.h │ ├── struct.proto │ ├── stubs │ ├── bytestream.cc │ ├── bytestream.h │ ├── callback.h │ ├── casts.h │ ├── common.cc │ ├── common.h │ ├── fastmem.h │ ├── hash.h │ ├── int128.cc │ ├── int128.h │ ├── io_win32.cc │ ├── io_win32.h │ ├── logging.h │ ├── macros.h │ ├── map_util.h │ ├── mathlimits.cc │ ├── mathlimits.h │ ├── mathutil.h │ ├── mutex.h │ ├── once.h │ ├── platform_macros.h │ ├── port.h │ ├── singleton.h │ ├── status.cc │ ├── status.h │ ├── status_macros.h │ ├── statusor.cc │ ├── statusor.h │ ├── stl_util.h │ ├── stringpiece.cc │ ├── stringpiece.h │ ├── stringprintf.cc │ ├── stringprintf.h │ ├── structurally_valid.cc │ ├── strutil.cc │ ├── strutil.h │ ├── substitute.cc │ ├── substitute.h │ ├── template_util.h │ ├── time.cc │ └── time.h │ ├── test_messages_proto2.proto │ ├── test_messages_proto3.proto │ ├── test_util.inc │ ├── testdata │ ├── bad_utf8_string │ ├── golden_message │ ├── golden_message_maps │ ├── golden_message_oneof_implemented │ ├── golden_message_proto3 │ ├── golden_packed_fields_message │ ├── map_test_data.txt │ ├── text_format_unittest_data.txt │ ├── text_format_unittest_data_oneof_implemented.txt │ ├── text_format_unittest_data_pointy.txt │ ├── text_format_unittest_data_pointy_oneof.txt │ ├── text_format_unittest_extensions_data.txt │ └── text_format_unittest_extensions_data_pointy.txt │ ├── testing │ ├── file.cc │ └── file.h │ ├── text_format.cc │ ├── text_format.h │ ├── timestamp.pb.cc │ ├── timestamp.pb.h │ ├── timestamp.proto │ ├── type.pb.cc │ ├── type.pb.h │ ├── type.proto │ ├── unittest.proto │ ├── unittest_arena.proto │ ├── unittest_custom_options.proto │ ├── unittest_drop_unknown_fields.proto │ ├── unittest_embed_optimize_for.proto │ ├── unittest_empty.proto │ ├── unittest_enormous_descriptor.proto │ ├── unittest_import.proto │ ├── unittest_import_lite.proto │ ├── unittest_import_public.proto │ ├── unittest_import_public_lite.proto │ ├── unittest_lazy_dependencies.proto │ ├── unittest_lazy_dependencies_custom_option.proto │ ├── unittest_lazy_dependencies_enum.proto │ ├── unittest_lite.proto │ ├── unittest_lite_imports_nonlite.proto │ ├── unittest_mset.proto │ ├── unittest_mset_wire_format.proto │ ├── unittest_no_arena.proto │ ├── unittest_no_arena_import.proto │ ├── unittest_no_arena_lite.proto │ ├── unittest_no_field_presence.proto │ ├── unittest_no_generic_services.proto │ ├── unittest_optimize_for.proto │ ├── unittest_preserve_unknown_enum.proto │ ├── unittest_preserve_unknown_enum2.proto │ ├── unittest_proto3.proto │ ├── unittest_proto3_arena.proto │ ├── unittest_proto3_arena_lite.proto │ ├── unittest_proto3_lite.proto │ ├── unittest_well_known_types.proto │ ├── unknown_field_set.cc │ ├── unknown_field_set.h │ ├── util │ ├── delimited_message_util.cc │ ├── delimited_message_util.h │ ├── field_comparator.cc │ ├── field_comparator.h │ ├── field_mask_util.cc │ ├── field_mask_util.h │ ├── internal │ │ ├── constants.h │ │ ├── datapiece.cc │ │ ├── datapiece.h │ │ ├── default_value_objectwriter.cc │ │ ├── default_value_objectwriter.h │ │ ├── error_listener.cc │ │ ├── error_listener.h │ │ ├── field_mask_utility.cc │ │ ├── field_mask_utility.h │ │ ├── json_escaping.cc │ │ ├── json_escaping.h │ │ ├── json_objectwriter.cc │ │ ├── json_objectwriter.h │ │ ├── json_stream_parser.cc │ │ ├── json_stream_parser.h │ │ ├── location_tracker.h │ │ ├── object_location_tracker.h │ │ ├── object_source.h │ │ ├── object_writer.cc │ │ ├── object_writer.h │ │ ├── proto_writer.cc │ │ ├── proto_writer.h │ │ ├── protostream_objectsource.cc │ │ ├── protostream_objectsource.h │ │ ├── protostream_objectwriter.cc │ │ ├── protostream_objectwriter.h │ │ ├── structured_objectwriter.h │ │ ├── testdata │ │ │ ├── anys.proto │ │ │ ├── books.proto │ │ │ ├── default_value.proto │ │ │ ├── default_value_test.proto │ │ │ ├── field_mask.proto │ │ │ ├── maps.proto │ │ │ ├── oneofs.proto │ │ │ ├── proto3.proto │ │ │ ├── struct.proto │ │ │ ├── timestamp_duration.proto │ │ │ └── wrappers.proto │ │ ├── type_info.cc │ │ ├── type_info.h │ │ ├── type_info_test_helper.cc │ │ ├── type_info_test_helper.h │ │ ├── utility.cc │ │ └── utility.h │ ├── json_format_proto3.proto │ ├── json_util.cc │ ├── json_util.h │ ├── message_differencer.cc │ ├── message_differencer.h │ ├── message_differencer_unittest.proto │ ├── package_info.h │ ├── time_util.cc │ ├── time_util.h │ ├── type_resolver.h │ ├── type_resolver_util.cc │ └── type_resolver_util.h │ ├── wire_format.cc │ ├── wire_format.h │ ├── wire_format_lite.cc │ ├── wire_format_lite.h │ ├── wire_format_lite_inl.h │ ├── wrappers.pb.cc │ ├── wrappers.pb.h │ └── wrappers.proto ├── libprotobuf-lite.map ├── libprotobuf.map └── libprotoc.map /.gitignore: -------------------------------------------------------------------------------- 1 | *.user 2 | *.sdf 3 | *.suo 4 | *.log 5 | Debug 6 | Release 7 | *.VC.db 8 | *.VC.opendb 9 | .vs 10 | 11 | NiteKat/ 12 | 13 | -------------------------------------------------------------------------------- /DAPI Injector/DAPI Injector.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | Header Files 28 | 29 | 30 | -------------------------------------------------------------------------------- /DAPI Injector/Source/Injector.cpp: -------------------------------------------------------------------------------- 1 | #include "Injector.h" 2 | 3 | int inject() 4 | { 5 | bool windowFound = true; 6 | auto gameWindow = FindWindowA(NULL, "Diablo"); 7 | if (!gameWindow) 8 | return 1; 9 | 10 | auto dll_path = "DAPI.dll"; 11 | DWORD processID; 12 | DWORD hLibModule; 13 | GetWindowThreadProcessId(gameWindow, &processID); 14 | if (!processID) 15 | return 2; 16 | 17 | auto process = OpenProcess(PROCESS_ALL_ACCESS, false, processID); 18 | if (!process) 19 | return 3; 20 | 21 | auto vae_return = VirtualAllocEx(process, NULL, sizeof(dll_path), MEM_COMMIT, PAGE_READWRITE); 22 | if (!vae_return) 23 | return 4; 24 | 25 | if (!WriteProcessMemory(process, vae_return, (void*)dll_path, sizeof(dll_path), NULL)) 26 | return 5; 27 | 28 | auto hKernel32 = GetModuleHandleA("Kernel32"); 29 | HANDLE thread; 30 | thread = CreateRemoteThread(process, NULL, 0, (LPTHREAD_START_ROUTINE)GetProcAddress(hKernel32, "LoadLibraryA"), vae_return, 0, NULL); 31 | WaitForSingleObject(thread, INFINITE); 32 | GetExitCodeThread(thread, &hLibModule); 33 | 34 | CloseHandle(thread); 35 | VirtualFreeEx(process, vae_return, sizeof(dll_path), MEM_RELEASE); 36 | return 0; 37 | } -------------------------------------------------------------------------------- /DAPI Injector/Source/Injector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | int inject(); -------------------------------------------------------------------------------- /DAPI/DAPI.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | 29 | 30 | Header Files 31 | 32 | 33 | Header Files 34 | 35 | 36 | Header Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | Header Files 49 | 50 | 51 | Header Files 52 | 53 | 54 | Header Files 55 | 56 | 57 | -------------------------------------------------------------------------------- /DAPI/Source/Detours.cpp: -------------------------------------------------------------------------------- 1 | #include "Detours.h" 2 | 3 | void PlaceDetour(DWORD dwAddressToPatch, DWORD dwDetourAddress, DWORD dwPadSize, BOOL bFlag) 4 | { 5 | DWORD dwOldProtect = NULL; 6 | 7 | VirtualProtect((LPVOID)dwAddressToPatch, (dwPadSize + 5), PAGE_EXECUTE_READWRITE, &dwOldProtect); 8 | 9 | if (bFlag) { 10 | *(BYTE*)(dwAddressToPatch) = 0xE9; 11 | } 12 | else 13 | { 14 | *(BYTE*)(dwAddressToPatch) = 0XE8; 15 | } 16 | *(DWORD*)(dwAddressToPatch + 1) = ((dwDetourAddress - dwAddressToPatch) - 5); 17 | for (DWORD i = dwPadSize; i > 0; i--) 18 | { 19 | *(BYTE*)(dwAddressToPatch + 5 + i) = 0x90; 20 | } 21 | 22 | VirtualProtect((LPVOID)dwAddressToPatch, (dwPadSize + 5), dwOldProtect, &dwOldProtect); 23 | } 24 | 25 | void Patch(DWORD dst, const char* src, int size) 26 | { 27 | //return; 28 | DWORD oldprotect; 29 | VirtualProtect((LPVOID)dst, size, PAGE_EXECUTE_READWRITE, &oldprotect); 30 | memcpy((LPVOID)dst, src, size); 31 | VirtualProtect((LPVOID)dst, size, oldprotect, &oldprotect); 32 | } -------------------------------------------------------------------------------- /DAPI/Source/Detours.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN 4 | 5 | #include 6 | #include 7 | 8 | void PlaceDetour(DWORD dwAddressToPatch, DWORD dwDetourAddress, DWORD dwPadSize, BOOL bFlag); 9 | 10 | void Patch(DWORD dst, const char* src, int size); -------------------------------------------------------------------------------- /DAPI/Source/Game.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Server.h" 4 | 5 | namespace DAPI 6 | { 7 | struct Game 8 | { 9 | Server server; 10 | }; 11 | } -------------------------------------------------------------------------------- /DAPI/Source/GameData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include "Player.h" 7 | #include "Item.h" 8 | #include "Towner.h" 9 | #include "Trigger.h" 10 | 11 | namespace DAPI 12 | { 13 | enum struct StoreOption 14 | { 15 | TALK, 16 | IDENTIFYANITEM, 17 | EXIT, 18 | HEAL, 19 | BUYITEMS, 20 | WIRTPEEK, 21 | BUYBASIC, 22 | BUYPREMIUM, 23 | SELL, 24 | REPAIR, 25 | RECHARGE, 26 | BACK 27 | }; 28 | 29 | enum struct TalkID { 30 | NONE = 0x0, 31 | SMITH = 0x1, 32 | SBUY = 0x2, 33 | SSELL = 0x3, 34 | SREPAIR = 0x4, 35 | WITCH = 0x5, 36 | WBUY = 0x6, 37 | WSELL = 0x7, 38 | WRECHARGE = 0x8, 39 | NOMONEY = 0x9, 40 | NOROOM = 0xA, 41 | CONFIRM = 0xB, 42 | BOY = 0xC, 43 | BBOY = 0xD, 44 | HEALER = 0xE, 45 | STORY = 0xF, 46 | HBUY = 0x10, 47 | SIDENTIFY = 0x11, 48 | SPBUY = 0x12, 49 | GOSSIP = 0x13, 50 | IDSHOW = 0x14, 51 | TAVERN = 0x15, 52 | DRUNK = 0x16, 53 | BARMAID = 0x17, 54 | }; 55 | 56 | struct GameData 57 | { 58 | int player; 59 | char stextflag; 60 | int pauseMode; 61 | bool menuOpen; 62 | int pcurs; 63 | bool chrflag; 64 | bool invflag; 65 | bool qtextflag; 66 | int currlevel; 67 | bool setlevel; 68 | 69 | std::map playerList; 70 | std::vector itemList; 71 | std::vector groundItems; 72 | std::map townerList; 73 | std::vector storeList; 74 | std::vector storeItems; 75 | std::vector triggerList; 76 | }; 77 | } -------------------------------------------------------------------------------- /DAPI/Source/Item.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "DiabloStructs.h" 5 | 6 | namespace DAPI 7 | { 8 | struct ItemData 9 | { 10 | bool compare(DiabloInternal::ItemStruct& item) { 11 | return item._iSeed == _iSeed && item._iCreateInfo == _iCreateInfo && item.IDidx == IDidx; 12 | } 13 | 14 | int ID; 15 | 16 | int _iSeed; 17 | int _iCreateInfo; 18 | int _itype; 19 | int _ix; 20 | int _iy; 21 | 22 | BOOL _iIdentified; 23 | char _iMagical; 24 | char _iName[64]; 25 | char _iIName[64]; 26 | char _iClass; 27 | int _iCurs; 28 | int _ivalue; 29 | int _iMinDam; 30 | int _iMaxDam; 31 | int _iAC; 32 | int _iFlags; 33 | int _iMiscId; 34 | int _iSpell; 35 | 36 | int _iCharges; 37 | int _iMaxCharges; 38 | 39 | int _iDurability; 40 | int _iMaxDur; 41 | 42 | int _iPLDam; 43 | int _iPLToHit; 44 | int _iPLAC; 45 | int _iPLStr; 46 | int _iPLMag; 47 | int _iPLDex; 48 | int _iPLVit; 49 | int _iPLFR; 50 | int _iPLLR; 51 | int _iPLMR; 52 | int _iPLMana; 53 | int _iPLHP; 54 | int _iPLDamMod; 55 | int _iPLGetHit; 56 | int _iPLLight; 57 | char _iSplLvlAdd; 58 | 59 | int _iFMinDam; 60 | int _iFMaxDam; 61 | int _iLMinDam; 62 | int _iLMaxDam; 63 | 64 | char _iPrePower; 65 | char _iSufPower; 66 | 67 | char _iMinStr; 68 | char _iMinMag; 69 | char _iMinDex; 70 | BOOL _iStatFlag; 71 | int IDidx; 72 | }; 73 | } -------------------------------------------------------------------------------- /DAPI/Source/Player.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Item.h" 3 | 4 | namespace DAPI 5 | { 6 | #define NUM_INVLOC 7 7 | #define MAXINV 40 8 | #define MAXSPD 8 9 | 10 | struct PlayerData 11 | { 12 | int _pmode; 13 | int pnum; 14 | int plrlevel; 15 | int _px; 16 | int _py; 17 | int _pfutx; 18 | int _pfuty; 19 | int _pdir; 20 | 21 | int _pRSpell; 22 | char _pRSplType; 23 | 24 | char _pSplLvl[64]; 25 | unsigned __int64 _pMemSpells; 26 | unsigned __int64 _pAblSpells; 27 | unsigned __int64 _pScrlSpells; 28 | 29 | char _pName[32]; 30 | char _pClass; 31 | 32 | int _pStrength; 33 | int _pBaseStr; 34 | int _pMagic; 35 | int _pBaseMag; 36 | int _pDexterity; 37 | int _pBaseDex; 38 | int _pVitality; 39 | int _pBaseVit; 40 | 41 | int _pStatPts; 42 | 43 | int _pDamageMod; 44 | 45 | int _pHitPoints; 46 | int _pMaxHP; 47 | int _pMana; 48 | int _pMaxMana; 49 | char _pLevel; 50 | int _pExperience; 51 | 52 | char _pArmorClass; 53 | 54 | char _pMagResist; 55 | char _pFireResist; 56 | char _pLightResist; 57 | 58 | int _pGold; 59 | 60 | std::map InvBody; 61 | int InvList[MAXINV]; 62 | int InvGrid[MAXINV]; 63 | std::map SpdList; 64 | int HoldItem; 65 | 66 | int _pIMinDam; 67 | int _pIMaxDam; 68 | int _pIBonusDam; 69 | int _pIAC; 70 | int _pIBonusToHit; 71 | int _pIBonusAC; 72 | int _pIBonusDamMod; 73 | bool pManaShield; 74 | }; 75 | } -------------------------------------------------------------------------------- /DAPI/Source/Towner.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace DAPI 4 | { 5 | enum struct TalkerType { 6 | SMITH = 0x0, 7 | HEALER = 0x1, 8 | DEADGUY = 0x2, 9 | TAVERN = 0x3, 10 | STORY = 0x4, 11 | DRUNK = 0x5, 12 | WITCH = 0x6, 13 | BMAID = 0x7, 14 | PEGBOY = 0x8, 15 | COW = 0x9, 16 | PRIEST = 0xA, 17 | NONE = 0xB 18 | }; 19 | 20 | struct TownerData 21 | { 22 | int ID; 23 | TalkerType _ttype; 24 | int _tx; 25 | int _ty; 26 | char _tName[32]; 27 | }; 28 | } -------------------------------------------------------------------------------- /DAPI/Source/Trigger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "DiabloStructs.h" 3 | 4 | namespace DAPI 5 | { 6 | struct TriggerData 7 | { 8 | bool compare(DiabloInternal::TriggerStruct& other) { return (other._tlvl == lvl && other._tmsg == type && other._tx == x && other._ty == y); } 9 | 10 | int ID; 11 | int x; 12 | int y; 13 | int lvl; 14 | int type; 15 | }; 16 | } -------------------------------------------------------------------------------- /DAPIBackendCore/DAPIBackendCore.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | -------------------------------------------------------------------------------- /DAPIBackendCore/DAPIProtoClient.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | #pragma warning(push, 0) 9 | #include "..\Messages\generated\cpp\message.pb.h" 10 | #pragma warning(pop) 11 | 12 | namespace DAPI 13 | { 14 | struct DAPIProtoClient 15 | { 16 | DAPIProtoClient(); 17 | 18 | void checkForConnection(); 19 | void lookForServer(); 20 | void transmitMessages(); 21 | void receiveMessages(); 22 | void disconnect(); 23 | void initListen(); 24 | void stopListen(); 25 | 26 | void queueMessage(std::unique_ptr newMessage); 27 | std::unique_ptr getNextMessage(); 28 | 29 | bool isConnected() const; 30 | int messageQueueSize() const; 31 | 32 | private: 33 | sf::UdpSocket udpSocket; 34 | sf::TcpSocket tcpSocket; 35 | sf::TcpListener tcpListener; 36 | sf::SocketSelector socketSelector; 37 | std::deque> messageQueue; 38 | std::mt19937 mt; 39 | 40 | int getRandomInteger(int min, int max) { 41 | std::uniform_int_distribution randomNumber(min, max); 42 | return randomNumber(mt); 43 | } 44 | 45 | unsigned short connectionPort; 46 | bool udpbound; 47 | }; 48 | } -------------------------------------------------------------------------------- /DAPIFrontendClient/DAPIFrontendClient.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | -------------------------------------------------------------------------------- /DAPIFrontendClient/ProtoClient.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "../DAPILIB/source/Command.h" 5 | #include "../DAPIBackendCore/DAPIProtoClient.h" 6 | #include "../DAPILIB/source/Game.h" 7 | 8 | namespace DAPI 9 | { 10 | struct ProtoClient 11 | { 12 | friend struct Game; 13 | ProtoClient(); 14 | 15 | bool isConnected() const; 16 | bool connect(); 17 | void disconnect(); 18 | void update(Game &game); 19 | bool issueCommand(Command command); 20 | 21 | private: 22 | bool hasCommand; 23 | void transmitMessages(); 24 | DAPIProtoClient protoClient; 25 | }; 26 | } -------------------------------------------------------------------------------- /DAPILIB/source/Command.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "Towner.h" 5 | #include "Enums.h" 6 | #include "Item.h" 7 | #include "Monster.h" 8 | #include "Object.h" 9 | #include "Spell.h" 10 | 11 | namespace DAPI 12 | { 13 | struct Command 14 | { 15 | Command() = default; 16 | Command(CommandType type) : type(type) {} 17 | 18 | static Command walkXY(int _targetX, int _targetY); 19 | static Command talk(std::shared_ptr target); 20 | static Command selectStoreOption(StoreOption option); 21 | static Command buyItem(std::shared_ptr item); 22 | static Command sellItem(std::shared_ptr item); 23 | static Command rechargeItem(Item item); 24 | static Command repairItem(std::shared_ptr item); 25 | static Command attackMonster(Monster monster); 26 | static Command attackXY(int targetX, int targetY); 27 | static Command operateObject(Object object); 28 | static Command toggleCharacterScreen(); 29 | static Command increaseStat(int stat); 30 | static Command useBeltItem(int slot); 31 | static Command getItem(std::shared_ptr item); 32 | static Command setSpell(SpellID id, SpellType type); 33 | static Command castMonster(Monster monster); 34 | static Command castXY(int _targetX, int _targetY); 35 | static Command toggleInventoryScreen(); 36 | static Command putInCursor(int ID); 37 | static Command putCursorItem(int location); 38 | static Command dropCursorItem(); 39 | static Command useItem(int ID); 40 | static Command identifyStoreItem(std::shared_ptr item); 41 | static Command castSpellXY(int x, int y); 42 | static Command cancelQText(); 43 | static Command setFPS(int fps); 44 | static Command disarmTrap(Object object); 45 | static Command skillRepair(std::shared_ptr item); 46 | static Command skillRecharge(std::shared_ptr item); 47 | static Command toggleMenu(); 48 | static Command saveGame(); 49 | static Command quit(); 50 | static Command clearCursor(); 51 | static Command identifyItem(std::shared_ptr item); 52 | static Command sendChat(std::string message); 53 | 54 | CommandType type; 55 | int targetX; 56 | int targetY; 57 | int param1; 58 | int param2; 59 | std::string message; 60 | }; 61 | } -------------------------------------------------------------------------------- /DAPILIB/source/DAPI.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Game.h" -------------------------------------------------------------------------------- /DAPILIB/source/GameData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #include "Player.h" 6 | #include "Towner.h" 7 | #include "Tile.h" 8 | #include "Trigger.h" 9 | #include "Monster.h" 10 | #include "Object.h" 11 | #include "Missile.h" 12 | #include "Portal.h" 13 | #include "Quest.h" 14 | 15 | 16 | namespace DAPI 17 | { 18 | 19 | enum struct StoreOption; 20 | 21 | enum struct GameMode 22 | { 23 | SINGLEPLAYER, 24 | MULTIPLAYER 25 | }; 26 | 27 | enum struct Difficulty 28 | { 29 | NORMAL, 30 | NIGHTMARE, 31 | HELL, 32 | NUM_DIFFICULTIES 33 | }; 34 | 35 | enum struct Backend { 36 | Vanilla109, 37 | DevilutionX 38 | }; 39 | 40 | struct GameData 41 | { 42 | Backend backend; 43 | int player; 44 | char stextflag; 45 | int pauseMode; 46 | bool menuOpen; 47 | int cursor; 48 | Tile dPiece[112][112]; 49 | bool chrflag; 50 | bool invflag; 51 | bool qtextflag; 52 | std::string qtext; 53 | int currlevel; 54 | bool setlevel; 55 | int FPS; 56 | GameMode gameMode; 57 | Difficulty gnDifficulty; 58 | 59 | std::map playerList; 60 | std::map itemList; 61 | std::vector groundItems; 62 | std::map townerData; 63 | std::vector storeList; 64 | std::vector storeItems; 65 | std::vector triggerList; 66 | std::vector monsterList; 67 | std::vector objectList; 68 | std::vector missileList; 69 | std::vector portalList; 70 | std::vector questList; 71 | std::vector chatMessages; 72 | }; 73 | }; -------------------------------------------------------------------------------- /DAPILIB/source/Missile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "MissileData.h" 5 | 6 | namespace DAPI 7 | { 8 | struct Missile 9 | { 10 | Missile() { data = std::make_shared(); } 11 | 12 | MissileType getType() { return data->type; } 13 | int getXVelocity() { return data->mixvel; } 14 | int getYVelocity() { return data->miyvel; } 15 | int getX() { return data->mix; } 16 | int getY() { return data->miy; } 17 | int getSourceX() { return data->misx; } 18 | int getSourceY() { return data->misy; } 19 | 20 | std::shared_ptr data; 21 | }; 22 | } -------------------------------------------------------------------------------- /DAPILIB/source/MissileData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace DAPI 4 | { 5 | 6 | enum struct MissileType 7 | { 8 | MIS_ARROW = 0x0, 9 | MIS_FIREBOLT = 0x1, 10 | MIS_GUARDIAN = 0x2, 11 | MIS_RNDTELEPORT = 0x3, 12 | MIS_LIGHTBALL = 0x4, 13 | MIS_FIREWALL = 0x5, 14 | MIS_FIREBALL = 0x6, 15 | MIS_LIGHTCTRL = 0x7, 16 | MIS_LIGHTNING = 0x8, 17 | MIS_MISEXP = 0x9, 18 | MIS_TOWN = 0xA, 19 | MIS_FLASH = 0xB, 20 | MIS_FLASH2 = 0xC, 21 | MIS_MANASHIELD = 0xD, 22 | MIS_FIREMOVE = 0xE, 23 | MIS_CHAIN = 0xF, 24 | MIS_SENTINAL = 0x10, 25 | MIS_BLODSTAR = 0x11, 26 | MIS_BONE = 0x12, 27 | MIS_METLHIT = 0x13, 28 | MIS_RHINO = 0x14, 29 | MIS_MAGMABALL = 0x15, 30 | MIS_LIGHTCTRL2 = 0x16, 31 | MIS_LIGHTNING2 = 0x17, 32 | MIS_FLARE = 0x18, 33 | MIS_MISEXP2 = 0x19, 34 | MIS_TELEPORT = 0x1A, 35 | MIS_FARROW = 0x1B, 36 | MIS_DOOMSERP = 0x1C, 37 | MIS_FIREWALLA = 0x1D, 38 | MIS_STONE = 0x1E, 39 | MIS_NULL_1F = 0x1F, 40 | MIS_INVISIBL = 0x20, 41 | MIS_GOLEM = 0x21, 42 | MIS_ETHEREALIZE = 0x22, 43 | MIS_BLODBUR = 0x23, 44 | MIS_BOOM = 0x24, 45 | MIS_HEAL = 0x25, 46 | MIS_FIREWALLC = 0x26, 47 | MIS_INFRA = 0x27, 48 | MIS_IDENTIFY = 0x28, 49 | MIS_WAVE = 0x29, 50 | MIS_NOVA = 0x2A, 51 | MIS_BLODBOIL = 0x2B, 52 | MIS_APOCA = 0x2C, 53 | MIS_REPAIR = 0x2D, 54 | MIS_RECHARGE = 0x2E, 55 | MIS_DISARM = 0x2F, 56 | MIS_FLAME = 0x30, 57 | MIS_FLAMEC = 0x31, 58 | MIS_FIREMAN = 0x32, 59 | MIS_KRULL = 0x33, 60 | MIS_CBOLT = 0x34, 61 | MIS_HBOLT = 0x35, 62 | MIS_RESURRECT = 0x36, 63 | MIS_TELEKINESIS = 0x37, 64 | MIS_LARROW = 0x38, 65 | MIS_ACID = 0x39, 66 | MIS_MISEXP3 = 0x3A, 67 | MIS_ACIDPUD = 0x3B, 68 | MIS_HEALOTHER = 0x3C, 69 | MIS_ELEMENT = 0x3D, 70 | MIS_RESURRECTBEAM = 0x3E, 71 | MIS_BONESPIRIT = 0x3F, 72 | MIS_WEAPEXP = 0x40, 73 | MIS_RPORTAL = 0x41, 74 | MIS_BOOM2 = 0x42, 75 | MIS_DIABAPOCA = 0x43, 76 | }; 77 | 78 | struct MissileData 79 | { 80 | MissileType type; 81 | int mixvel; 82 | int miyvel; 83 | int mix; 84 | int miy; 85 | int misx; 86 | int misy; 87 | }; 88 | } -------------------------------------------------------------------------------- /DAPILIB/source/Monster.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "MonsterData.h" 5 | 6 | namespace DAPI 7 | { 8 | struct Monster 9 | { 10 | Monster() { data = std::make_shared(); } 11 | 12 | int getX() { return data->x; } 13 | int getY() { return data->y; } 14 | int getFutureX() { return data->futx; } 15 | int getFutureY() { return data->futy; } 16 | MonsterMode getMode() { return data->mode; } 17 | std::string getName() { return data->name; } 18 | MonsterType getType() { return data->type; } 19 | int getKills() { return data->kills; } 20 | bool isUnique() { return data->unique; } 21 | 22 | std::shared_ptr data; 23 | }; 24 | } -------------------------------------------------------------------------------- /DAPILIB/source/Object.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "ObjectData.h" 4 | 5 | namespace DAPI 6 | { 7 | struct Object 8 | { 9 | Object() { data = std::make_shared(); } 10 | int getX() { return data->x; } 11 | int getY() { return data->y; } 12 | ObjectType getType() { return data->type; } 13 | ShrineType getShrineType() { return data->shrineType; } 14 | bool isSolid() { return data->solid; } 15 | DoorState getDoorState() { return data->doorState; } 16 | bool isSelectable() { return data->selectable; } 17 | bool isTrapped() { return data->trapped; } 18 | 19 | std::shared_ptr data; 20 | }; 21 | } -------------------------------------------------------------------------------- /DAPILIB/source/Player.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include "PlayerData.h" 6 | #include "Spell.h" 7 | 8 | namespace DAPI 9 | { 10 | enum struct InvBodyLocation { 11 | HEAD = 0, 12 | RING_LEFT = 1, 13 | RING_RIGHT = 2, 14 | AMULET = 3, 15 | HAND_LEFT = 4, 16 | HAND_RIGHT = 5, 17 | CHEST = 6, 18 | NUM_INVLOC, 19 | }; 20 | 21 | struct Player 22 | { 23 | Player(); 24 | bool canCast(Spell spell); 25 | int getID() { return data->pnum; } 26 | int getX() { return data->_px; } 27 | int getY() { return data->_py; } 28 | int getFutureX() { return data->_pfutx; } 29 | int getFutureY() { return data->_pfuty; } 30 | int getDirection() { return data->_pdir; } 31 | Spell getRightClickSpell() { return Spell{ static_cast(data->_pRSpell), static_cast(data->_pRSplType), getSpellLevel(static_cast(data->_pRSpell)), static_cast(data->_pClass), data->_pLevel, data->_pMagic }; } 32 | int getSpellLevel(Spell spell) { return data->_pSplLvl[static_cast(spell.getID())]; } 33 | int getSpellLevel(SpellID spellID) { return data->_pSplLvl[static_cast(spellID)]; } 34 | CharacterClass getClass(); 35 | std::string getName() { return data->_pName; } 36 | int getLife() { return data->_pHitPoints >> 6; } 37 | int getLevel() { return data->_pLevel; } 38 | int getExperience() { return data->_pExperience; } 39 | int getExperienceToNextLevel(); 40 | int getMana() { return data->_pMana >> 6; } 41 | int getBaseStrength() { return data->_pBaseStr; } 42 | int getStrength() { return data->_pStrength; } 43 | int getGold() { return data->_pGold; } 44 | std::vector getAvailableSpells(); 45 | int getBaseMagic() { return data->_pBaseMag; } 46 | int getMagic() { return data->_pMagic; } 47 | int getArmorClass() { return data->_pIBonusAC + data->_pIAC + data->_pDexterity / 5; } 48 | int getBaseDexterity() { return data->_pBaseDex; } 49 | int getDexterity() { return data->_pDexterity; } 50 | int getBaseVitality() { return data->_pBaseVit; } 51 | int getVitality() { return data->_pVitality; } 52 | int getToHit() { return (data->_pDexterity >> 1) + data->_pIBonusToHit + 50; } 53 | int getMinimumDamage(); 54 | int getMaximumDamage(); 55 | int getStatPoints() { return data->_pStatPts; } 56 | int getMagicResist(); 57 | int getFireResist(); 58 | int getLightningResist(); 59 | int getMaxLife() { return data->_pMaxHP >> 6; } 60 | int getMaxMana() { return data->_pMaxMana >> 6; } 61 | int* getInventoryGrid() { return data->InvGrid; } 62 | PlayerMode getMode() { return data->_pmode; } 63 | std::shared_ptr getEquippedItem(InvBodyLocation location); 64 | std::vector> getInventoryItems(); 65 | std::vector> getSpeedItems(); 66 | std::shared_ptr getCursorItem() { return data->HoldItem; } 67 | bool hasManaShield() { return data->pManaShield; } 68 | 69 | std::shared_ptr data; 70 | }; 71 | } -------------------------------------------------------------------------------- /DAPILIB/source/PlayerData.cpp: -------------------------------------------------------------------------------- 1 | #include "PlayerData.h" 2 | 3 | namespace DAPI 4 | { 5 | std::string classNames[] = { "Warrior", "Rogue", "Sorcerer", 6 | "Number of Classes", "Unknown" }; 7 | std::string CharacterClass::getName() 8 | { 9 | return classNames[static_cast(ID)]; 10 | } 11 | } -------------------------------------------------------------------------------- /DAPILIB/source/PlayerData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | #include "Item.h" 6 | 7 | namespace DAPI 8 | { 9 | enum struct PlayerMode { 10 | STAND = 0, 11 | WALK = 1, 12 | WALK2 = 2, 13 | WALK3 = 3, 14 | ATTACK = 4, 15 | RATTACK = 5, 16 | BLOCK = 6, 17 | GOTHIT = 7, 18 | DEATH = 8, 19 | SPELL = 9, 20 | NEWLVL = 10, 21 | QUIT = 11, 22 | }; 23 | 24 | enum struct ClassID 25 | { 26 | WARRIOR = 0x0, 27 | ROGUE = 0x1, 28 | SORCERER = 0x2, 29 | NUMCLASSES = 0x3, 30 | UNKNOWN = 0x4 31 | }; 32 | 33 | struct CharacterClass 34 | { 35 | CharacterClass(ClassID ID) : ID(ID) {} 36 | ClassID getID() { return ID; } 37 | std::string getName(); 38 | private: 39 | ClassID ID; 40 | }; 41 | 42 | struct PlayerData 43 | { 44 | PlayerMode _pmode; 45 | int pnum; 46 | int plrlevel; 47 | int _px; 48 | int _py; 49 | int _pfutx; 50 | int _pfuty; 51 | int _pdir; 52 | 53 | int _pRSpell; 54 | char _pRSplType; 55 | 56 | char _pSplLvl[64]; 57 | unsigned __int64 _pMemSpells; 58 | unsigned __int64 _pAblSpells; 59 | unsigned __int64 _pScrlSpells; 60 | 61 | std::string _pName; 62 | int _pClass; 63 | 64 | int _pStrength; 65 | int _pBaseStr; 66 | int _pMagic; 67 | int _pBaseMag; 68 | int _pDexterity; 69 | int _pBaseDex; 70 | int _pVitality; 71 | int _pBaseVit; 72 | 73 | int _pStatPts; 74 | 75 | int _pDamageMod; 76 | 77 | int _pHitPoints; 78 | int _pMaxHP; 79 | int _pMana; 80 | int _pMaxMana; 81 | char _pLevel; 82 | int _pExperience; 83 | 84 | char _pArmorClass; 85 | 86 | char _pMagResist; 87 | char _pFireResist; 88 | char _pLightResist; 89 | 90 | int _pGold; 91 | 92 | std::map> InvBody; 93 | std::shared_ptr InvList[40]; 94 | int InvGrid[40]; 95 | std::shared_ptr SpdList[8]; 96 | std::shared_ptr HoldItem; 97 | 98 | int _pIMinDam; 99 | int _pIMaxDam; 100 | int _pIBonusDam; 101 | int _pIAC; 102 | int _pIBonusToHit; 103 | int _pIBonusAC; 104 | int _pIBonusDamMod; 105 | bool pManaShield; 106 | }; 107 | } -------------------------------------------------------------------------------- /DAPILIB/source/Portal.cpp: -------------------------------------------------------------------------------- 1 | #include "Portal.h" 2 | 3 | namespace DAPI 4 | { 5 | Portal::Portal() 6 | { 7 | data = std::make_shared(); 8 | } 9 | } -------------------------------------------------------------------------------- /DAPILIB/source/Portal.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "PortalData.h" 3 | 4 | namespace DAPI 5 | { 6 | struct Portal 7 | { 8 | Portal(); 9 | int getX() { return data->x; } 10 | int getY() { return data->y; } 11 | std::shared_ptr getPlayer() { return data->player; } 12 | std::shared_ptr data; 13 | }; 14 | } -------------------------------------------------------------------------------- /DAPILIB/source/PortalData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "Player.h" 5 | 6 | namespace DAPI 7 | { 8 | struct PortalData 9 | { 10 | PortalData() : x(0), y(0), player(nullptr) {} 11 | int x; 12 | int y; 13 | std::shared_ptr player; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /DAPILIB/source/Quest.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "QuestData.h" 5 | 6 | namespace DAPI 7 | { 8 | struct Quest 9 | { 10 | Quest() { data = std::make_shared(); } 11 | 12 | QuestID getID() { return data->id; } 13 | QuestState getState() { return data->state; } 14 | 15 | std::shared_ptr data; 16 | }; 17 | } -------------------------------------------------------------------------------- /DAPILIB/source/QuestData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace DAPI 4 | { 5 | enum struct QuestID { 6 | ROCK = 0x0, 7 | MUSHROOM = 0x1, 8 | GARBUD = 0x2, 9 | ZHAR = 0x3, 10 | VEIL = 0x4, 11 | DIABLO = 0x5, 12 | BUTCHER = 0x6, 13 | LTBANNER = 0x7, 14 | BLIND = 0x8, 15 | BLOOD = 0x9, 16 | ANVIL = 0xA, 17 | WARLORD = 0xB, 18 | SKELKING = 0xC, 19 | PWATER = 0xD, 20 | SCHAMB = 0xE, 21 | BETRAYER = 0xF 22 | }; 23 | 24 | typedef enum QuestState { 25 | QUEST_NOTAVAIL = 0, 26 | QUEST_ACTIVE = 2, 27 | } quest_state; 28 | 29 | struct QuestData 30 | { 31 | QuestID id; 32 | QuestState state; 33 | }; 34 | } -------------------------------------------------------------------------------- /DAPILIB/source/Spell.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "PlayerData.h" 5 | 6 | namespace DAPI 7 | { 8 | enum struct SpellID 9 | { 10 | SPNULL = 0x0, 11 | FIREBOLT = 0x1, 12 | HEAL = 0x2, 13 | LIGHTNING = 0x3, 14 | FLASH = 0x4, 15 | IDENTIFY = 0x5, 16 | FIREWALL = 0x6, 17 | TOWN = 0x7, 18 | STONE = 0x8, 19 | INFRA = 0x9, 20 | RNDTELEPORT = 0xA, 21 | MANASHIELD = 0xB, 22 | FIREBALL = 0xC, 23 | GUARDIAN = 0xD, 24 | CHAIN = 0xE, 25 | WAVE = 0xF, 26 | DOOMSERP = 0x10, 27 | BLODRIT = 0x11, 28 | NOVA = 0x12, 29 | INVISIBIL = 0x13, 30 | FLAME = 0x14, 31 | GOLEM = 0x15, 32 | BLODBOIL = 0x16, 33 | TELEPORT = 0x17, 34 | APOCA = 0x18, 35 | ETHEREALIZE = 0x19, 36 | REPAIR = 0x1A, 37 | RECHARGE = 0x1B, 38 | DISARM = 0x1C, 39 | ELEMENT = 0x1D, 40 | CBOLT = 0x1E, 41 | HBOLT = 0x1F, 42 | RESURRECT = 0x20, 43 | TELEKINESIS = 0x21, 44 | HEALOTHER = 0x22, 45 | FLARE = 0x23, 46 | BONESPIRIT = 0x24, 47 | INVALID = -1, 48 | }; 49 | 50 | enum struct SpellTypeID 51 | { 52 | SKILL = 0x0, 53 | SPELL = 0x1, 54 | SCROLL = 0x2, 55 | CHARGES = 0x3, 56 | INVALID = 4, 57 | }; 58 | 59 | struct SpellType 60 | { 61 | SpellType(SpellTypeID ID) : ID(ID) {} 62 | SpellTypeID getID() { return ID; } 63 | std::string getName(); 64 | private: 65 | SpellTypeID ID; 66 | }; 67 | 68 | struct Spell 69 | { 70 | Spell(SpellID ID, SpellTypeID type) : ID(ID), type(type), level(0), playerClass(ClassID::UNKNOWN), playerLevel(0), minDamage(-1), maxDamage(-1) {} 71 | Spell(SpellID ID, SpellTypeID type, int level, ClassID playerClass, int playerLevel, int magic); 72 | SpellID getID() { return ID; } 73 | std::string getName(); 74 | SpellType getType() { return type; } 75 | int getManaCost(); 76 | int getMinimumDamage() { return minDamage; } 77 | int getMaximumDamage() { return maxDamage; } 78 | int getLevel() { return level; } 79 | int getRawManaCost(); 80 | private: 81 | SpellID ID; 82 | SpellType type; 83 | int level; 84 | ClassID playerClass; 85 | int playerLevel; 86 | int minDamage; 87 | int maxDamage; 88 | }; 89 | } -------------------------------------------------------------------------------- /DAPILIB/source/Tile.cpp: -------------------------------------------------------------------------------- 1 | #include "Tile.h" 2 | 3 | namespace DAPI 4 | { 5 | Tile::Tile() 6 | { 7 | data = std::make_shared(); 8 | data->type = -1; 9 | data->solid = false; 10 | data->x = -1; 11 | data->y = -1; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /DAPILIB/source/Tile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "TileData.h" 5 | 6 | namespace DAPI 7 | { 8 | struct Tile 9 | { 10 | Tile(); 11 | 12 | int getType() { return data->type; } 13 | int getX() { return data->x; } 14 | int getY() { return data->y; } 15 | bool getSolid() { return data->solid || data->type == 0; } 16 | bool allowsMissile() { return !data->stopMissile; } 17 | 18 | std::shared_ptr data; 19 | }; 20 | } -------------------------------------------------------------------------------- /DAPILIB/source/TileData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace DAPI 4 | { 5 | struct TileData 6 | { 7 | int type; 8 | bool solid; 9 | int x; 10 | int y; 11 | bool stopMissile; 12 | }; 13 | } -------------------------------------------------------------------------------- /DAPILIB/source/Towner.cpp: -------------------------------------------------------------------------------- 1 | #include "Towner.h" 2 | 3 | namespace DAPI 4 | { 5 | Towner::Towner() 6 | { 7 | data = std::make_shared(); 8 | } 9 | } -------------------------------------------------------------------------------- /DAPILIB/source/Towner.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "TownerData.h" 5 | 6 | namespace DAPI 7 | { 8 | struct Towner 9 | { 10 | Towner(); 11 | int getX() { return data->_tx; } 12 | int getY() { return data->_ty; } 13 | TalkerType getTalkerType() { return data->_ttype; } 14 | std::string getName() { return data->_tName; } 15 | 16 | std::shared_ptr data; 17 | }; 18 | } -------------------------------------------------------------------------------- /DAPILIB/source/TownerData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace DAPI 5 | { 6 | enum struct TalkerType { 7 | SMITH = 0x0, 8 | HEALER = 0x1, 9 | DEADGUY = 0x2, 10 | TAVERN = 0x3, 11 | STORY = 0x4, 12 | DRUNK = 0x5, 13 | WITCH = 0x6, 14 | BMAID = 0x7, 15 | PEGBOY = 0x8, 16 | COW = 0x9, 17 | PRIEST = 0xA, 18 | NONE = 11 19 | }; 20 | 21 | struct TownerData 22 | { 23 | int ID; 24 | TalkerType _ttype; 25 | int _tx; 26 | int _ty; 27 | std::string _tName; 28 | }; 29 | } -------------------------------------------------------------------------------- /DAPILIB/source/Trigger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "TriggerData.h" 5 | 6 | namespace DAPI 7 | { 8 | struct Trigger 9 | { 10 | Trigger() { data = std::make_shared(); } 11 | 12 | int getLevel() { return data->lvl; } 13 | int getX() { return data->x; } 14 | int getY() { return data->y; } 15 | TriggerType getType() { return data->type; } 16 | 17 | std::shared_ptr data; 18 | }; 19 | } -------------------------------------------------------------------------------- /DAPILIB/source/TriggerData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | 4 | namespace DAPI 5 | { 6 | enum struct TriggerType { 7 | DIABNEXTLVL = 0x402, 8 | DIABPREVLVL = 0x403, 9 | DIABRTNLVL = 0x404, 10 | DIABSETLVL = 0x405, 11 | DIABWARPLVL = 0x406, 12 | DIABTOWNWARP = 0x407, 13 | DIABTWARPUP = 0x408, 14 | DIABRETOWN = 0x409, 15 | DIABNEWGAME = 0x40A, 16 | DIABLOADGAME = 0x40B 17 | }; 18 | 19 | struct TriggerData 20 | { 21 | int lvl; 22 | int x; 23 | int y; 24 | TriggerType type; 25 | }; 26 | } -------------------------------------------------------------------------------- /ExampleAIClient/ExampleAIClient.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /Messages/Messages.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {8454100d-6aa8-4667-a3e9-b12a3a530e95} 6 | 7 | 8 | {63d65d39-da70-4ea9-ae30-c2a4bf37ce95} 9 | 10 | 11 | 12 | 13 | Protofiles 14 | 15 | 16 | Protofiles 17 | 18 | 19 | Protofiles 20 | 21 | 22 | Protofiles 23 | 24 | 25 | Protofiles 26 | 27 | 28 | 29 | 30 | Generated 31 | 32 | 33 | Generated 34 | 35 | 36 | Generated 37 | 38 | 39 | Generated 40 | 41 | 42 | Generated 43 | 44 | 45 | 46 | 47 | Generated 48 | 49 | 50 | Generated 51 | 52 | 53 | Generated 54 | 55 | 56 | Generated 57 | 58 | 59 | Generated 60 | 61 | 62 | -------------------------------------------------------------------------------- /Messages/game.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option optimize_for = LITE_RUNTIME; 3 | import "data.proto"; 4 | 5 | package dapi.game; 6 | 7 | message FrameUpdate { 8 | uint32 player = 1; 9 | sint32 stextflag = 2; 10 | sint32 pauseMode = 3; 11 | bool menuOpen = 4; 12 | uint32 cursor = 5; 13 | bool chrflag = 6; 14 | bool invflag = 7; 15 | bool qtextflag = 8; 16 | string qtext = 9; 17 | uint32 currlevel = 10; 18 | bool setlevel = 11; 19 | uint32 fps = 12; 20 | uint32 gameMode = 13; 21 | uint32 gnDifficulty = 14; 22 | uint32 connectedTo = 15; 23 | 24 | repeated dapi.data.TileData dPiece = 16; 25 | repeated dapi.data.PlayerData playerData = 17; 26 | repeated dapi.data.ItemData itemData = 18; 27 | repeated uint32 groundItemID = 19; 28 | repeated dapi.data.TownerData townerData = 20; 29 | repeated uint32 storeOption = 21; 30 | repeated uint32 storeItems = 22; 31 | repeated dapi.data.TriggerData triggerData = 23; 32 | repeated dapi.data.MonsterData monsterData = 24; 33 | repeated dapi.data.ObjectData objectData = 25; 34 | repeated dapi.data.MissileData missileData = 26; 35 | repeated dapi.data.PortalData portalData = 27; 36 | repeated dapi.data.QuestData questData = 28; 37 | repeated string chatMessages = 29; 38 | } -------------------------------------------------------------------------------- /Messages/init.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option optimize_for = LITE_RUNTIME; 3 | 4 | package dapi.init; 5 | 6 | message ClientBroadcast { 7 | 8 | } 9 | 10 | message ServerResponse { 11 | uint32 port = 1; 12 | } -------------------------------------------------------------------------------- /Messages/message.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option optimize_for = LITE_RUNTIME; 3 | import "init.proto"; 4 | import "game.proto"; 5 | import "command.proto"; 6 | 7 | package dapi.message; 8 | 9 | // Empty message to intidate end of queue 10 | message EndofQueue { 11 | 12 | } 13 | 14 | // Wrapper used to distinguish which message is which 15 | message Message{ 16 | oneof msg { 17 | dapi.init.ClientBroadcast initBroadcast = 1; 18 | dapi.init.ServerResponse initResponse = 2; 19 | 20 | dapi.game.FrameUpdate frameUpdate = 3; 21 | 22 | dapi.commands.Command command = 4; 23 | 24 | EndofQueue endOfQueue = 5; 25 | } 26 | } -------------------------------------------------------------------------------- /Messages/proto/protoc-3.6.0-win32/bin/protoc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NiteKat/DAPI/e524068f8e77caafeea6a5c74f7cccad1d76d47b/Messages/proto/protoc-3.6.0-win32/bin/protoc.exe -------------------------------------------------------------------------------- /Messages/proto/protoc-3.6.0-win32/include/google/protobuf/empty.proto: -------------------------------------------------------------------------------- 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 | syntax = "proto3"; 32 | 33 | package google.protobuf; 34 | 35 | option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 36 | option go_package = "github.com/golang/protobuf/ptypes/empty"; 37 | option java_package = "com.google.protobuf"; 38 | option java_outer_classname = "EmptyProto"; 39 | option java_multiple_files = true; 40 | option objc_class_prefix = "GPB"; 41 | option cc_enable_arenas = true; 42 | 43 | // A generic empty message that you can re-use to avoid defining duplicated 44 | // empty messages in your APIs. A typical example is to use it as the request 45 | // or the response type of an API method. For instance: 46 | // 47 | // service Foo { 48 | // rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 49 | // } 50 | // 51 | // The JSON representation for `Empty` is empty JSON object `{}`. 52 | message Empty {} 53 | -------------------------------------------------------------------------------- /Messages/proto/protoc-3.6.0-win32/include/google/protobuf/source_context.proto: -------------------------------------------------------------------------------- 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 | syntax = "proto3"; 32 | 33 | package google.protobuf; 34 | 35 | option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 36 | option java_package = "com.google.protobuf"; 37 | option java_outer_classname = "SourceContextProto"; 38 | option java_multiple_files = true; 39 | option objc_class_prefix = "GPB"; 40 | option go_package = "google.golang.org/genproto/protobuf/source_context;source_context"; 41 | 42 | // `SourceContext` represents information about the source of a 43 | // protobuf element, like the file in which it is defined. 44 | message SourceContext { 45 | // The path-qualified name of the .proto file that contained the associated 46 | // protobuf element. For example: `"google/protobuf/source_context.proto"`. 47 | string file_name = 1; 48 | } 49 | -------------------------------------------------------------------------------- /Messages/proto/protoc-3.6.0-win32/readme.txt: -------------------------------------------------------------------------------- 1 | Protocol Buffers - Google's data interchange format 2 | Copyright 2008 Google Inc. 3 | https://developers.google.com/protocol-buffers/ 4 | 5 | This package contains a precompiled binary version of the protocol buffer 6 | compiler (protoc). This binary is intended for users who want to use Protocol 7 | Buffers in languages other than C++ but do not want to compile protoc 8 | themselves. To install, simply place this binary somewhere in your PATH. 9 | 10 | If you intend to use the included well known types then don't forget to 11 | copy the contents of the 'include' directory somewhere as well, for example 12 | into '/usr/local/include/'. 13 | 14 | Please refer to our official github site for more installation instructions: 15 | https://github.com/google/protobuf 16 | -------------------------------------------------------------------------------- /New DAPI/New DAPI.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | README 2 | 3 | Project Overview: 4 | DAPI (Diablo API) is intended to give AI developers the tools they need to make a bot for Diablo that will have the same information restrictions as a human player would. 5 | 6 | Currently the project is very early in development, meaning that breaking changes to the API can happen, and there is no official change/version tracker yet. Please feel free to use the API at this time for early development, but understand that the information available to your bot could change, function calls could change, etc. In addition, documentation of the API is not strong, but these are things that will come in time. 7 | 8 | The API has gone through a radical redesign, there is now a server/client relationship using Google Protobuf for communication. This allows the frontend to be in different languages instead of just C++. This project will focus on supporting 9 | 10 | Capabilities: 11 | 12 | Write an AI capable of playing the game any way a human could imagine playing the game: Designed for PvP, PvE, Iron Man Challenge, Speedrunning, etc. 13 | 14 | Read all relevant aspects of the game state that would be available to a human player. 15 | 16 | Get basic information on items in the game. 17 | 18 | Get basic information on the monsters and other players in the game. 19 | 20 | Study and research real-time AI algorithms in a commercial ARPG environment. 21 | 22 | Legal 23 | 24 | Diablo is a trademark of Blizzard Entertainment. DAPI is a third party "hack." Diablo is available through GOG's website. No links to any downloads of Diablo, or Diablo CDs, will be posted through this github. -------------------------------------------------------------------------------- /SFML-2.5.1/include/SFML/Network.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_NETWORK_HPP 26 | #define SFML_NETWORK_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | 42 | 43 | #endif // SFML_NETWORK_HPP 44 | 45 | //////////////////////////////////////////////////////////// 46 | /// \defgroup network Network module 47 | /// 48 | /// Socket-based communication, utilities and higher-level 49 | /// network protocols (HTTP, FTP). 50 | /// 51 | //////////////////////////////////////////////////////////// 52 | -------------------------------------------------------------------------------- /SFML-2.5.1/include/SFML/Network/SocketHandle.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | #ifndef SFML_SOCKETHANDLE_HPP 26 | #define SFML_SOCKETHANDLE_HPP 27 | 28 | //////////////////////////////////////////////////////////// 29 | // Headers 30 | //////////////////////////////////////////////////////////// 31 | #include 32 | 33 | #if defined(SFML_SYSTEM_WINDOWS) 34 | #include 35 | #endif 36 | 37 | 38 | namespace sf 39 | { 40 | //////////////////////////////////////////////////////////// 41 | // Define the low-level socket handle type, specific to 42 | // each platform 43 | //////////////////////////////////////////////////////////// 44 | #if defined(SFML_SYSTEM_WINDOWS) 45 | 46 | typedef UINT_PTR SocketHandle; 47 | 48 | #else 49 | 50 | typedef int SocketHandle; 51 | 52 | #endif 53 | 54 | } // namespace sf 55 | 56 | 57 | #endif // SFML_SOCKETHANDLE_HPP 58 | -------------------------------------------------------------------------------- /SFML-2.5.1/license.md: -------------------------------------------------------------------------------- 1 | # SFML 2 | 3 | SFML - Copyright (C) 2007-2018 Laurent Gomila - laurent@sfml-dev.org 4 | 5 | This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: 8 | 9 | 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 10 | 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 11 | 3. This notice may not be removed or altered from any source distribution. 12 | 13 | ## External libraries used by SFML 14 | 15 | * _OpenAL-Soft_ is under the LGPL license 16 | * _stb_image_ and _stb_image_write_ are public domain 17 | * _freetype_ is under the FreeType license or the GPL license 18 | * _libogg_ is under the BSD license 19 | * _libvorbis_ is under the BSD license 20 | * _libflac_ is under the BSD license 21 | -------------------------------------------------------------------------------- /SFML-2.5.1/readme.md: -------------------------------------------------------------------------------- 1 | This source is modified from its original repository: https://github.com/SFML/SFML 2 | 3 | The changes are as follows: 4 | - Remove everything except for Network and System. 5 | - Remove Windows XP support. 6 | - Remove DLL import/export definitions. Made static only. 7 | - Heavily gutted, partial Network and System modules 8 | - -------------------------------------------------------------------------------- /SFML-2.5.1/src/SFML/Network/SocketImpl.hpp: -------------------------------------------------------------------------------- 1 | //////////////////////////////////////////////////////////// 2 | // 3 | // SFML - Simple and Fast Multimedia Library 4 | // Copyright (C) 2007-2018 Laurent Gomila (laurent@sfml-dev.org) 5 | // 6 | // This software is provided 'as-is', without any express or implied warranty. 7 | // In no event will the authors be held liable for any damages arising from the use of this software. 8 | // 9 | // Permission is granted to anyone to use this software for any purpose, 10 | // including commercial applications, and to alter it and redistribute it freely, 11 | // subject to the following restrictions: 12 | // 13 | // 1. The origin of this software must not be misrepresented; 14 | // you must not claim that you wrote the original software. 15 | // If you use this software in a product, an acknowledgment 16 | // in the product documentation would be appreciated but is not required. 17 | // 18 | // 2. Altered source versions must be plainly marked as such, 19 | // and must not be misrepresented as being the original software. 20 | // 21 | // 3. This notice may not be removed or altered from any source distribution. 22 | // 23 | //////////////////////////////////////////////////////////// 24 | 25 | //////////////////////////////////////////////////////////// 26 | // Headers 27 | //////////////////////////////////////////////////////////// 28 | #include 29 | 30 | 31 | #if defined(SFML_SYSTEM_WINDOWS) 32 | 33 | #include 34 | 35 | #else 36 | 37 | #include 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/any_test.proto: -------------------------------------------------------------------------------- 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 | syntax = "proto3"; 32 | 33 | package protobuf_unittest; 34 | 35 | import "google/protobuf/any.proto"; 36 | 37 | message TestAny { 38 | int32 int32_value = 1; 39 | google.protobuf.Any any_value = 2; 40 | repeated google.protobuf.Any repeated_any_value = 3; 41 | } 42 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/arena_test_util.cc: -------------------------------------------------------------------------------- 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 | #include 32 | #include 33 | #include 34 | 35 | 36 | #define EXPECT_EQ GOOGLE_CHECK_EQ 37 | 38 | namespace google { 39 | namespace protobuf { 40 | namespace internal { 41 | 42 | NoHeapChecker::~NoHeapChecker() { 43 | capture_alloc.Unhook(); 44 | EXPECT_EQ(0, capture_alloc.alloc_count()); 45 | EXPECT_EQ(0, capture_alloc.free_count()); 46 | } 47 | 48 | } // namespace internal 49 | } // namespace protobuf 50 | } // namespace google 51 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/arenastring.cc: -------------------------------------------------------------------------------- 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 | // The ArenaString implementation is not included in the open-source release. Do 32 | // not include this file in the distribution. 33 | 34 | #include 35 | 36 | namespace google { 37 | namespace protobuf { 38 | namespace internal { 39 | 40 | 41 | } // namespace internal 42 | } // namespace protobuf 43 | } // namespace google 44 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/cpp/cpp_message_layout_helper.h: -------------------------------------------------------------------------------- 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: seongkim@google.com (Seong Beom Kim) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | 35 | #ifndef GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_LAYOUT_HELPER_H__ 36 | #define GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_LAYOUT_HELPER_H__ 37 | 38 | #include 39 | #include 40 | 41 | namespace google { 42 | namespace protobuf { 43 | namespace compiler { 44 | namespace cpp { 45 | 46 | // Provides an abstract interface to optimize message layout 47 | // by rearranging the fields of a message. 48 | class MessageLayoutHelper { 49 | public: 50 | virtual ~MessageLayoutHelper() {} 51 | 52 | virtual void OptimizeLayout(std::vector* fields, 53 | const Options& options) = 0; 54 | }; 55 | 56 | } // namespace cpp 57 | } // namespace compiler 58 | } // namespace protobuf 59 | 60 | } // namespace google 61 | #endif // GOOGLE_PROTOBUF_COMPILER_CPP_MESSAGE_LAYOUT_HELPER_H__ 62 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/cpp/cpp_padding_optimizer.h: -------------------------------------------------------------------------------- 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: seongkim@google.com (Seong Beom Kim) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | 35 | #ifndef GOOGLE_PROTOBUF_COMPILER_CPP_PADDING_OPTIMIZER_H__ 36 | #define GOOGLE_PROTOBUF_COMPILER_CPP_PADDING_OPTIMIZER_H__ 37 | 38 | #include 39 | 40 | namespace google { 41 | namespace protobuf { 42 | namespace compiler { 43 | namespace cpp { 44 | 45 | // Rearranges the fields of a message to minimize padding. 46 | // Fields are grouped by the type and the size. 47 | // For example, grouping four boolean fields and one int32 48 | // field results in zero padding overhead. See OptimizeLayout's 49 | // comment for details. 50 | class PaddingOptimizer : public MessageLayoutHelper { 51 | public: 52 | PaddingOptimizer() {} 53 | ~PaddingOptimizer() override {} 54 | 55 | void OptimizeLayout(std::vector* fields, 56 | const Options& options) override; 57 | }; 58 | 59 | } // namespace cpp 60 | } // namespace compiler 61 | } // namespace protobuf 62 | 63 | } // namespace google 64 | #endif // GOOGLE_PROTOBUF_COMPILER_CPP_PADDING_OPTIMIZER_H__ 65 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/cpp/cpp_test_large_enum_value.proto: -------------------------------------------------------------------------------- 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 | // Test that proto2 compiler can generate valid code when the enum value 32 | // is INT_MAX. Note that this is a compile-only test and this proto is not 33 | // referenced in any C++ code. 34 | syntax = "proto2"; 35 | 36 | package protobuf_unittest; 37 | 38 | message TestLargeEnumValue { 39 | enum EnumWithLargeValue { 40 | VALUE_1 = 1; 41 | VALUE_MAX = 0x7fffffff; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/cpp/cpp_unittest.h: -------------------------------------------------------------------------------- 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 | // This header declares the namespace google::protobuf::protobuf_unittest in order to expose 32 | // any problems with the generated class names. We use this header to ensure 33 | // unittest.cc will declare the namespace prior to other includes, while obeying 34 | // normal include ordering. 35 | // 36 | // When generating a class name of "foo.Bar" we must ensure we prefix the class 37 | // name with "::", in case the namespace google::protobuf::foo exists. We intentionally 38 | // trigger that case here by declaring google::protobuf::protobuf_unittest. 39 | // 40 | // See ClassName in helpers.h for more details. 41 | 42 | #ifndef GOOGLE_PROTOBUF_COMPILER_CPP_UNITTEST_H__ 43 | #define GOOGLE_PROTOBUF_COMPILER_CPP_UNITTEST_H__ 44 | 45 | namespace google { 46 | namespace protobuf { 47 | namespace protobuf_unittest {} 48 | } // namespace protobuf 49 | 50 | } // namespace google 51 | #endif // GOOGLE_PROTOBUF_COMPILER_CPP_UNITTEST_H__ 52 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/csharp/csharp_doc_comment.h: -------------------------------------------------------------------------------- 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 | 32 | #ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_DOC_COMMENT_H__ 33 | #define GOOGLE_PROTOBUF_COMPILER_CSHARP_DOC_COMMENT_H__ 34 | 35 | #include 36 | #include 37 | 38 | namespace google { 39 | namespace protobuf { 40 | namespace compiler { 41 | namespace csharp { 42 | void WriteMessageDocComment(io::Printer* printer, const Descriptor* message); 43 | void WritePropertyDocComment(io::Printer* printer, const FieldDescriptor* field); 44 | void WriteEnumDocComment(io::Printer* printer, const EnumDescriptor* enumDescriptor); 45 | void WriteEnumValueDocComment(io::Printer* printer, const EnumValueDescriptor* value); 46 | void WriteMethodDocComment(io::Printer* printer, const MethodDescriptor* method); 47 | } // namespace csharp 48 | } // namespace compiler 49 | } // namespace protobuf 50 | } // namespace google 51 | #endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_DOC_COMMENT_H__ 52 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/csharp/csharp_enum.h: -------------------------------------------------------------------------------- 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 | #ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_ENUM_H__ 32 | #define GOOGLE_PROTOBUF_COMPILER_CSHARP_ENUM_H__ 33 | 34 | #include 35 | 36 | #include 37 | #include 38 | 39 | namespace google { 40 | namespace protobuf { 41 | namespace compiler { 42 | namespace csharp { 43 | 44 | class EnumGenerator : public SourceGeneratorBase { 45 | public: 46 | EnumGenerator(const EnumDescriptor* descriptor, const Options* options); 47 | ~EnumGenerator(); 48 | 49 | void Generate(io::Printer* printer); 50 | 51 | private: 52 | const EnumDescriptor* descriptor_; 53 | 54 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumGenerator); 55 | }; 56 | 57 | } // namespace csharp 58 | } // namespace compiler 59 | } // namespace protobuf 60 | } // namespace google 61 | 62 | #endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_ENUM_H__ 63 | 64 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/csharp/csharp_generator.h: -------------------------------------------------------------------------------- 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 | // Generates C# code for a given .proto file. 32 | 33 | #ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_GENERATOR_H__ 34 | #define GOOGLE_PROTOBUF_COMPILER_CSHARP_GENERATOR_H__ 35 | 36 | #include 37 | 38 | #include 39 | 40 | namespace google { 41 | namespace protobuf { 42 | namespace compiler { 43 | namespace csharp { 44 | 45 | // CodeGenerator implementation which generates a C# source file and 46 | // header. If you create your own protocol compiler binary and you want 47 | // it to support C# output, you can do so by registering an instance of this 48 | // CodeGenerator with the CommandLineInterface in your main() function. 49 | class LIBPROTOC_EXPORT Generator 50 | : public google::protobuf::compiler::CodeGenerator { 51 | public: 52 | virtual bool Generate( 53 | const FileDescriptor* file, 54 | const string& parameter, 55 | GeneratorContext* generator_context, 56 | string* error) const; 57 | }; 58 | 59 | } // namespace csharp 60 | } // namespace compiler 61 | } // namespace protobuf 62 | } // namespace google 63 | 64 | #endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_GENERATOR_H__ 65 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/csharp/csharp_reflection_class.h: -------------------------------------------------------------------------------- 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 | #ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_REFLECTION_CLASS_H__ 32 | #define GOOGLE_PROTOBUF_COMPILER_CSHARP_REFLECTION_CLASS_H__ 33 | 34 | #include 35 | 36 | #include 37 | #include 38 | 39 | namespace google { 40 | namespace protobuf { 41 | namespace compiler { 42 | namespace csharp { 43 | 44 | class ReflectionClassGenerator : public SourceGeneratorBase { 45 | public: 46 | ReflectionClassGenerator(const FileDescriptor* file, const Options* options); 47 | ~ReflectionClassGenerator(); 48 | 49 | void Generate(io::Printer* printer); 50 | 51 | private: 52 | const FileDescriptor* file_; 53 | 54 | std::string namespace_; 55 | std::string reflectionClassname_; 56 | 57 | void WriteIntroduction(io::Printer* printer); 58 | void WriteDescriptor(io::Printer* printer); 59 | void WriteGeneratedCodeInfo(const Descriptor* descriptor, 60 | io::Printer* printer, 61 | bool last); 62 | 63 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ReflectionClassGenerator); 64 | }; 65 | 66 | } // namespace csharp 67 | } // namespace compiler 68 | } // namespace protobuf 69 | } // namespace google 70 | 71 | #endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_REFLECTION_CLASS_H__ 72 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/csharp/csharp_source_generator_base.h: -------------------------------------------------------------------------------- 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 | #ifndef GOOGLE_PROTOBUF_COMPILER_CSHARP_SOURCE_GENERATOR_BASE_H__ 32 | #define GOOGLE_PROTOBUF_COMPILER_CSHARP_SOURCE_GENERATOR_BASE_H__ 33 | 34 | #include 35 | 36 | #include 37 | 38 | namespace google { 39 | namespace protobuf { 40 | namespace compiler { 41 | namespace csharp { 42 | 43 | struct Options; 44 | 45 | class SourceGeneratorBase { 46 | protected: 47 | SourceGeneratorBase(const FileDescriptor* descriptor, const Options* options); 48 | virtual ~SourceGeneratorBase(); 49 | 50 | std::string class_access_level(); 51 | const Options* options(); 52 | 53 | // Write any attributes used to decorate generated function members (methods and properties). 54 | // Should not be used to decorate types. 55 | void WriteGeneratedCodeAttributes(io::Printer* printer); 56 | 57 | private: 58 | const FileDescriptor* descriptor_; 59 | const Options *options_; 60 | 61 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(SourceGeneratorBase); 62 | }; 63 | 64 | } // namespace csharp 65 | } // namespace compiler 66 | } // namespace protobuf 67 | } // namespace google 68 | 69 | #endif // GOOGLE_PROTOBUF_COMPILER_CSHARP_SOURCE_GENERATOR_BASE_H__ 70 | 71 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/js/well_known_types/timestamp.js: -------------------------------------------------------------------------------- 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 | /* This code will be inserted into generated code for 32 | * google/protobuf/timestamp.proto. */ 33 | 34 | /** 35 | * Returns a JavaScript 'Date' object corresponding to this Timestamp. 36 | * @return {!Date} 37 | */ 38 | proto.google.protobuf.Timestamp.prototype.toDate = function() { 39 | var seconds = this.getSeconds(); 40 | var nanos = this.getNanos(); 41 | 42 | return new Date((seconds * 1000) + (nanos / 1000000)); 43 | }; 44 | 45 | 46 | /** 47 | * Sets the value of this Timestamp object to be the given Date. 48 | * @param {!Date} value The value to set. 49 | */ 50 | proto.google.protobuf.Timestamp.prototype.fromDate = function(value) { 51 | this.setSeconds(Math.floor(value.getTime() / 1000)); 52 | this.setNanos(value.getMilliseconds() * 1000000); 53 | }; 54 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/js/well_known_types_embed.h: -------------------------------------------------------------------------------- 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 | #ifndef GOOGLE_PROTOBUF_COMPILER_JS_WELL_KNOWN_TYPES_EMBED_H__ 32 | #define GOOGLE_PROTOBUF_COMPILER_JS_WELL_KNOWN_TYPES_EMBED_H__ 33 | 34 | #include 35 | 36 | struct FileToc { 37 | const char* name; 38 | const char* data; 39 | }; 40 | 41 | extern struct FileToc well_known_types_js[]; 42 | 43 | #endif // GOOGLE_PROTOBUF_COMPILER_JS_WELL_KNOWN_TYPES_EMBED_H__ 44 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/objectivec/objectivec_enum.h: -------------------------------------------------------------------------------- 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 | #ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ENUM_H__ 32 | #define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ENUM_H__ 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | namespace google { 40 | namespace protobuf { 41 | namespace io { 42 | class Printer; // printer.h 43 | } 44 | } 45 | 46 | namespace protobuf { 47 | namespace compiler { 48 | namespace objectivec { 49 | 50 | class EnumGenerator { 51 | public: 52 | explicit EnumGenerator(const EnumDescriptor* descriptor); 53 | ~EnumGenerator(); 54 | 55 | void GenerateHeader(io::Printer* printer); 56 | void GenerateSource(io::Printer* printer); 57 | 58 | const string& name() const { return name_; } 59 | 60 | private: 61 | const EnumDescriptor* descriptor_; 62 | std::vector base_values_; 63 | std::vector all_values_; 64 | const string name_; 65 | 66 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(EnumGenerator); 67 | }; 68 | 69 | } // namespace objectivec 70 | } // namespace compiler 71 | } // namespace protobuf 72 | } // namespace google 73 | #endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_ENUM_H__ 74 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/objectivec/objectivec_extension.h: -------------------------------------------------------------------------------- 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 | #ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_EXTENSION_H__ 32 | #define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_EXTENSION_H__ 33 | 34 | #include 35 | 36 | namespace google { 37 | namespace protobuf { 38 | class FieldDescriptor; // descriptor.h 39 | namespace io { 40 | class Printer; // printer.h 41 | } 42 | } 43 | 44 | namespace protobuf { 45 | namespace compiler { 46 | namespace objectivec { 47 | 48 | class ExtensionGenerator { 49 | public: 50 | ExtensionGenerator(const string& root_class_name, 51 | const FieldDescriptor* descriptor); 52 | ~ExtensionGenerator(); 53 | 54 | void GenerateMembersHeader(io::Printer* printer); 55 | void GenerateStaticVariablesInitialization(io::Printer* printer); 56 | void GenerateRegistrationSource(io::Printer* printer); 57 | 58 | private: 59 | string method_name_; 60 | string root_class_and_method_name_; 61 | const FieldDescriptor* descriptor_; 62 | 63 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ExtensionGenerator); 64 | }; 65 | } // namespace objectivec 66 | } // namespace compiler 67 | } // namespace protobuf 68 | } // namespace google 69 | #endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MESSAGE_H__ 70 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/objectivec/objectivec_map_field.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2015 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 | #ifndef GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MAP_FIELD_H__ 32 | #define GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MAP_FIELD_H__ 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | namespace google { 39 | namespace protobuf { 40 | namespace compiler { 41 | namespace objectivec { 42 | 43 | class MapFieldGenerator : public RepeatedFieldGenerator { 44 | friend FieldGenerator* FieldGenerator::Make(const FieldDescriptor* field, 45 | const Options& options); 46 | 47 | public: 48 | virtual void FinishInitialization(void); 49 | 50 | protected: 51 | MapFieldGenerator(const FieldDescriptor* descriptor, const Options& options); 52 | virtual ~MapFieldGenerator(); 53 | 54 | virtual void DetermineForwardDeclarations(std::set* fwd_decls) const; 55 | 56 | private: 57 | std::unique_ptr value_field_generator_; 58 | 59 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(MapFieldGenerator); 60 | }; 61 | 62 | } // namespace objectivec 63 | } // namespace compiler 64 | } // namespace protobuf 65 | } // namespace google 66 | 67 | #endif // GOOGLE_PROTOBUF_COMPILER_OBJECTIVEC_MAP_FIELD_H__ 68 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/php/php_generator.h: -------------------------------------------------------------------------------- 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 | #ifndef GOOGLE_PROTOBUF_COMPILER_PHP_GENERATOR_H__ 32 | #define GOOGLE_PROTOBUF_COMPILER_PHP_GENERATOR_H__ 33 | 34 | #include 35 | #include 36 | 37 | #include 38 | 39 | namespace google { 40 | namespace protobuf { 41 | namespace compiler { 42 | namespace php { 43 | 44 | class LIBPROTOC_EXPORT Generator 45 | : public google::protobuf::compiler::CodeGenerator { 46 | virtual bool Generate( 47 | const FileDescriptor* file, 48 | const string& parameter, 49 | GeneratorContext* generator_context, 50 | string* error) const; 51 | }; 52 | 53 | // To skip reserved keywords in php, some generated classname are prefixed. 54 | // Other code generators may need following API to figure out the actual 55 | // classname. 56 | LIBPROTOC_EXPORT std::string GeneratedClassName( 57 | const google::protobuf::Descriptor* desc); 58 | LIBPROTOC_EXPORT std::string GeneratedClassName( 59 | const google::protobuf::EnumDescriptor* desc); 60 | LIBPROTOC_EXPORT std::string GeneratedClassName( 61 | const google::protobuf::ServiceDescriptor* desc); 62 | 63 | } // namespace php 64 | } // namespace compiler 65 | } // namespace protobuf 66 | } // namespace google 67 | 68 | #endif // GOOGLE_PROTOBUF_COMPILER_PHP_GENERATOR_H__ 69 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/ruby/ruby_generated_code.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package A.B.C; 4 | 5 | message TestMessage { 6 | int32 optional_int32 = 1; 7 | int64 optional_int64 = 2; 8 | uint32 optional_uint32 = 3; 9 | uint64 optional_uint64 = 4; 10 | bool optional_bool = 5; 11 | double optional_double = 6; 12 | float optional_float = 7; 13 | string optional_string = 8; 14 | bytes optional_bytes = 9; 15 | TestEnum optional_enum = 10; 16 | TestMessage optional_msg = 11; 17 | 18 | repeated int32 repeated_int32 = 21; 19 | repeated int64 repeated_int64 = 22; 20 | repeated uint32 repeated_uint32 = 23; 21 | repeated uint64 repeated_uint64 = 24; 22 | repeated bool repeated_bool = 25; 23 | repeated double repeated_double = 26; 24 | repeated float repeated_float = 27; 25 | repeated string repeated_string = 28; 26 | repeated bytes repeated_bytes = 29; 27 | repeated TestEnum repeated_enum = 30; 28 | repeated TestMessage repeated_msg = 31; 29 | 30 | oneof my_oneof { 31 | int32 oneof_int32 = 41; 32 | int64 oneof_int64 = 42; 33 | uint32 oneof_uint32 = 43; 34 | uint64 oneof_uint64 = 44; 35 | bool oneof_bool = 45; 36 | double oneof_double = 46; 37 | float oneof_float = 47; 38 | string oneof_string = 48; 39 | bytes oneof_bytes = 49; 40 | TestEnum oneof_enum = 50; 41 | TestMessage oneof_msg = 51; 42 | } 43 | 44 | map map_int32_string = 61; 45 | map map_int64_string = 62; 46 | map map_uint32_string = 63; 47 | map map_uint64_string = 64; 48 | map map_bool_string = 65; 49 | map map_string_string = 66; 50 | map map_string_msg = 67; 51 | map map_string_enum = 68; 52 | map map_string_int32 = 69; 53 | map map_string_bool = 70; 54 | 55 | message NestedMessage { 56 | int32 foo = 1; 57 | } 58 | 59 | NestedMessage nested_message = 80; 60 | } 61 | 62 | enum TestEnum { 63 | Default = 0; 64 | A = 1; 65 | B = 2; 66 | C = 3; 67 | } 68 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/ruby/ruby_generator.h: -------------------------------------------------------------------------------- 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 | // Generates Ruby code for a given .proto file. 32 | 33 | #ifndef GOOGLE_PROTOBUF_COMPILER_RUBY_GENERATOR_H__ 34 | #define GOOGLE_PROTOBUF_COMPILER_RUBY_GENERATOR_H__ 35 | 36 | #include 37 | 38 | #include 39 | 40 | namespace google { 41 | namespace protobuf { 42 | namespace compiler { 43 | namespace ruby { 44 | 45 | // CodeGenerator implementation for generated Ruby protocol buffer classes. 46 | // If you create your own protocol compiler binary and you want it to support 47 | // Ruby output, you can do so by registering an instance of this 48 | // CodeGenerator with the CommandLineInterface in your main() function. 49 | class LIBPROTOC_EXPORT Generator 50 | : public google::protobuf::compiler::CodeGenerator { 51 | virtual bool Generate( 52 | const FileDescriptor* file, 53 | const string& parameter, 54 | GeneratorContext* generator_context, 55 | string* error) const; 56 | }; 57 | 58 | } // namespace ruby 59 | } // namespace compiler 60 | } // namespace protobuf 61 | } // namespace google 62 | 63 | #endif // GOOGLE_PROTOBUF_COMPILER_RUBY_GENERATOR_H__ 64 | 65 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/compiler/test_plugin.cc: -------------------------------------------------------------------------------- 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: kenton@google.com (Kenton Varda) 32 | // 33 | // This is a dummy code generator plugin used by 34 | // command_line_interface_unittest. 35 | 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | int main(int argc, char* argv[]) { 42 | #ifdef _MSC_VER 43 | // Don't print a silly message or stick a modal dialog box in my face, 44 | // please. 45 | _set_abort_behavior(0, ~0); 46 | #endif // !_MSC_VER 47 | 48 | google::protobuf::compiler::MockCodeGenerator generator("test_plugin"); 49 | return google::protobuf::compiler::PluginMain(argc, argv, &generator); 50 | } 51 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/empty.proto: -------------------------------------------------------------------------------- 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 | syntax = "proto3"; 32 | 33 | package google.protobuf; 34 | 35 | option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 36 | option go_package = "github.com/golang/protobuf/ptypes/empty"; 37 | option java_package = "com.google.protobuf"; 38 | option java_outer_classname = "EmptyProto"; 39 | option java_multiple_files = true; 40 | option objc_class_prefix = "GPB"; 41 | option cc_enable_arenas = true; 42 | 43 | // A generic empty message that you can re-use to avoid defining duplicated 44 | // empty messages in your APIs. A typical example is to use it as the request 45 | // or the response type of an API method. For instance: 46 | // 47 | // service Foo { 48 | // rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); 49 | // } 50 | // 51 | // The JSON representation for `Empty` is empty JSON object `{}`. 52 | message Empty {} 53 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/generated_enum_util.h: -------------------------------------------------------------------------------- 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 | #ifndef GOOGLE_PROTOBUF_GENERATED_ENUM_UTIL_H__ 32 | #define GOOGLE_PROTOBUF_GENERATED_ENUM_UTIL_H__ 33 | 34 | #include 35 | 36 | namespace google { 37 | namespace protobuf { 38 | 39 | // This type trait can be used to cause templates to only match proto2 enum 40 | // types. 41 | template struct is_proto_enum : ::std::false_type {}; 42 | 43 | } // namespace protobuf 44 | 45 | } // namespace google 46 | #endif // GOOGLE_PROTOBUF_GENERATED_ENUM_UTIL_H__ 47 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/implicit_weak_message.cc: -------------------------------------------------------------------------------- 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 | #include 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | namespace google { 38 | namespace protobuf { 39 | namespace internal { 40 | 41 | bool ImplicitWeakMessage::MergePartialFromCodedStream(io::CodedInputStream* input) { 42 | io::StringOutputStream string_stream(&data_); 43 | io::CodedOutputStream coded_stream(&string_stream, false); 44 | return WireFormatLite::SkipMessage(input, &coded_stream); 45 | } 46 | 47 | ::google::protobuf::internal::ExplicitlyConstructed 48 | implicit_weak_message_default_instance; 49 | GOOGLE_PROTOBUF_DECLARE_ONCE(implicit_weak_message_once_init_); 50 | 51 | void InitImplicitWeakMessageDefaultInstance() { 52 | implicit_weak_message_default_instance.DefaultConstruct(); 53 | } 54 | 55 | const ImplicitWeakMessage* ImplicitWeakMessage::default_instance() { 56 | ::google::protobuf::GoogleOnceInit(&implicit_weak_message_once_init_, 57 | &InitImplicitWeakMessageDefaultInstance); 58 | return &implicit_weak_message_default_instance.get(); 59 | } 60 | 61 | } // namespace internal 62 | } // namespace protobuf 63 | } // namespace google 64 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/io/gzip_stream_unittest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -x 2 | # 3 | # Protocol Buffers - Google's data interchange format 4 | # Copyright 2009 Google Inc. All rights reserved. 5 | # https://developers.google.com/protocol-buffers/ 6 | # 7 | # Redistribution and use in source and binary forms, with or without 8 | # modification, are permitted provided that the following conditions are 9 | # met: 10 | # 11 | # * Redistributions of source code must retain the above copyright 12 | # notice, this list of conditions and the following disclaimer. 13 | # * Redistributions in binary form must reproduce the above 14 | # copyright notice, this list of conditions and the following disclaimer 15 | # in the documentation and/or other materials provided with the 16 | # distribution. 17 | # * Neither the name of Google Inc. nor the names of its 18 | # contributors may be used to endorse or promote products derived from 19 | # this software without specific prior written permission. 20 | # 21 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | # 33 | # Author: brianolson@google.com (Brian Olson) 34 | # 35 | # Test compatibility between command line gzip/gunzip binaries and 36 | # ZeroCopyStream versions. 37 | 38 | TESTFILE=Makefile 39 | 40 | (./zcgzip < ${TESTFILE} | gunzip | cmp - ${TESTFILE}) && \ 41 | (gzip < ${TESTFILE} | ./zcgunzip | cmp - ${TESTFILE}) 42 | 43 | # Result of "(cmd) && (cmd)" implicitly becomes result of this script 44 | # and thus the test. 45 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/io/package_info.h: -------------------------------------------------------------------------------- 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: kenton@google.com (Kenton Varda) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | // 35 | // This file exists solely to document the google::protobuf::io namespace. 36 | // It is not compiled into anything, but it may be read by an automated 37 | // documentation generator. 38 | 39 | namespace google { 40 | 41 | namespace protobuf { 42 | 43 | // Auxiliary classes used for I/O. 44 | // 45 | // The Protocol Buffer library uses the classes in this package to deal with 46 | // I/O and encoding/decoding raw bytes. Most users will not need to 47 | // deal with this package. However, users who want to adapt the system to 48 | // work with their own I/O abstractions -- e.g., to allow Protocol Buffers 49 | // to be read from a different kind of input stream without the need for a 50 | // temporary buffer -- should take a closer look. 51 | namespace io {} 52 | 53 | } // namespace protobuf 54 | } // namespace google 55 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/io/strtod.h: -------------------------------------------------------------------------------- 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 | // A locale-independent version of strtod(), used to parse floating 32 | // point default values in .proto files, where the decimal separator 33 | // is always a dot. 34 | 35 | #ifndef GOOGLE_PROTOBUF_IO_STRTOD_H__ 36 | #define GOOGLE_PROTOBUF_IO_STRTOD_H__ 37 | 38 | namespace google { 39 | namespace protobuf { 40 | namespace io { 41 | 42 | // A locale-independent version of the standard strtod(), which always 43 | // uses a dot as the decimal separator. 44 | double NoLocaleStrtod(const char* str, char** endptr); 45 | 46 | // Casts a double value to a float value. If the value is outside of the 47 | // representable range of float, it will be converted to positive or negative 48 | // infinity. 49 | float SafeDoubleToFloat(double value); 50 | 51 | } // namespace io 52 | } // namespace protobuf 53 | 54 | } // namespace google 55 | #endif // GOOGLE_PROTOBUF_IO_STRTOD_H__ 56 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/io/zero_copy_stream.cc: -------------------------------------------------------------------------------- 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: kenton@google.com (Kenton Varda) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | 35 | #include 36 | 37 | #include 38 | #include 39 | 40 | namespace google { 41 | namespace protobuf { 42 | namespace io { 43 | 44 | 45 | bool ZeroCopyOutputStream::WriteAliasedRaw(const void* /* data */, 46 | int /* size */) { 47 | GOOGLE_LOG(FATAL) << "This ZeroCopyOutputStream doesn't support aliasing. " 48 | "Reaching here usually means a ZeroCopyOutputStream " 49 | "implementation bug."; 50 | return false; 51 | } 52 | 53 | } // namespace io 54 | } // namespace protobuf 55 | } // namespace google 56 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/service.cc: -------------------------------------------------------------------------------- 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: kenton@google.com (Kenton Varda) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | 35 | #include 36 | 37 | namespace google { 38 | namespace protobuf { 39 | 40 | Service::~Service() {} 41 | RpcChannel::~RpcChannel() {} 42 | RpcController::~RpcController() {} 43 | 44 | } // namespace protobuf 45 | 46 | } // namespace google 47 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/source_context.proto: -------------------------------------------------------------------------------- 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 | syntax = "proto3"; 32 | 33 | package google.protobuf; 34 | 35 | option csharp_namespace = "Google.Protobuf.WellKnownTypes"; 36 | option java_package = "com.google.protobuf"; 37 | option java_outer_classname = "SourceContextProto"; 38 | option java_multiple_files = true; 39 | option objc_class_prefix = "GPB"; 40 | option go_package = "google.golang.org/genproto/protobuf/source_context;source_context"; 41 | 42 | // `SourceContext` represents information about the source of a 43 | // protobuf element, like the file in which it is defined. 44 | message SourceContext { 45 | // The path-qualified name of the .proto file that contained the associated 46 | // protobuf element. For example: `"google/protobuf/source_context.proto"`. 47 | string file_name = 1; 48 | } 49 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/stubs/singleton.h: -------------------------------------------------------------------------------- 1 | // Protocol Buffers - Google's data interchange format 2 | // Copyright 2014 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 | #ifndef GOOGLE_PROTOBUF_STUBS_SINGLETON_H__ 31 | #define GOOGLE_PROTOBUF_STUBS_SINGLETON_H__ 32 | 33 | #include 34 | #include 35 | 36 | namespace google { 37 | namespace protobuf { 38 | namespace internal { 39 | template 40 | class Singleton { 41 | public: 42 | static T* get() { 43 | GoogleOnceInit(&once_, &Singleton::Init); 44 | return instance_; 45 | } 46 | static void ShutDown() { 47 | delete instance_; 48 | instance_ = NULL; 49 | } 50 | private: 51 | static void Init() { 52 | instance_ = new T(); 53 | } 54 | static ProtobufOnceType once_; 55 | static T* instance_; 56 | }; 57 | 58 | template 59 | ProtobufOnceType Singleton::once_; 60 | 61 | template 62 | T* Singleton::instance_ = NULL; 63 | } // namespace internal 64 | } // namespace protobuf 65 | } // namespace google 66 | 67 | #endif // GOOGLE_PROTOBUF_STUBS_SINGLETON_H__ 68 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/stubs/statusor.cc: -------------------------------------------------------------------------------- 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 | #include 32 | 33 | namespace google { 34 | namespace protobuf { 35 | namespace util { 36 | namespace internal { 37 | 38 | void StatusOrHelper::Crash(const Status& status) { 39 | GOOGLE_LOG(FATAL) << "Attempting to fetch value instead of handling error " 40 | << status.ToString(); 41 | } 42 | 43 | } // namespace internal 44 | } // namespace util 45 | } // namespace protobuf 46 | } // namespace google 47 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/testdata/bad_utf8_string: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NiteKat/DAPI/e524068f8e77caafeea6a5c74f7cccad1d76d47b/libprotobuf-lite/src/google/protobuf/testdata/bad_utf8_string -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/testdata/golden_message: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NiteKat/DAPI/e524068f8e77caafeea6a5c74f7cccad1d76d47b/libprotobuf-lite/src/google/protobuf/testdata/golden_message -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/testdata/golden_message_maps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NiteKat/DAPI/e524068f8e77caafeea6a5c74f7cccad1d76d47b/libprotobuf-lite/src/google/protobuf/testdata/golden_message_maps -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/testdata/golden_message_oneof_implemented: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NiteKat/DAPI/e524068f8e77caafeea6a5c74f7cccad1d76d47b/libprotobuf-lite/src/google/protobuf/testdata/golden_message_oneof_implemented -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/testdata/golden_message_proto3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NiteKat/DAPI/e524068f8e77caafeea6a5c74f7cccad1d76d47b/libprotobuf-lite/src/google/protobuf/testdata/golden_message_proto3 -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/testdata/golden_packed_fields_message: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NiteKat/DAPI/e524068f8e77caafeea6a5c74f7cccad1d76d47b/libprotobuf-lite/src/google/protobuf/testdata/golden_packed_fields_message -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/testdata/map_test_data.txt: -------------------------------------------------------------------------------- 1 | map_int32_int32 { 2 | key: 0 3 | value: 0 4 | } 5 | map_int32_int32 { 6 | key: 1 7 | value: 1 8 | } 9 | map_int64_int64 { 10 | key: 0 11 | value: 0 12 | } 13 | map_int64_int64 { 14 | key: 1 15 | value: 1 16 | } 17 | map_uint32_uint32 { 18 | key: 0 19 | value: 0 20 | } 21 | map_uint32_uint32 { 22 | key: 1 23 | value: 1 24 | } 25 | map_uint64_uint64 { 26 | key: 0 27 | value: 0 28 | } 29 | map_uint64_uint64 { 30 | key: 1 31 | value: 1 32 | } 33 | map_sint32_sint32 { 34 | key: 0 35 | value: 0 36 | } 37 | map_sint32_sint32 { 38 | key: 1 39 | value: 1 40 | } 41 | map_sint64_sint64 { 42 | key: 0 43 | value: 0 44 | } 45 | map_sint64_sint64 { 46 | key: 1 47 | value: 1 48 | } 49 | map_fixed32_fixed32 { 50 | key: 0 51 | value: 0 52 | } 53 | map_fixed32_fixed32 { 54 | key: 1 55 | value: 1 56 | } 57 | map_fixed64_fixed64 { 58 | key: 0 59 | value: 0 60 | } 61 | map_fixed64_fixed64 { 62 | key: 1 63 | value: 1 64 | } 65 | map_sfixed32_sfixed32 { 66 | key: 0 67 | value: 0 68 | } 69 | map_sfixed32_sfixed32 { 70 | key: 1 71 | value: 1 72 | } 73 | map_sfixed64_sfixed64 { 74 | key: 0 75 | value: 0 76 | } 77 | map_sfixed64_sfixed64 { 78 | key: 1 79 | value: 1 80 | } 81 | map_int32_float { 82 | key: 0 83 | value: 0 84 | } 85 | map_int32_float { 86 | key: 1 87 | value: 1 88 | } 89 | map_int32_double { 90 | key: 0 91 | value: 0 92 | } 93 | map_int32_double { 94 | key: 1 95 | value: 1 96 | } 97 | map_bool_bool { 98 | key: false 99 | value: false 100 | } 101 | map_bool_bool { 102 | key: true 103 | value: true 104 | } 105 | map_string_string { 106 | key: "0" 107 | value: "0" 108 | } 109 | map_string_string { 110 | key: "1" 111 | value: "1" 112 | } 113 | map_int32_bytes { 114 | key: 0 115 | value: "0" 116 | } 117 | map_int32_bytes { 118 | key: 1 119 | value: "1" 120 | } 121 | map_int32_enum { 122 | key: 0 123 | value: MAP_ENUM_BAR 124 | } 125 | map_int32_enum { 126 | key: 1 127 | value: MAP_ENUM_BAZ 128 | } 129 | map_int32_foreign_message { 130 | key: 0 131 | value { 132 | c: 0 133 | } 134 | } 135 | map_int32_foreign_message { 136 | key: 1 137 | value { 138 | c: 1 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/unittest_arena.proto: -------------------------------------------------------------------------------- 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 | syntax = "proto2"; 32 | 33 | import "google/protobuf/unittest_no_arena_import.proto"; 34 | 35 | package proto2_arena_unittest; 36 | 37 | option cc_enable_arenas = true; 38 | 39 | message NestedMessage { 40 | optional int32 d = 1; 41 | } 42 | 43 | message ArenaMessage { 44 | repeated NestedMessage repeated_nested_message = 1; 45 | repeated ImportNoArenaNestedMessage repeated_import_no_arena_message = 2; 46 | }; 47 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/unittest_drop_unknown_fields.proto: -------------------------------------------------------------------------------- 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 | syntax = "proto3"; 32 | 33 | package unittest_drop_unknown_fields; 34 | option objc_class_prefix = "DropUnknowns"; 35 | 36 | option csharp_namespace = "Google.Protobuf.TestProtos"; 37 | 38 | message Foo { 39 | enum NestedEnum { 40 | FOO = 0; 41 | BAR = 1; 42 | BAZ = 2; 43 | } 44 | int32 int32_value = 1; 45 | NestedEnum enum_value = 2; 46 | } 47 | 48 | message FooWithExtraFields { 49 | enum NestedEnum { 50 | FOO = 0; 51 | BAR = 1; 52 | BAZ = 2; 53 | QUX = 3; 54 | } 55 | int32 int32_value = 1; 56 | NestedEnum enum_value = 2; 57 | int32 extra_int32_value = 3; 58 | } 59 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/unittest_embed_optimize_for.proto: -------------------------------------------------------------------------------- 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: kenton@google.com (Kenton Varda) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | // 35 | // A proto file which imports a proto file that uses optimize_for = CODE_SIZE. 36 | 37 | syntax = "proto2"; 38 | import "google/protobuf/unittest_optimize_for.proto"; 39 | 40 | package protobuf_unittest; 41 | 42 | // We optimize for speed here, but we are importing a proto that is optimized 43 | // for code size. 44 | option optimize_for = SPEED; 45 | 46 | message TestEmbedOptimizedForSize { 47 | // Test that embedding a message which has optimize_for = CODE_SIZE into 48 | // one optimized for speed works. 49 | optional TestOptimizedForSize optional_message = 1; 50 | repeated TestOptimizedForSize repeated_message = 2; 51 | } 52 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/unittest_empty.proto: -------------------------------------------------------------------------------- 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: kenton@google.com (Kenton Varda) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | // 35 | // This file intentionally left blank. (At one point this wouldn't compile 36 | // correctly.) 37 | 38 | syntax = "proto2"; 39 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/unittest_import.proto: -------------------------------------------------------------------------------- 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: kenton@google.com (Kenton Varda) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | // 35 | // A proto file which is imported by unittest.proto to test importing. 36 | 37 | syntax = "proto2"; 38 | 39 | // We don't put this in a package within proto2 because we need to make sure 40 | // that the generated code doesn't depend on being in the proto2 namespace. 41 | // In test_util.h we do 42 | // "using namespace unittest_import = protobuf_unittest_import". 43 | package protobuf_unittest_import; 44 | 45 | option optimize_for = SPEED; 46 | option cc_enable_arenas = true; 47 | 48 | // Exercise the java_package option. 49 | option java_package = "com.google.protobuf.test"; 50 | 51 | // Do not set a java_outer_classname here to verify that Proto2 works without 52 | // one. 53 | 54 | // Test public import 55 | import public "google/protobuf/unittest_import_public.proto"; 56 | 57 | message ImportMessage { 58 | optional int32 d = 1; 59 | } 60 | 61 | enum ImportEnum { 62 | IMPORT_FOO = 7; 63 | IMPORT_BAR = 8; 64 | IMPORT_BAZ = 9; 65 | } 66 | 67 | 68 | // To use an enum in a map, it must has the first value as 0. 69 | enum ImportEnumForMap { 70 | UNKNOWN = 0; 71 | FOO = 1; 72 | BAR = 2; 73 | } 74 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/unittest_import_lite.proto: -------------------------------------------------------------------------------- 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: kenton@google.com (Kenton Varda) 32 | // 33 | // This is like unittest_import.proto but with optimize_for = LITE_RUNTIME. 34 | 35 | syntax = "proto2"; 36 | package protobuf_unittest_import; 37 | 38 | option optimize_for = LITE_RUNTIME; 39 | 40 | option java_package = "com.google.protobuf"; 41 | 42 | import public "google/protobuf/unittest_import_public_lite.proto"; 43 | 44 | message ImportMessageLite { 45 | optional int32 d = 1; 46 | } 47 | 48 | enum ImportEnumLite { 49 | IMPORT_LITE_FOO = 7; 50 | IMPORT_LITE_BAR = 8; 51 | IMPORT_LITE_BAZ = 9; 52 | } 53 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/unittest_import_public.proto: -------------------------------------------------------------------------------- 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: liujisi@google.com (Pherl Liu) 32 | 33 | syntax = "proto2"; 34 | 35 | package protobuf_unittest_import; 36 | 37 | option java_package = "com.google.protobuf.test"; 38 | 39 | message PublicImportMessage { 40 | optional int32 e = 1; 41 | } 42 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/unittest_import_public_lite.proto: -------------------------------------------------------------------------------- 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: liujisi@google.com (Pherl Liu) 32 | 33 | syntax = "proto2"; 34 | 35 | package protobuf_unittest_import; 36 | 37 | option optimize_for = LITE_RUNTIME; 38 | 39 | option java_package = "com.google.protobuf"; 40 | 41 | message PublicImportMessageLite { 42 | optional int32 e = 1; 43 | } 44 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/unittest_lazy_dependencies_enum.proto: -------------------------------------------------------------------------------- 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: trafacz@google.com (Todd Rafacz) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | // 35 | // A proto file we will use for unit testing. 36 | 37 | syntax = "proto2"; 38 | 39 | // Some generic_services option(s) added automatically. 40 | // See: http://go/proto2-generic-services-default 41 | option cc_generic_services = true; // auto-added 42 | option java_generic_services = true; // auto-added 43 | option py_generic_services = true; // auto-added 44 | option cc_enable_arenas = true; 45 | 46 | // We don't put this in a package within proto2 because we need to make sure 47 | // that the generated code doesn't depend on being in the proto2 namespace. 48 | // In test_util.h we do "using namespace unittest = protobuf_unittest". 49 | package protobuf_unittest.lazy_imports; 50 | 51 | // Protos optimized for SPEED use a strict superset of the generated code 52 | // of equivalent ones optimized for CODE_SIZE, so we should optimize all our 53 | // tests for speed unless explicitly testing code size optimization. 54 | option optimize_for = SPEED; 55 | 56 | option java_outer_classname = "UnittestLazyImportsEnumProto"; 57 | 58 | enum LazyEnum { 59 | LAZY_ENUM_0 = 0; 60 | LAZY_ENUM_1 = 1; 61 | } 62 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/unittest_lite_imports_nonlite.proto: -------------------------------------------------------------------------------- 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: kenton@google.com (Kenton Varda) 32 | // 33 | // Tests that a "lite" message can import a regular message. 34 | 35 | syntax = "proto2"; 36 | package protobuf_unittest; 37 | 38 | import "google/protobuf/unittest.proto"; 39 | 40 | option optimize_for = LITE_RUNTIME; 41 | 42 | message TestLiteImportsNonlite { 43 | optional TestAllTypes message = 1; 44 | 45 | // Verifies that transitive required fields generates valid code. 46 | optional TestRequired message_with_required = 2; 47 | } 48 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/unittest_mset_wire_format.proto: -------------------------------------------------------------------------------- 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: kenton@google.com (Kenton Varda) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | // 35 | // This file contains messages for testing message_set_wire_format. 36 | 37 | syntax = "proto2"; 38 | package proto2_wireformat_unittest; 39 | 40 | option cc_enable_arenas = true; 41 | option optimize_for = SPEED; 42 | option csharp_namespace = "Google.ProtocolBuffers.TestProtos"; 43 | 44 | // A message with message_set_wire_format. 45 | message TestMessageSet { 46 | option message_set_wire_format = true; 47 | extensions 4 to max; 48 | } 49 | 50 | message TestMessageSetWireFormatContainer { 51 | optional TestMessageSet message_set = 1; 52 | } 53 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/unittest_no_arena_import.proto: -------------------------------------------------------------------------------- 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 | syntax = "proto2"; 32 | 33 | package proto2_arena_unittest; 34 | 35 | message ImportNoArenaNestedMessage { 36 | optional int32 d = 1; 37 | }; 38 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/unittest_no_arena_lite.proto: -------------------------------------------------------------------------------- 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 | syntax = "proto2"; 32 | 33 | option optimize_for = LITE_RUNTIME; 34 | 35 | // We don't put this in a package within proto2 because we need to make sure 36 | // that the generated code doesn't depend on being in the proto2 namespace. 37 | // In test_util.h we do "using namespace unittest = protobuf_unittest". 38 | package protobuf_unittest_no_arena; 39 | 40 | message ForeignMessageLite { 41 | optional int32 c = 1; 42 | } 43 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/unittest_no_generic_services.proto: -------------------------------------------------------------------------------- 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: kenton@google.com (Kenton Varda) 32 | 33 | syntax = "proto2"; 34 | package google.protobuf.no_generic_services_test; 35 | 36 | 37 | // *_generic_services are false by default. 38 | 39 | message TestMessage { 40 | optional int32 a = 1; 41 | extensions 1000 to max; 42 | } 43 | 44 | enum TestEnum { 45 | FOO = 1; 46 | } 47 | 48 | extend TestMessage { 49 | optional int32 test_extension = 1000; 50 | } 51 | 52 | service TestService { 53 | rpc Foo(TestMessage) returns(TestMessage); 54 | } 55 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/unittest_optimize_for.proto: -------------------------------------------------------------------------------- 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: kenton@google.com (Kenton Varda) 32 | // Based on original Protocol Buffers design by 33 | // Sanjay Ghemawat, Jeff Dean, and others. 34 | // 35 | // A proto file which uses optimize_for = CODE_SIZE. 36 | 37 | syntax = "proto2"; 38 | import "google/protobuf/unittest.proto"; 39 | 40 | package protobuf_unittest; 41 | 42 | option optimize_for = CODE_SIZE; 43 | 44 | message TestOptimizedForSize { 45 | optional int32 i = 1; 46 | optional ForeignMessage msg = 19; 47 | 48 | extensions 1000 to max; 49 | 50 | extend TestOptimizedForSize { 51 | optional int32 test_extension = 1234; 52 | optional TestRequiredOptimizedForSize test_extension2 = 1235; 53 | } 54 | 55 | oneof foo { 56 | int32 integer_field = 2; 57 | string string_field = 3; 58 | } 59 | } 60 | 61 | message TestRequiredOptimizedForSize { 62 | required int32 x = 1; 63 | } 64 | 65 | message TestOptionalOptimizedForSize { 66 | optional TestRequiredOptimizedForSize o = 1; 67 | } 68 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/unittest_preserve_unknown_enum.proto: -------------------------------------------------------------------------------- 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 | syntax = "proto3"; 32 | 33 | package proto3_preserve_unknown_enum_unittest; 34 | option objc_class_prefix = "UnknownEnums"; 35 | 36 | option csharp_namespace = "Google.Protobuf.TestProtos"; 37 | 38 | enum MyEnum { 39 | FOO = 0; 40 | BAR = 1; 41 | BAZ = 2; 42 | } 43 | 44 | enum MyEnumPlusExtra { 45 | E_FOO = 0; 46 | E_BAR = 1; 47 | E_BAZ = 2; 48 | E_EXTRA = 3; 49 | } 50 | 51 | message MyMessage { 52 | MyEnum e = 1; 53 | repeated MyEnum repeated_e = 2; 54 | repeated MyEnum repeated_packed_e = 3 [packed=true]; 55 | repeated MyEnumPlusExtra repeated_packed_unexpected_e = 4; // not packed 56 | oneof o { 57 | MyEnum oneof_e_1 = 5; 58 | MyEnum oneof_e_2 = 6; 59 | } 60 | } 61 | 62 | message MyMessagePlusExtra { 63 | MyEnumPlusExtra e = 1; 64 | repeated MyEnumPlusExtra repeated_e = 2; 65 | repeated MyEnumPlusExtra repeated_packed_e = 3 [packed=true]; 66 | repeated MyEnumPlusExtra repeated_packed_unexpected_e = 4 [packed=true]; 67 | oneof o { 68 | MyEnumPlusExtra oneof_e_1 = 5; 69 | MyEnumPlusExtra oneof_e_2 = 6; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/unittest_preserve_unknown_enum2.proto: -------------------------------------------------------------------------------- 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 | syntax = "proto2"; 32 | 33 | package proto2_preserve_unknown_enum_unittest; 34 | 35 | enum MyEnum { 36 | FOO = 0; 37 | BAR = 1; 38 | BAZ = 2; 39 | } 40 | 41 | message MyMessage { 42 | optional MyEnum e = 1; 43 | repeated MyEnum repeated_e = 2; 44 | repeated MyEnum repeated_packed_e = 3 [packed=true]; 45 | repeated MyEnum repeated_packed_unexpected_e = 4; // not packed 46 | oneof o { 47 | MyEnum oneof_e_1 = 5; 48 | MyEnum oneof_e_2 = 6; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/util/delimited_message_util.cc: -------------------------------------------------------------------------------- 1 | // Adapted from the patch of kenton@google.com (Kenton Varda) 2 | // See https://github.com/google/protobuf/pull/710 for details. 3 | 4 | #include 5 | 6 | namespace google { 7 | namespace protobuf { 8 | namespace util { 9 | 10 | bool SerializeDelimitedToFileDescriptor(const MessageLite& message, int file_descriptor) { 11 | io::FileOutputStream output(file_descriptor); 12 | return SerializeDelimitedToZeroCopyStream(message, &output); 13 | } 14 | 15 | bool SerializeDelimitedToOstream(const MessageLite& message, std::ostream* output) { 16 | { 17 | io::OstreamOutputStream zero_copy_output(output); 18 | if (!SerializeDelimitedToZeroCopyStream(message, &zero_copy_output)) return false; 19 | } 20 | return output->good(); 21 | } 22 | 23 | bool ParseDelimitedFromZeroCopyStream(MessageLite* message, io::ZeroCopyInputStream* input, bool* clean_eof) { 24 | google::protobuf::io::CodedInputStream coded_input(input); 25 | return ParseDelimitedFromCodedStream(message, &coded_input, clean_eof); 26 | } 27 | 28 | bool ParseDelimitedFromCodedStream(MessageLite* message, io::CodedInputStream* input, bool* clean_eof) { 29 | if (clean_eof != NULL) *clean_eof = false; 30 | int start = input->CurrentPosition(); 31 | 32 | // Read the size. 33 | uint32 size; 34 | if (!input->ReadVarint32(&size)) { 35 | if (clean_eof != NULL) *clean_eof = input->CurrentPosition() == start; 36 | return false; 37 | } 38 | 39 | // Tell the stream not to read beyond that size. 40 | google::protobuf::io::CodedInputStream::Limit limit = input->PushLimit(size); 41 | 42 | // Parse the message. 43 | if (!message->MergeFromCodedStream(input)) return false; 44 | if (!input->ConsumedEntireMessage()) return false; 45 | 46 | // Release the limit. 47 | input->PopLimit(limit); 48 | 49 | return true; 50 | } 51 | 52 | bool SerializeDelimitedToZeroCopyStream(const MessageLite& message, io::ZeroCopyOutputStream* output) { 53 | google::protobuf::io::CodedOutputStream coded_output(output); 54 | return SerializeDelimitedToCodedStream(message, &coded_output); 55 | } 56 | 57 | bool SerializeDelimitedToCodedStream(const MessageLite& message, io::CodedOutputStream* output) { 58 | // Write the size. 59 | int size = message.ByteSize(); 60 | output->WriteVarint32(size); 61 | 62 | // Write the content. 63 | uint8* buffer = output->GetDirectBufferForNBytesAndAdvance(size); 64 | if (buffer != NULL) { 65 | // Optimization: The message fits in one buffer, so use the faster 66 | // direct-to-array serialization path. 67 | message.SerializeWithCachedSizesToArray(buffer); 68 | } else { 69 | // Slightly-slower path when the message is multiple buffers. 70 | message.SerializeWithCachedSizes(output); 71 | if (output->HadError()) return false; 72 | } 73 | 74 | return true; 75 | } 76 | 77 | } // namespace util 78 | } // namespace protobuf 79 | } // namespace google 80 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/util/internal/error_listener.cc: -------------------------------------------------------------------------------- 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 | #include 32 | 33 | namespace google { 34 | namespace protobuf { 35 | namespace util { 36 | namespace converter { 37 | 38 | 39 | } // namespace converter 40 | } // namespace util 41 | } // namespace protobuf 42 | } // namespace google 43 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/util/internal/location_tracker.h: -------------------------------------------------------------------------------- 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 | #ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_LOCATION_TRACKER_H__ 32 | #define GOOGLE_PROTOBUF_UTIL_CONVERTER_LOCATION_TRACKER_H__ 33 | 34 | #include 35 | 36 | #include 37 | 38 | namespace google { 39 | namespace protobuf { 40 | namespace util { 41 | namespace converter { 42 | 43 | // LocationTrackerInterface is an interface for classes that track 44 | // the location information for the purpose of error reporting. 45 | class LIBPROTOBUF_EXPORT LocationTrackerInterface { 46 | public: 47 | virtual ~LocationTrackerInterface() {} 48 | 49 | // Returns the object location as human readable string. 50 | virtual string ToString() const = 0; 51 | 52 | protected: 53 | LocationTrackerInterface() {} 54 | 55 | private: 56 | // Please do not add any data members to this class. 57 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(LocationTrackerInterface); 58 | }; 59 | 60 | } // namespace converter 61 | } // namespace util 62 | } // namespace protobuf 63 | 64 | } // namespace google 65 | #endif // GOOGLE_PROTOBUF_UTIL_CONVERTER_LOCATION_TRACKER_H__ 66 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/util/internal/object_location_tracker.h: -------------------------------------------------------------------------------- 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 | #ifndef GOOGLE_PROTOBUF_UTIL_CONVERTER_OBJECT_LOCATION_TRACKER_H__ 32 | #define GOOGLE_PROTOBUF_UTIL_CONVERTER_OBJECT_LOCATION_TRACKER_H__ 33 | 34 | #include 35 | 36 | #include 37 | #include 38 | 39 | namespace google { 40 | namespace protobuf { 41 | namespace util { 42 | namespace converter { 43 | 44 | // An empty concrete implementation of LocationTrackerInterface. 45 | class ObjectLocationTracker : public LocationTrackerInterface { 46 | public: 47 | // Creates an empty location tracker. 48 | ObjectLocationTracker() {} 49 | 50 | virtual ~ObjectLocationTracker() {} 51 | 52 | // Returns empty because nothing is tracked. 53 | virtual string ToString() const { return ""; } 54 | 55 | private: 56 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(ObjectLocationTracker); 57 | }; 58 | 59 | } // namespace converter 60 | } // namespace util 61 | } // namespace protobuf 62 | 63 | } // namespace google 64 | #endif // GOOGLE_PROTOBUF_UTIL_CONVERTER_OBJECT_LOCATION_TRACKER_H__ 65 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/util/internal/testdata/default_value_test.proto: -------------------------------------------------------------------------------- 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 | syntax = "proto3"; 32 | 33 | package google.protobuf.testing; 34 | 35 | message DefaultValueTest { 36 | double double_value = 1; 37 | repeated double repeated_double = 2; 38 | float float_value = 3; 39 | int64 int64_value = 5; 40 | uint64 uint64_value = 7; 41 | int32 int32_value = 9; 42 | uint32 uint32_value = 11; 43 | bool bool_value = 13; 44 | string string_value = 15; 45 | bytes bytes_value = 17 [ctype = CORD]; 46 | 47 | enum EnumDefault { 48 | ENUM_FIRST = 0; 49 | ENUM_SECOND = 1; 50 | ENUM_THIRD = 2; 51 | } 52 | EnumDefault enum_value = 18; 53 | } 54 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/util/internal/testdata/field_mask.proto: -------------------------------------------------------------------------------- 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 | syntax = "proto3"; 32 | 33 | package google.protobuf.testing; 34 | 35 | import "google/protobuf/field_mask.proto"; 36 | 37 | message NestedFieldMask { 38 | string data = 1; 39 | google.protobuf.FieldMask single_mask = 2; 40 | repeated google.protobuf.FieldMask repeated_mask = 3; 41 | } 42 | 43 | message FieldMaskTest { 44 | string id = 1; 45 | google.protobuf.FieldMask single_mask = 2; 46 | repeated google.protobuf.FieldMask repeated_mask = 3; 47 | repeated NestedFieldMask nested_mask = 4; 48 | } 49 | 50 | message FieldMaskTestCases { 51 | FieldMaskWrapper single_mask = 1; 52 | FieldMaskWrapper multiple_mask = 2; 53 | FieldMaskWrapper snake_camel = 3; 54 | FieldMaskWrapper empty_field = 4; 55 | FieldMaskWrapper apiary_format1 = 5; 56 | FieldMaskWrapper apiary_format2 = 6; 57 | FieldMaskWrapper apiary_format3 = 7; 58 | FieldMaskWrapper map_key1 = 8; 59 | FieldMaskWrapper map_key2 = 9; 60 | FieldMaskWrapper map_key3 = 10; 61 | FieldMaskWrapper map_key4 = 11; 62 | FieldMaskWrapper map_key5 = 12; 63 | } 64 | 65 | message FieldMaskWrapper { 66 | google.protobuf.FieldMask mask = 1; 67 | } 68 | 69 | service FieldMaskTestService { 70 | rpc Call(FieldMaskTestCases) returns (FieldMaskTestCases); 71 | } 72 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/util/internal/testdata/oneofs.proto: -------------------------------------------------------------------------------- 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 | // Proto to test proto3 oneofs. 32 | syntax = "proto3"; 33 | 34 | import "google/protobuf/any.proto"; 35 | import "google/protobuf/struct.proto"; 36 | import "google/protobuf/timestamp.proto"; 37 | 38 | package google.protobuf.testing.oneofs; 39 | 40 | message OneOfsRequest { 41 | string value = 1; 42 | oneof data { 43 | string str_data = 2; 44 | int32 int_data = 3; 45 | // Simple message 46 | Data message_data = 4; 47 | MoreData more_data = 5; 48 | // Well known types 49 | google.protobuf.Struct struct_data = 6; 50 | google.protobuf.Value value_data = 7; 51 | google.protobuf.ListValue list_value_data = 8; 52 | google.protobuf.Timestamp ts_data = 9; 53 | } 54 | google.protobuf.Any any_data = 19; 55 | } 56 | 57 | message RequestWithSimpleOneof { 58 | string value = 1; 59 | oneof data { 60 | string str_data = 2; 61 | int32 int_data = 3; 62 | Data message_data = 4; 63 | MoreData more_data = 5; 64 | } 65 | } 66 | 67 | message Data { 68 | int32 data_value = 1; 69 | } 70 | 71 | message MoreData { 72 | string str_value = 1; 73 | } 74 | 75 | message Response { 76 | string value = 1; 77 | } 78 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/util/internal/testdata/proto3.proto: -------------------------------------------------------------------------------- 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 | syntax = "proto3"; 32 | 33 | package google.protobuf.testing; 34 | 35 | message Proto3Message { 36 | enum NestedEnum { 37 | FOO = 0; 38 | BAR = 1; 39 | BAZ = 2; 40 | } 41 | NestedEnum enum_value = 1; 42 | } 43 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/util/package_info.h: -------------------------------------------------------------------------------- 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 | // This file exists solely to document the google::protobuf::util namespace. 32 | // It is not compiled into anything, but it may be read by an automated 33 | // documentation generator. 34 | 35 | namespace google { 36 | 37 | namespace protobuf { 38 | 39 | // Utility classes. 40 | // 41 | // This package contains various utilities for message comparison, JSON 42 | // conversion, well known types, etc. 43 | namespace util {} 44 | 45 | } // namespace protobuf 46 | } // namespace google 47 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/util/type_resolver.h: -------------------------------------------------------------------------------- 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 | // Defines a TypeResolver for the Any message. 32 | 33 | #ifndef GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__ 34 | #define GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__ 35 | 36 | #include 37 | 38 | #include 39 | #include 40 | 41 | 42 | namespace google { 43 | namespace protobuf { 44 | class Type; 45 | class Enum; 46 | } // namespace protobuf 47 | 48 | 49 | namespace protobuf { 50 | class DescriptorPool; 51 | namespace util { 52 | 53 | // Abstract interface for a type resovler. 54 | // 55 | // Implementations of this interface must be thread-safe. 56 | class LIBPROTOBUF_EXPORT TypeResolver { 57 | public: 58 | TypeResolver() {} 59 | virtual ~TypeResolver() {} 60 | 61 | // Resolves a type url for a message type. 62 | virtual util::Status ResolveMessageType( 63 | const string& type_url, google::protobuf::Type* message_type) = 0; 64 | 65 | // Resolves a type url for an enum type. 66 | virtual util::Status ResolveEnumType(const string& type_url, 67 | google::protobuf::Enum* enum_type) = 0; 68 | 69 | private: 70 | GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(TypeResolver); 71 | }; 72 | 73 | } // namespace util 74 | } // namespace protobuf 75 | 76 | } // namespace google 77 | #endif // GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_H__ 78 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/google/protobuf/util/type_resolver_util.h: -------------------------------------------------------------------------------- 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 | // Defines utilities for the TypeResolver. 32 | 33 | #ifndef GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_UTIL_H__ 34 | #define GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_UTIL_H__ 35 | 36 | #include 37 | 38 | #include 39 | namespace google { 40 | namespace protobuf { 41 | class DescriptorPool; 42 | namespace util { 43 | class TypeResolver; 44 | 45 | // Creates a TypeResolver that serves type information in the given descriptor 46 | // pool. Caller takes ownership of the returned TypeResolver. 47 | LIBPROTOBUF_EXPORT TypeResolver* NewTypeResolverForDescriptorPool( 48 | const string& url_prefix, const DescriptorPool* pool); 49 | 50 | } // namespace util 51 | } // namespace protobuf 52 | 53 | } // namespace google 54 | #endif // GOOGLE_PROTOBUF_UTIL_TYPE_RESOLVER_UTIL_H__ 55 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/libprotobuf-lite.map: -------------------------------------------------------------------------------- 1 | { 2 | global: 3 | extern "C++" { 4 | *google*; 5 | }; 6 | 7 | local: 8 | *; 9 | }; 10 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/libprotobuf.map: -------------------------------------------------------------------------------- 1 | { 2 | global: 3 | extern "C++" { 4 | *google*; 5 | }; 6 | 7 | local: 8 | *; 9 | }; 10 | -------------------------------------------------------------------------------- /libprotobuf-lite/src/libprotoc.map: -------------------------------------------------------------------------------- 1 | { 2 | global: 3 | extern "C++" { 4 | *google*; 5 | }; 6 | 7 | local: 8 | *; 9 | }; 10 | --------------------------------------------------------------------------------