bool RceQueryPvE::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 type = 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, &type_)); _set_bit(0); if (input->ExpectTag(16)) goto parse_pass; break; } // optional int32 pass = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_pass: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &pass_)); _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_ }
static void _send_1(volatile unsigned char* port_addr, unsigned char bit) { _clear_bit(*port_addr,bit); _delay_us(1); _set_bit(*port_addr, bit); _delay_us(8); }
static void _latch(volatile unsigned char* port_addr, unsigned char bit) { _clear_bit(*port_addr,bit); _delay_hus(1); /* 200us delay */ _set_bit(*port_addr, bit); _delay_hus(2); /* 300us delay*/ }
void shiftout(unsigned char data) { char i=0; for(i=0; i<8; i++) { delay_io(); if((data<<i)&0x80) _set_bit(PORT_74HC595, SDI); else _clear_bit(PORT_74HC595, SDI); delay_io(); _set_bit(PORT_74HC595,CLK); delay_io(); _clear_bit(PORT_74HC595, CLK); } }
unsigned short read_011() { unsigned short add=0; unsigned char i=0; _clear_bit(REF165_PORT,SH_REF165); //recept parallen load data, lockit _delay_us(7); _set_bit(REF165_PORT,SH_REF165); //lock it _delay_ms(1); _clear_bit(REF165_PORT,CLK_REF165); for (i=0;i<8;i++) { if(_test_bit(_inb(REF165_PORT),QH_REF165)) _set_bit(add,7-i); //上电后QH的值即是165的第8位值,可以直接赋值完后,给165上升沿读取下个数据 _clear_bit(REF165_PORT,CLK_REF165); _delay_us(7); _set_bit(REF165_PORT,CLK_REF165); _delay_us(7); } for (i=0;i<8;i++) { if(_test_bit(_inb(REF165_PORT),QH_REF165)) _set_bit(add,15-i); //上电后QH的值即是165的第8位值,可以直接赋值完后,给165上升沿读取下个数据 _clear_bit(REF165_PORT,CLK_REF165); _delay_us(7); _set_bit(REF165_PORT,CLK_REF165); _delay_us(7); } return add; }
bool RceObtainRandomTargets::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 starId = 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, &starid_)); _set_bit(0); 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_ }
void write_74hc595(unsigned char data) { //_clear_bit(PORT_74HC595,CLK); //prepare send data delay_io(); shiftout(data); delay_io(); _set_bit(PORT_74HC595,LATCH); //prepare open latch delay_io(); delay_io(); delay_io(); _clear_bit(PORT_74HC595,LATCH); //prepare open latch }
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_ }
static unsigned char bus_read(void) { unsigned char i,val=0; SET_SDA; //set sda to input mode bus_nop; for(i=0; i<8; i++){ if (DS1302_SDA) //receive _set_bit(val,i); else _clear_bit(val,i); SET_CLK; bus_nop; CLR_CLK; bus_nop; } return val; }
/* returns a hex string for all config flag bits, which must be freed. */ char * _mongoc_handshake_get_config_hex_string (void) { uint32_t byte_count; uint8_t *bf; bson_string_t *str; int i; byte_count = (LAST_MONGOC_MD_FLAG + 7) / 8; /* ceil (num_bits / 8) */ /* allocate enough bytes to fit all config bits. */ bf = (uint8_t *) bson_malloc0 (byte_count); #ifdef MONGOC_ENABLE_SSL_SECURE_CHANNEL _set_bit (bf, byte_count, MONGOC_ENABLE_SSL_SECURE_CHANNEL); #endif #ifdef MONGOC_ENABLE_CRYPTO_CNG _set_bit (bf, byte_count, MONGOC_ENABLE_CRYPTO_CNG); #endif #ifdef MONGOC_ENABLE_SSL_SECURE_TRANSPORT _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_SSL_SECURE_TRANSPORT); #endif #ifdef MONGOC_ENABLE_CRYPTO_COMMON_CRYPTO _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_CRYPTO_COMMON_CRYPTO); #endif #ifdef MONGOC_ENABLE_SSL_OPENSSL _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_SSL_OPENSSL); #endif #ifdef MONGOC_ENABLE_CRYPTO_LIBCRYPTO _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_CRYPTO_LIBCRYPTO); #endif #ifdef MONGOC_ENABLE_SSL _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_SSL); #endif #ifdef MONGOC_ENABLE_CRYPTO _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_CRYPTO); #endif #ifdef MONGOC_ENABLE_CRYPTO_SYSTEM_PROFILE _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_CRYPTO_SYSTEM_PROFILE); #endif #ifdef MONGOC_ENABLE_SASL _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_SASL); #endif #ifdef MONGOC_HAVE_SASL_CLIENT_DONE _set_bit (bf, byte_count, MONGOC_MD_FLAG_HAVE_SASL_CLIENT_DONE); #endif #ifdef MONGOC_NO_AUTOMATIC_GLOBALS _set_bit (bf, byte_count, MONGOC_MD_FLAG_NO_AUTOMATIC_GLOBALS); #endif #ifdef MONGOC_EXPERIMENTAL_FEATURES _set_bit (bf, byte_count, MONGOC_MD_FLAG_EXPERIMENTAL_FEATURES); #endif #ifdef MONGOC_ENABLE_SSL_LIBRESSL _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_SSL_LIBRESSL); #endif #ifdef MONGOC_ENABLE_SASL_CYRUS _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_SASL_CYRUS); #endif #ifdef MONGOC_ENABLE_SASL_SSPI _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_SASL_SSPI); #endif #ifdef MONGOC_HAVE_SOCKLEN _set_bit (bf, byte_count, MONGOC_MD_FLAG_HAVE_SOCKLEN); #endif #ifdef MONGOC_ENABLE_COMPRESSION _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_COMPRESSION); #endif #ifdef MONGOC_ENABLE_COMPRESSION_SNAPPY _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_COMPRESSION_SNAPPY); #endif #ifdef MONGOC_ENABLE_COMPRESSION_ZLIB _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_COMPRESSION_ZLIB); #endif #ifdef MONGOC_MD_FLAG_ENABLE_SASL_GSSAPI _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_SASL_GSSAPI); #endif #ifdef MONGOC_HAVE_RES_NSEARCH _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_RES_NSEARCH); #endif #ifdef MONGOC_HAVE_RES_NDESTROY _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_RES_NDESTROY); #endif #ifdef MONGOC_HAVE_RES_NCLOSE _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_RES_NCLOSE); #endif #ifdef MONGOC_HAVE_RES_SEARCH _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_RES_SEARCH); #endif #ifdef MONGOC_HAVE_DNSAPI _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_DNSAPI); #endif #ifdef MONGOC_HAVE_RDTSCP _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_RDTSCP); #endif #ifdef MONGOC_HAVE_SCHED_GETCPU _set_bit (bf, byte_count, MONGOC_MD_FLAG_HAVE_SCHED_GETCPU); #endif #ifdef MONGOC_ENABLE_SHM_COUNTERS _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_SHM_COUNTERS); #endif #ifdef MONGOC_TRACE _set_bit (bf, byte_count, MONGOC_MD_FLAG_TRACE); #endif #ifdef MONGOC_ENABLE_ICU _set_bit (bf, byte_count, MONGOC_MD_FLAG_ENABLE_ICU); #endif str = bson_string_new ("0x"); for (i = 0; i < byte_count; i++) { bson_string_append_printf (str, "%02x", bf[i]); } bson_free (bf); /* free the bson_string_t, but keep the underlying char* alive. */ return bson_string_free (str, false); }
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_ }
static ssize_t video_proc_write(struct file *file, const char __user *buf, size_t count, loff_t *pos) { struct toshiba_acpi_dev *dev = PDE(file->f_path.dentry->d_inode)->data; char *cmd, *buffer; int ret; int value; int remain = count; int lcd_out = -1; int crt_out = -1; int tv_out = -1; u32 video_out; cmd = kmalloc(count + 1, GFP_KERNEL); if (!cmd) return -ENOMEM; if (copy_from_user(cmd, buf, count)) { kfree(cmd); return -EFAULT; } cmd[count] = '\0'; buffer = cmd; /* */ while (remain) { if (sscanf(buffer, " lcd_out : %i", &value) == 1) lcd_out = value & 1; else if (sscanf(buffer, " crt_out : %i", &value) == 1) crt_out = value & 1; else if (sscanf(buffer, " tv_out : %i", &value) == 1) tv_out = value & 1; /* */ do { ++buffer; --remain; } while (remain && *(buffer - 1) != ';'); } kfree(cmd); ret = get_video_status(dev, &video_out); if (!ret) { unsigned int new_video_out = video_out; if (lcd_out != -1) _set_bit(&new_video_out, HCI_VIDEO_OUT_LCD, lcd_out); if (crt_out != -1) _set_bit(&new_video_out, HCI_VIDEO_OUT_CRT, crt_out); if (tv_out != -1) _set_bit(&new_video_out, HCI_VIDEO_OUT_TV, tv_out); /* */ if (new_video_out != video_out) ret = write_acpi_int(METHOD_VIDEO_OUT, new_video_out); } return ret ? ret : count; }
bool RseObtainSocialUserInfo::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 name = 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_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(18)) goto parse_photoURL; break; } // optional string photoURL = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_photoURL: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_photourl())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->photourl().data(), this->photourl().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(24)) goto parse_fan; break; } // optional int32 fan = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_fan: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &fan_)); _set_bit(2); if (input->ExpectTag(34)) goto parse_SocialUserInfo; break; } // repeated .MsgSocialUserInfo SocialUserInfo = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_SocialUserInfo: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_socialuserinfo())); if (input->ExpectTag(34)) goto parse_SocialUserInfo; 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 RceObtainPayUrlParame::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 openid = 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_openid())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->openid().data(), this->openid().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(16)) goto parse_appmode; break; } // optional int32 appmode = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_appmode: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &appmode_)); _set_bit(1); if (input->ExpectTag(26)) goto parse_platId; break; } // optional string platId = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_platId: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_platid())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->platid().data(), this->platid().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(34)) goto parse_planetId; break; } // optional string planetId = 4; case 4: { 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->ExpectTag(42)) goto parse_goodsmeta; break; } // optional string goodsmeta = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_goodsmeta: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_goodsmeta())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->goodsmeta().data(), this->goodsmeta().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(50)) goto parse_gdurl; break; } // optional string gdurl = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_gdurl: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_gdurl())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->gdurl().data(), this->gdurl().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(58)) goto parse_payitem; break; } // optional string payitem = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_payitem: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_payitem())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->payitem().data(), this->payitem().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_ }
int kw1281_open(unsigned char address, controller_t* block) { block->address = address; // wait the idle time usleep(300000); int flags; // prepare to send (clear dtr and rts) if (ioctl(fd, TIOCMGET, &flags) < 0) { printf("TIOCMGET failed.\n"); return -1; } flags &= ~(TIOCM_DTR | TIOCM_RTS); if (ioctl(fd, TIOCMSET, &flags) < 0) { printf("TIOCMSET failed.\n"); return -1; } usleep(INIT_DELAY); _set_bit(0); // start bit usleep(INIT_DELAY); // 5 baud int p = 1; int i; for (i = 0; i < 7; i++) { // address bits, lsb first int bit = (address >> i) & 0x1; _set_bit(bit); p = p ^ bit; usleep(INIT_DELAY); } _set_bit(p); // odd parity usleep(INIT_DELAY); _set_bit(1); // stop bit usleep(INIT_DELAY); // set dtr if (ioctl(fd, TIOCMGET, &flags) < 0) { printf("TIOCMGET failed.\n"); return -1; } flags |= TIOCM_DTR; if (ioctl(fd, TIOCMSET, &flags) < 0) { printf("TIOCMSET failed.\n"); return -1; } // read bogus values, if any int c, in; if (ioctl(fd, FIONREAD, &in) < 0) { printf("FIONREAD failed.\n"); return -1; } printf("found %d chars to ignore\n", in); while (in--) { if ((c = kw1281_read_timeout()) == -1) { printf("kw1281_init: read() error\n"); return -1; } printf("ignore 0x%02x\n", c); } if ((c = kw1281_read_timeout()) == -1) { printf("read() error\n"); return -1; } printf("read 0x%02x\n", c); if ((c = kw1281_read_timeout()) == -1) { printf("read() error\n"); return -1; } printf("read 0x%02x\n", c); if ((c = kw1281_recv_byte_ack()) == -1) return -1; printf("read 0x%02x (and sent ack)\n", c); block->counter = 1; return 0; }
bool RseLogin::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 currentTimeMillis = 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, ¤ttimemillis_)); _set_bit(0); if (input->ExpectTag(16)) goto parse_id; break; } // optional int32 id = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_id: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &id_)); _set_bit(1); if (input->ExpectTag(24)) goto parse_levelBasedOnScore; break; } // optional int32 levelBasedOnScore = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_levelBasedOnScore: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &levelbasedonscore_)); _set_bit(2); if (input->ExpectTag(32)) goto parse_myAccountIsLocked; break; } // optional int32 myAccountIsLocked = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_myAccountIsLocked: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &myaccountislocked_)); _set_bit(3); if (input->ExpectTag(40)) goto parse_pop; break; } // optional bool pop = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_pop: DO_(::google::protobuf::internal::WireFormatLite::ReadBool( input, &pop_)); _set_bit(4); if (input->ExpectTag(48)) goto parse_rqId; break; } // optional int32 rqId = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_rqId: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &rqid_)); _set_bit(5); if (input->ExpectTag(56)) goto parse_sync; break; } // optional int32 sync = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_sync: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &sync_)); _set_bit(6); if (input->ExpectTag(64)) goto parse_timeFromLastLogin; break; } // optional int32 timeFromLastLogin = 8; case 8: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_timeFromLastLogin: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &timefromlastlogin_)); _set_bit(7); if (input->ExpectTag(72)) goto parse_timeFromLastUpdate; break; } // optional int32 timeFromLastUpdate = 9; case 9: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_timeFromLastUpdate: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &timefromlastupdate_)); _set_bit(8); if (input->ExpectTag(80)) goto parse_token; break; } // optional int32 token = 10; case 10: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_token: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &token_)); _set_bit(9); if (input->ExpectTag(90)) goto parse_userId; break; } // optional string userId = 11; case 11: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_userId: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_userid())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->userid().data(), this->userid().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(98)) goto parse_version; break; } // optional string version = 12; case 12: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_version: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_version())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->version().data(), this->version().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(104)) goto parse_vip; break; } // optional int32 vip = 13; case 13: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_vip: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &vip_)); _set_bit(12); 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 RceUpdateProfile::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 .MsgTransaction transaction = 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::ReadMessageNoVirtual( input, mutable_transaction())); if (input->ExpectTag(18)) goto parse_sku; break; } // optional string sku = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_sku: 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(24)) goto parse_value; break; } // optional int32 value = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_value: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &value_)); _set_bit(2); if (input->ExpectTag(34)) goto parse_key; break; } // optional string key = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_key: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_key())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->key().data(), this->key().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(40)) goto parse_planetId; break; } // optional int32 planetId = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_planetId: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &planetid_)); _set_bit(4); if (input->ExpectTag(50)) goto parse_action; break; } // optional string action = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_action: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_action())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->action().data(), this->action().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(56)) goto parse_level; break; } // optional int32 level = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_level: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &level_)); _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_ }
static void *ctl_read(void *arg) { ssize_t n; uint8_t buf[8]; int16_t steering = 0; int16_t engine = 0; uint16_t buttons = 0; int newdata = 1; printf("\n steering engine\n"); while (1) { // output current controller values if (newdata) { newdata = 0; /* scale values to actual control values */ pthread_mutex_lock(&msg_lock); r2c2_msg.speed = (engine / 32); r2c2_msg.steer = (steering / 32); r2c2_msg.buttons = buttons; pthread_mutex_unlock(&msg_lock); printf("raw: %7i %7i\n", steering, engine); puts(""); printf(" speed steering buttons\n"); printf("ctrl %7i %7i %7i\n", r2c2_msg.speed, r2c2_msg.steer, r2c2_msg.buttons); printf("\033[F\033[F\033[F\033[F"); } // read new input from controller n = read(js, buf, 8); if (n == 8) { if (buf[6] == CONF_CTL_BUTTON) { if (buf[4]) { //printf ("INFO ctl_read: pressed button (%#x)\n", buf[7]); if ((buf[7] == CONF_CTL_BUTTON_L2) | (buf[7] == CONF_CTL_BUTTON_R2)) { _set_bit(&buttons, buf[7]); } else { _tgl_bit(&buttons, buf[7]); } } else { //printf ("INFO ctl_read: released button (%#x)\n", buf[7]); if ((buf[7] == CONF_CTL_BUTTON_L2) | (buf[7] == CONF_CTL_BUTTON_R2)) { _clr_bit(&buttons, buf[7]); } } newdata = 1; } else if (buf[6] == CONF_CTL_AXIS) { if (buf[7] == CONF_CTL_AXIS_STEERING) { steering = ((int16_t)buf[5] << 8) | buf[4]; newdata = 1; } else if (buf[7] == CONF_CTL_AXIS_ENGINE) { engine = ((int16_t)buf[5] << 8) | buf[4]; newdata = 1; } } else { puts("WARN ctl_read: unknown control type!\n"); } } } return NULL; }
bool MsgNeighbor::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 platform = 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_platform())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->platform().data(), this->platform().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(16)) goto parse_accountId; break; } // optional int64 accountId = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_accountId: DO_(::google::protobuf::internal::WireFormatLite::ReadInt64( input, &accountid_)); _set_bit(1); if (input->ExpectTag(24)) goto parse_score; break; } // optional int32 score = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_score: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &score_)); _set_bit(2); if (input->ExpectTag(32)) goto parse_xp; break; } // optional int32 xp = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_xp: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &xp_)); _set_bit(3); if (input->ExpectTag(42)) goto parse_extId; break; } // optional string extId = 5; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_extId: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_extid())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->extid().data(), this->extid().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(50)) goto parse_url; break; } // optional string url = 6; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_url: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_url())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->url().data(), this->url().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(58)) goto parse_name; break; } // optional string name = 7; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_name: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->name().data(), this->name().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(64)) goto parse_isNeighbor; break; } // optional int32 isNeighbor = 8; case 8: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_isNeighbor: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &isneighbor_)); _set_bit(7); if (input->ExpectTag(72)) goto parse_levelBasedOnScore; break; } // optional int32 levelBasedOnScore = 9; case 9: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_levelBasedOnScore: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &levelbasedonscore_)); _set_bit(8); if (input->ExpectTag(82)) goto parse_wishlist; break; } // optional string wishlist = 10; case 10: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_wishlist: 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(88)) goto parse_damageProtectionTimeLeft; break; } // optional int64 damageProtectionTimeLeft = 11; case 11: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_damageProtectionTimeLeft: DO_(::google::protobuf::internal::WireFormatLite::ReadInt64( input, &damageprotectiontimeleft_)); _set_bit(10); if (input->ExpectTag(96)) goto parse_tutorialCompleted; break; } // optional int32 tutorialCompleted = 12; case 12: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_tutorialCompleted: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &tutorialcompleted_)); _set_bit(11); if (input->ExpectTag(106)) goto parse_neighbor; break; } // repeated .MsgPlanet neighbor = 13; case 13: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_neighbor: DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual( input, add_neighbor())); if (input->ExpectTag(106)) goto parse_neighbor; 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 FriendInfoLite::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 baseid = 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_baseid())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->baseid().data(), this->baseid().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(18)) goto parse_first_name; break; } // required string first_name = 2; case 2: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_first_name: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_first_name())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->first_name().data(), this->first_name().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(26)) goto parse_pic; break; } // optional string pic = 3; case 3: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_pic: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_pic())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->pic().data(), this->pic().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(32)) goto parse_lvl; break; } // required uint32 lvl = 4; case 4: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_lvl: DO_(::google::protobuf::internal::WireFormatLite::ReadUInt32( input, &lvl_)); _set_bit(3); if (input->ExpectTag(40)) goto parse_is_yellow_vip; break; } // optional bool is_yellow_vip = 5 [default = false]; case 5: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_is_yellow_vip: DO_(::google::protobuf::internal::WireFormatLite::ReadBool( input, &is_yellow_vip_)); _set_bit(4); if (input->ExpectTag(48)) goto parse_is_yellow_year_vip; break; } // optional bool is_yellow_year_vip = 6 [default = false]; case 6: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_is_yellow_year_vip: DO_(::google::protobuf::internal::WireFormatLite::ReadBool( input, &is_yellow_year_vip_)); _set_bit(5); if (input->ExpectTag(56)) goto parse_yellow_vip_level; break; } // optional int32 yellow_vip_level = 7 [default = 0]; case 7: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_yellow_vip_level: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &yellow_vip_level_)); _set_bit(6); if (input->ExpectTag(66)) goto parse_totalpercharge; break; } // optional string totalpercharge = 8; case 8: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_totalpercharge: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_totalpercharge())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->totalpercharge().data(), this->totalpercharge().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(72)) goto parse_lastLogonTime; break; } // optional int32 lastLogonTime = 9 [default = 0]; case 9: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_lastLogonTime: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &lastlogontime_)); _set_bit(8); if (input->ExpectTag(80)) goto parse_QQDmdLvl; break; } // optional int32 QQDmdLvl = 10 [default = 0]; case 10: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_QQDmdLvl: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &qqdmdlvl_)); _set_bit(9); if (input->ExpectTag(88)) goto parse_isQQDmd; break; } // optional bool isQQDmd = 11 [default = false]; case 11: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_isQQDmd: DO_(::google::protobuf::internal::WireFormatLite::ReadBool( input, &isqqdmd_)); _set_bit(10); if (input->ExpectTag(96)) goto parse_isQQDmdYear; break; } // optional bool isQQDmdYear = 12 [default = false]; case 12: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_isQQDmdYear: DO_(::google::protobuf::internal::WireFormatLite::ReadBool( input, &isqqdmdyear_)); _set_bit(11); if (input->ExpectTag(104)) goto parse_sameRegion; break; } // optional bool sameRegion = 13; case 13: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_sameRegion: DO_(::google::protobuf::internal::WireFormatLite::ReadBool( input, &sameregion_)); _set_bit(12); if (input->ExpectTag(114)) goto parse_platid; break; } // optional string platid = 14; case 14: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_LENGTH_DELIMITED) { goto handle_uninterpreted; } parse_platid: DO_(::google::protobuf::internal::WireFormatLite::ReadString( input, this->mutable_platid())); ::google::protobuf::internal::WireFormat::VerifyUTF8String( this->platid().data(), this->platid().length(), ::google::protobuf::internal::WireFormat::PARSE); if (input->ExpectTag(120)) goto parse_finishCaptureTm; break; } // optional int32 finishCaptureTm = 15; case 15: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_finishCaptureTm: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &finishcapturetm_)); _set_bit(14); if (input->ExpectTag(128)) goto parse_is_sumptuous_yellow_vip; break; } // optional bool is_sumptuous_yellow_vip = 16 [default = false]; case 16: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_is_sumptuous_yellow_vip: DO_(::google::protobuf::internal::WireFormatLite::ReadBool( input, &is_sumptuous_yellow_vip_)); _set_bit(15); if (input->ExpectTag(136)) goto parse_viplevel; break; } // optional int32 viplevel = 17 [default = 0]; case 17: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_viplevel: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &viplevel_)); _set_bit(16); if (input->ExpectTag(144)) goto parse_viptype; break; } // optional int32 viptype = 18 [default = 0]; case 18: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_viptype: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &viptype_)); _set_bit(17); if (input->ExpectTag(152)) goto parse_QHallDmdLvl; break; } // optional int32 QHallDmdLvl = 19 [default = 0]; case 19: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_QHallDmdLvl: DO_(::google::protobuf::internal::WireFormatLite::ReadInt32( input, &qhalldmdlvl_)); _set_bit(18); if (input->ExpectTag(160)) goto parse_isQHallDmd; break; } // optional bool isQHallDmd = 20 [default = false]; case 20: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_isQHallDmd: DO_(::google::protobuf::internal::WireFormatLite::ReadBool( input, &isqhalldmd_)); _set_bit(19); if (input->ExpectTag(168)) goto parse_isQHallDmdYear; break; } // optional bool isQHallDmdYear = 21 [default = false]; case 21: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_isQHallDmdYear: DO_(::google::protobuf::internal::WireFormatLite::ReadBool( input, &isqhalldmdyear_)); _set_bit(20); if (input->ExpectTag(176)) goto parse_isHighQHallDmd; break; } // optional bool isHighQHallDmd = 22 [default = false]; case 22: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_isHighQHallDmd: DO_(::google::protobuf::internal::WireFormatLite::ReadBool( input, &ishighqhalldmd_)); _set_bit(21); if (input->ExpectTag(184)) goto parse_isHighQHallDmeYear; break; } // optional bool isHighQHallDmeYear = 23 [default = false]; case 23: { if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) != ::google::protobuf::internal::WireFormatLite::WIRETYPE_VARINT) { goto handle_uninterpreted; } parse_isHighQHallDmeYear: DO_(::google::protobuf::internal::WireFormatLite::ReadBool( input, &ishighqhalldmeyear_)); _set_bit(22); 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_ }
static ssize_t video_proc_write(struct file *file, const char __user *buf, size_t count, loff_t *pos) { struct toshiba_acpi_dev *dev = PDE(file->f_path.dentry->d_inode)->data; char *cmd, *buffer; int ret; int value; int remain = count; int lcd_out = -1; int crt_out = -1; int tv_out = -1; u32 video_out; cmd = kmalloc(count + 1, GFP_KERNEL); if (!cmd) return -ENOMEM; if (copy_from_user(cmd, buf, count)) { kfree(cmd); return -EFAULT; } cmd[count] = '\0'; buffer = cmd; /* scan expression. Multiple expressions may be delimited with ; * * NOTE: to keep scanning simple, invalid fields are ignored */ while (remain) { if (sscanf(buffer, " lcd_out : %i", &value) == 1) lcd_out = value & 1; else if (sscanf(buffer, " crt_out : %i", &value) == 1) crt_out = value & 1; else if (sscanf(buffer, " tv_out : %i", &value) == 1) tv_out = value & 1; /* advance to one character past the next ; */ do { ++buffer; --remain; } while (remain && *(buffer - 1) != ';'); } kfree(cmd); ret = get_video_status(dev, &video_out); if (!ret) { unsigned int new_video_out = video_out; if (lcd_out != -1) _set_bit(&new_video_out, HCI_VIDEO_OUT_LCD, lcd_out); if (crt_out != -1) _set_bit(&new_video_out, HCI_VIDEO_OUT_CRT, crt_out); if (tv_out != -1) _set_bit(&new_video_out, HCI_VIDEO_OUT_TV, tv_out); /* To avoid unnecessary video disruption, only write the new * video setting if something changed. */ if (new_video_out != video_out) ret = write_acpi_int(METHOD_VIDEO_OUT, new_video_out); } return ret ? ret : count; }