bool Units::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 ret = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &ret_)); _set_bit(0); if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ }
bool LanSearchRoomRequest::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required int32 jsonID = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &jsonid_))); set_has_jsonid(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); break; } } } return true; #undef DO_ }
bool LanguageData::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated .message.LanguageData.Language language = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_language: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_language())); } else { goto handle_uninterpreted; } if (input->ExpectTag(10)) goto parse_language; if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); break; } } } return true; #undef DO_ }
bool RseObtainNeighborsList::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated .MsgNeighbor neighborList = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_neighborList: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_neighborlist())); if (input->ExpectTag(10)) goto parse_neighborList; if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ }
bool RemoveFriendRequest::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required string friendUUID = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_frienduuid())); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); break; } } } return true; #undef DO_ }
/* Parses time in hh:mm:ss[Y] format representing time today or yesterday. */ static bool parse_today(const char **string, struct timespec *ts) { return parse_time(string, ts) && DO_(ts->tv_sec += midnight_today()) && IF_(read_char(string, 'Y'), DO_(ts->tv_sec -= 24 * 3600)); }
bool DriverStation::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required bool enabled = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &enabled_))); set_has_enabled(); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_state; break; } // required .gazebo.msgs.DriverStation.State state = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_state: int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( input, &value))); if (::gazebo::msgs::DriverStation_State_IsValid(value)) { set_state(static_cast< ::gazebo::msgs::DriverStation_State >(value)); } else { mutable_unknown_fields()->AddVarint(2, value); } } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ }
/* Parses one or two timestamps of the same format possibly separated by ~. */ static bool parse_interval( const char **string, bool (*parser)(const char **string, struct timespec *ts)) { return parser(string, &start) && DO_(start_specified = true) && IF_(read_char(string, '~'), parser(string, &end) && DO_(end_specified = true)); }
bool MFNHashFilePlainProtobuf::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional uint32 hash_length_bytes = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &hash_length_bytes_))); set_has_hash_length_bytes(); } else { goto handle_uninterpreted; } if (input->ExpectTag(18)) goto parse_hash_value; break; } // repeated string hash_value = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_hash_value: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->add_hash_value())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->hash_value(0).data(), this->hash_value(0).length(), ::google::protobuf::internal::WireFormat::PARSE); } else { goto handle_uninterpreted; } if (input->ExpectTag(18)) goto parse_hash_value; if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ }
bool SetRobotMaintenance::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required uint32 robot_number = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &robot_number_))); set_has_robot_number(); } else { goto handle_uninterpreted; } if (input->ExpectTag(24)) goto parse_maintenance; break; } // required bool maintenance = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_maintenance: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< bool, ::google::protobuf::internal::WireFormatLite::TYPE_BOOL>( input, &maintenance_))); set_has_maintenance(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ }
bool BattleResultRequest::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required string did = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_did())); } else { goto handle_uninterpreted; } if (input->ExpectTag(16)) goto parse_status; break; } // required .message.BattleResultRequest.GameStatus status = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { parse_status: int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( input, &value))); if (::message::BattleResultRequest_GameStatus_IsValid(value)) { set_status(static_cast< ::message::BattleResultRequest_GameStatus >(value)); } } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); break; } } } return true; #undef DO_ }
bool RceObtainHangarsHelp::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string targetAccountId = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_targetaccountid())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->targetaccountid().data(), this->targetaccountid().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(18)) goto parse_planetId; break; } // optional string planetId = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_planetId: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_planetid())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->planetid().data(), this->planetid().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ }
bool MsgHangarUnit::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string sku = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_sku())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->sku().data(), this->sku().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(16)) goto parse_num; break; } // optional int32 num = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_num: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &num_)); _set_bit(1); if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ }
bool LanSearchRoomResponse::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required int32 jsonID = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &jsonid_))); set_has_jsonid(); } else { goto handle_uninterpreted; } if (input->ExpectTag(18)) goto parse_roomList; break; } // repeated .message.LanSearchRoomResponse.room roomList = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_roomList: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_roomlist())); } else { goto handle_uninterpreted; } if (input->ExpectTag(18)) goto parse_roomList; if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); break; } } } return true; #undef DO_ }
bool RseObtainSocialItems::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional string wishlist = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_wishlist())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->wishlist().data(), this->wishlist().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(18)) goto parse_ItemsList; break; } // repeated .MsgItem ItemsList = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_ItemsList: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_itemslist())); if (input->ExpectTag(18)) goto parse_ItemsList; if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ }
bool AddressBook::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; ::google::protobuf::io::StringOutputStream unknown_fields_string( mutable_unknown_fields()); ::google::protobuf::io::CodedOutputStream unknown_fields_stream( &unknown_fields_string); // @@protoc_insertion_point(parse_start:tutorial.AddressBook) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // repeated .tutorial.Person person = 1; case 1: { if (tag == 10) { parse_person: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_person())); } else { goto handle_unusual; } if (input->ExpectTag(10)) goto parse_person; if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormatLite::SkipField( input, tag, &unknown_fields_stream)); break; } } } success: // @@protoc_insertion_point(parse_success:tutorial.AddressBook) return true; failure: // @@protoc_insertion_point(parse_failure:tutorial.AddressBook) return false; #undef DO_ }
bool MsgHangars::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 sid = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &sid_)); _set_bit(0); if (input->ExpectTag(18)) goto parse_Hangar; break; } // repeated .MsgHangarUnit Hangar = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_Hangar: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_hangar())); if (input->ExpectTag(18)) goto parse_Hangar; if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ }
/* Connnects to the server. */ static bool connect_server(FILE **stream) { struct sockaddr_in s_in = { .sin_family = AF_INET, .sin_addr.s_addr = INADDR_ANY, .sin_port = htons(port) }; struct hostent *hostent; int sock; return TEST_NULL_( hostent = gethostbyname(server_name), "Unable to resolve server \"%s\"", server_name) && DO_(memcpy( &s_in.sin_addr.s_addr, hostent->h_addr, (size_t) hostent->h_length)) && TEST_IO(sock = socket(AF_INET, SOCK_STREAM, 0)) && UNLESS( TEST_IO_( connect(sock, (struct sockaddr *) &s_in, sizeof(s_in)), "Unable to connect to server %s:%d", server_name, port) && TEST_NULL(*stream = fdopen(sock, "r+")), // Close sock if connect or fdopen failed TEST_IO(close(sock))); }
bool Shutdown::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:Shutdown) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } success: // @@protoc_insertion_point(parse_success:Shutdown) return true; failure: // @@protoc_insertion_point(parse_failure:Shutdown) return false; #undef DO_ }
static bool load_fa_ids_file(const char *filename) { FILE *input; bool ok = TEST_NULL_(input = fopen(filename, "r"), "Unable to open IDs file \"%s\"", filename); if (ok) { bool seen[id_list_length]; memset(seen, 0, id_list_length * sizeof(bool)); char line[1024]; while (ok && fgets(line, sizeof(line), input)) { /* Check the line hasn't been truncated. This also complains if the * file ends without a newline, but that's too bad. */ char *eol; ok = TEST_NULL_(eol = strchr(line, '\n'), "Line truncated or missing newline at end of file") && DO_(*eol = '\0') && /* Fixed format: blank lines or lines beginning with # are * ignored, all other lines must be a number followed by * optional whitespace followed by an optional description. */ IF_(line[0] != '\0' && line[0] != '#', DO_PARSE("FA ID file", parse_fa_id_line, line, seen)); } fclose(input); } return ok; }
bool LanBattleDataNotice::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required string uuid = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_uuid())); } else { goto handle_uninterpreted; } if (input->ExpectTag(18)) goto parse_battleInfo; break; } // required .message.BattleInfo battleInfo = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_battleInfo: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, mutable_battleinfo())); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); break; } } } return true; #undef DO_ }
bool LanguageData_Statement::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required string country = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_country())); } else { goto handle_uninterpreted; } if (input->ExpectTag(18)) goto parse_talk; break; } // optional string talk = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { parse_talk: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_talk())); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); break; } } } return true; #undef DO_ }
bool Shutdown_Res::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:Shutdown.Res) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required int32 code = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &code_))); set_has_code(); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:Shutdown.Res) return true; failure: // @@protoc_insertion_point(parse_failure:Shutdown.Res) return false; #undef DO_ }
static bool do_parse_line( const char *file_name, int line_number, const char *line_buffer, const struct config_entry *config_table, size_t config_size, bool *seen) { const char *string = line_buffer; skip_whitespace(&string); if (*string == '\0' || *string == '#') /* Empty line or comment, can just ignore. */ return true; /* We'll report all errors on this line against file name and line. */ push_error_handling(); /* A valid definition is * * name<opt-whitespace>=<opt-whitespace><parse><opt-whitespace> * * The optional whitespace which our parser doesn't support makes the parse * a lot more long winded than it otherwise ought to be. */ char name[NAME_LENGTH]; size_t ix = 0; bool ok = parse_name(&string, name, NAME_LENGTH) && DO_(skip_whitespace(&string)) && parse_char(&string, '=') && DO_(skip_whitespace(&string)) && lookup_name(name, config_table, config_size, &ix) && config_table[ix].parser(&string, config_table[ix].result) && DO_(skip_whitespace(&string)) && parse_eos(&string); /* Report parse error. */ char *error = pop_error_handling(!ok); if (!ok) print_error("Error parsing %s, line %d, offset %zd: %s", file_name, line_number, string - line_buffer, error); free(error); return ok && /* Perform post parse validation. */ TEST_OK_(!seen[ix], "Parameter %s repeated on line %d", name, line_number) && DO_(seen[ix] = true); }
bool HeartbeatResponse::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required .message.HeartbeatResponse.ResponseStatus status = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { int value; DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>( input, &value))); if (::message::HeartbeatResponse_ResponseStatus_IsValid(value)) { set_status(static_cast< ::message::HeartbeatResponse_ResponseStatus >(value)); } } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); break; } } } return true; #undef DO_ }
bool HeartbeatRequest::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormatLite::SkipField(input, tag)); } return true; #undef DO_ }
bool RceObtainCustomizer::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); } return true; #undef DO_ }
bool CSJoinRoomResponse::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 result = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::int32, ::google::protobuf::internal::WireFormatLite::TYPE_INT32>( input, &result_))); set_has_result(); } else { goto handle_uninterpreted; } if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ }
bool ImageMessage::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) goto failure ::google::protobuf::uint32 tag; // @@protoc_insertion_point(parse_start:ImageMessage) for (;;) { ::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoff(127); tag = p.first; if (!p.second) goto handle_unusual; switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // required uint32 width = 1; case 1: { if (tag == 8) { DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &width_))); set_has_width(); } else { goto handle_unusual; } if (input->ExpectTag(16)) goto parse_height; break; } // required uint32 height = 2; case 2: { if (tag == 16) { parse_height: DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive< ::google::protobuf::uint32, ::google::protobuf::internal::WireFormatLite::TYPE_UINT32>( input, &height_))); set_has_height(); } else { goto handle_unusual; } if (input->ExpectTag(26)) goto parse_data; break; } // required bytes data = 3; case 3: { if (tag == 26) { parse_data: DO_(::google::protobuf::internal::WireFormatLite::ReadBytes( input, this->mutable_data())); } else { goto handle_unusual; } if (input->ExpectAtEnd()) goto success; break; } default: { handle_unusual: if (tag == 0 || ::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { goto success; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } success: // @@protoc_insertion_point(parse_success:ImageMessage) return true; failure: // @@protoc_insertion_point(parse_failure:ImageMessage) return false; #undef DO_ }
bool MsgItem::MergePartialFromCodedStream( ::google::protobuf::io::CodedInputStream* input) { #define DO_(EXPRESSION) if (!(EXPRESSION)) return false ::google::protobuf::uint32 tag; while ((tag = input->ReadTag()) != 0) { switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) { // optional int32 sku = 1; case 1: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &sku_)); _set_bit(0); if (input->ExpectTag(16)) goto parse_position; break; } // optional int32 position = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_position: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &position_)); _set_bit(1); if (input->ExpectTag(24)) goto parse_Item; break; } // repeated int32 Item = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_Item: ::google::protobuf::int32 value; DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &value)); add_item(value); if (input->ExpectTag(24)) goto parse_Item; if (input->ExpectTag(32)) goto parse_sequence; break; } // optional int32 sequence = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_sequence: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &sequence_)); _set_bit(3); if (input->ExpectTag(40)) goto parse_counter; break; } // optional int32 counter = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_counter: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &counter_)); _set_bit(4); if (input->ExpectTag(48)) goto parse_quantity; break; } // optional int32 quantity = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_quantity: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &quantity_)); _set_bit(5); if (input->ExpectTag(56)) goto parse_timeLeft; break; } // optional int32 timeLeft = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_timeLeft: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &timeleft_)); _set_bit(6); if (input->ExpectAtEnd()) return true; break; } default: { handle_uninterpreted: if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) == ::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) { return true; } DO_(::google::protobuf::internal::WireFormat::SkipField( input, tag, mutable_unknown_fields())); break; } } } return true; #undef DO_ }