本文整理汇总了C++中ReadLong函数的典型用法代码示例。如果您正苦于以下问题:C++ ReadLong函数的具体用法?C++ ReadLong怎么用?C++ ReadLong使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ReadLong函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MReadKbd
void MReadKbd()
{
int ccode,mod;
int kbrd_called=0;
while(qCharLen())
{
asciiChar=charAscii[charHead];
ccode=charBuff[charHead][1];
mod=charBuff[charHead++][0];
if (charHead>=CHAR_BUFF_LEN) charHead=0;
/*printf("char %c %d\t ccode %d\n",asciiChar,asciiChar,ccode);*/
reg[1]=ccode;
reg[2]=mod;
aReg[2]=ReadLong(0x2804c);
/* printf("calling subr %d\n",((w16)(uw16)ReadWord(0x150))+0x4000);*/
QLsubr(ReadWord(0x150)+0x4000,2000000);
/*printf("result: %d\n",reg[0]);*/
kbrd_called=1;
}
if (gKeyDown /*&& !MButtonDown /*|| kbrd_called */)
{
kbrd_called=0;
aReg[2]=ReadLong(0x2804c);
reg[5]=-1;/*(gKeyDown!=0)<<4;*/
QLsubr(ReadWord(0x152)+0x4000,2000000);
}
}
示例2: ReadLong
void scContUnit::Read( scSet* enumTable,
APPCtxPtr ctxPtr,
IOFuncPtr readFunc )
{
scTBObj::Read( enumTable, ctxPtr, readFunc );
ReadLong( fParaCount, ctxPtr, readFunc, kIntelOrder );
fCharArray.Read( ctxPtr, readFunc );
fSpecRun.Read( ctxPtr, readFunc );
long diskid;
ReadLong( diskid, ctxPtr, readFunc, kIntelOrder );
TypeSpec spec( (stSpec*)APPDiskIDToPointer( ctxPtr, diskid, diskidTypespec ) );
defspec_ = spec;
#ifdef _RUBI_SUPPORT
long rubipresent;
ReadLong( rubipresent, ctxPtr, readFunc, kIntelOrder );
if ( rubipresent ) {
AllocRubiArray();
fRubiArray->Read( ctxPtr, readFunc, rubipresent );
}
#endif
Mark( scRETABULATE );
Mark( scREBREAK );
}
示例3: WTRACE
// MMsgObsSubscribeById::Unpack
// Virtual method from MiniMessage. Extracts data from message buffer.
void
MMsgObsSubscribeById::Unpack(void)
{
WTRACE("MMsgObsSubscribeById::Unpack");
MiniMessage::Unpack();
if ((GetServiceType() != WONMsg::MiniObsServer) ||
(GetMessageType() != WONMsg::ObsMsg_SubscribeById))
{
WDBG_AH("MMsgObsSubscribeById::Unpack Not a ObsSubscribeById message!");
throw WONMsg::BadMsgException(*this, __LINE__, __FILE__,
"Not a ObsSubscribeById message.");
}
WDBG_LL("MMsgObsSubscribeById::Unpack Reading message data");
mPublicationId = ReadLong();
mSubscriberId = ReadLong();
if (!mSubscriberId) // Optional parameters follow
{
ReadString(mSubscriberName);
ReadWString(mSubscriberDescription);
mConnectionType = (ConnectionTypeEnum)ReadShort();
ReadString(mSubscriberAddress);
}
}
示例4: MDReadAudibleCommonHeader
static AudErrorCode MDReadAudibleCommonHeader( IAudibleInputStream *pFile, CAudibleCommonHeader *pCommonHead, long sectionSize )
{ if ( sectionSize != 24 )
{ return AUD_AA_FILE_BAD_FORMAT;
}
//-------------- Now read.
{ BOOL readRes =
ReadShort( pFile, &pCommonHead->versionNumber ) &&
ReadShort( pFile, &pCommonHead->minVersionNumber ) &&
ReadLong ( pFile, &pCommonHead->magicNumber ) &&
//------------ Read information if this is partial file from larger one.
ReadLong( pFile, &pCommonHead->IsPartialFile ) &&
ReadLong( pFile, &pCommonHead->sizeOfOriginalAudio ) &&
ReadLong( pFile, &pCommonHead->segmentStart ) &&
ReadLong( pFile, &pCommonHead->segmentEnd );
//----------------
if ( !readRes )
{ return AUD_FILE_READ_FAIL;
}
if ( pCommonHead->magicNumber != 0x57907536 || pCommonHead->minVersionNumber != 0 )
{ return AUD_AA_FILE_BAD_FORMAT;
}
//----------- If version more than 1 - means some new future format
if ( pCommonHead->versionNumber > 1 || pCommonHead->versionNumber < 0 )
{ return AUD_AA_FILE_UNSOPPORTED_FORMAT;
}
return AUD_NO_ERROR;
}
}
示例5: MeshFileInfo
FileInfo * VFSPlugin_LWO::Read(unsigned char *buffer, unsigned int length)
{
m_offset = 0;
m_buffer = buffer;
m_length = length;
m_fileinfo = new MeshFileInfo();
m_fileinfo->mesh = fusion->Mesh->CreateMesh();
m_fileinfo->filelength = m_length;
// Read the FORM tag
if(ReadLong() != ID_FORM) return NULL;
// Read the entire data size
long chunklen = ReadLong()-4;
// Read the LWO2 tag
if(ReadLong() != ID_LWO2) return NULL;
// Read chunks
while(chunklen > 0) chunklen -= ReadChunk();
// Process Surface (turn it into a useable mesh)
ProcessSurface();
// Return a ptr to the file info
return m_fileinfo;
}
示例6: WTRACE
// TMsgDirFindServiceReply::Unpack
// Virtual method from TMessage. Extracts data from message buffer.
void
TMsgDirFindServiceReply::Unpack(void)
{
WTRACE("TMsgDirFindServiceReply::Unpack");
TMessage::Unpack();
if ((GetServiceType() != WONMsg::DirServer) ||
(GetMessageType() != WONMsg::DirFindServiceReply))
{
WDBG_AH("TMsgDirFindServiceReply::Unpack Not a DirFindServiceReply message!");
throw WONMsg::BadMsgException(*this, __LINE__, __FILE__,
"Not a DirFindServiceReply message.");
}
WDBG_LL("TMsgDirFindServiceReply::Unpack Reading message data");
mStatus = static_cast<ServerStatus>(static_cast<short>(ReadShort()));
// Service data only present if status is success
if (mStatus == WONMsg::StatusCommon_Success)
{
mService.mType = DirServerEntry::EntryTypeService;
ReadWString(mService.mPath);
ReadWString(mService.mName);
ReadWString(mService.mDisplayName);
ReadWString(mService.mVersion);
ReadWString(mService.mProtoName);
ReadWString(mService.mProtoVersion);
ReadWString(mService.mNetAddress);
mService.mLifespan = ReadLong();
mService.mCreated = ReadLong();
unsigned short aLen = ReadShort();
mService.SetBlob(ReadBytes(aLen), aLen);
}
}
示例7: ReadLong
void SMsgUsrGetPolledUserListReplyEx::unpack_multiple_message_specific_data()
{
// Retrieve the data source id
m_i_data_source_id = ReadLong();
// Retrieve the data source specific status information
m_data_source_specific_status = static_cast<WONMsg::ServerStatus>(static_cast<short>(ReadShort()));
// Retrieve the number of users found
unsigned long number_of_user_objects = ReadLong();
// Retrieve each user, adding each user to the end of the user vector array
for (unsigned long counter = 0;
counter < number_of_user_objects;
counter++)
{
// Add a new user to the end of the array
m_a_users.push_back(User());
m_a_users.back().unpack_data(*this);
}
}
示例8: ReadExtended
double ReadExtended(const unsigned char *bytes)
{
double f;
int expon;
unsigned long hiMant, loMant;
expon = ((bytes[0] & 0x7F) << 8) | (bytes[1] & 0xFF);
hiMant = ReadLong(bytes+2);
loMant = ReadLong(bytes+6);
if (expon == 0 && hiMant == 0 && loMant == 0)
f = 0;
else {
if (expon == 0x7FFF) /* Infinity or NaN */
f = -1;
else {
expon -= 16383;
/* must #include <math.h> or these won't work */
f = ldexp(UnsignedToFloat(hiMant),expon -= 31);
f += ldexp(UnsignedToFloat(loMant),expon -= 32);
}
}
if (bytes[0] & 0x80)
return -f;
return f;
}
示例9: WTRACE
// SMsgDirG2PeerDataBase::UnpackPeerData
// Hook to unpack the peer data if needed. Only reads peer data if peer
// data is present. Note that mPeerUser was added later and may or may not be
// present.
void
SMsgDirG2PeerDataBase::UnpackPeerData(void)
{
WTRACE("SMsgDirG2PeerDataBase::UnpackPeerData");
if (BytesLeftToRead() > 0)
{
WDBG_LL("SMsgDirG2PeerDataBase::UnpackPeerData Reading peer data.");
ReadString(mPeerKey);
mPeerIndex = ReadLong();
if (BytesLeftToRead() > 0)
{
WDBG_LL("SMsgDirG2PeerDataBase::UnpackPeerData Reading user id.");
mPeerUser = ReadLong();
}
else
mPeerUser = 0;
}
else
{
WDBG_LL("SMsgDirG2PeerDataBase::UnpackPeerData No peer data to read.");
mPeerKey = string();
mPeerIndex = 0;
mPeerUser = 0;
}
}
示例10: WTRACE
void
TMsgDirGetDirContentsReply::UnpackEntry(DirServerEntry& theEntry)
{
WTRACE("TMsgDirGetDirContentsReply::UnpackEntry");
WDBG_LL("TMsgDirGetDirContentsReply::UnpackEntry Unpacking entry");
theEntry.mType = ReadByte();
ReadWString(theEntry.mPath);
ReadWString(theEntry.mName);
ReadWString(theEntry.mDisplayName);
theEntry.mLifespan = ReadLong();
theEntry.mCreated = ReadLong();
if (theEntry.mType == DirServerEntry::EntryTypeDirectory)
{
theEntry.mVisible = (ReadByte() == 0 ? false : true);
}
else if (theEntry.mType == DirServerEntry::EntryTypeService)
{
ReadWString(theEntry.mVersion);
ReadWString(theEntry.mProtoName);
ReadWString(theEntry.mProtoVersion);
ReadWString(theEntry.mNetAddress);
theEntry.mBlobLen = ReadShort();
theEntry.SetBlob(ReadBytes(theEntry.mBlobLen), theEntry.mBlobLen);
}
}
示例11: LoadTIMER
void LoadTIMER(SAVESTATE_t* save, timerc* time) {
CHUNK_t* chunk = FindChunk(save,TIMER_tag);
chunk->pnt = 0;
time->tstates = ReadLong(chunk);
time->freq = (uint32_t) ReadLong(chunk);
time->elapsed = ReadDouble(chunk);
time->lasttime = ReadDouble(chunk); // this isn't used.
}
示例12: ReadString
void vmStructure::StreamIn (std::istream& stream) {
#ifdef STREAM_NAMES
m_name = ReadString (stream);
#endif
m_firstField = ReadLong (stream);
m_fieldCount = ReadLong (stream);
m_dataSize = ReadLong (stream);
m_containsString = ReadByte (stream);
m_containsArray = ReadByte (stream);
}
示例13: ReadLong
void vmValType::StreamIn (std::istream& stream) {
// Read vmValType from stream
m_basicType = (vmBasicValType) ReadLong (stream);
m_arrayLevel = ReadByte (stream);
m_pointerLevel = ReadByte (stream);
m_byRef = ReadByte (stream);
for (int i = 0; i < VM_MAXDIMENSIONS; i++)
m_arrayDims [i] = ReadLong (stream);
}
示例14: WTRACE
void
SMsgDirG2UpdateExtendBase::UnpackExtended(void)
{
WTRACE("SMsgDirG2UpdateExtendBase::UnpackExtended");
WDBG_LL("SMsgDirG2UpdateExtendBase::UnpackExtended enableDataObjects=" << mEnableDataObjects << " enableACLs=" << mEnableACLs);
mDataObjects.clear();
mACLs.clear();
if (mEnableDataObjects)
{
unsigned short aCt = ReadShort();
WDBG_LL("SMsgDirG2UpdateExtendBase::UnpackExtended Reading " << aCt << " data objects.");
for (int i=0; i < aCt; i++)
{
DataObject anObj;
unsigned char aTypeLen = ReadByte();
if (aTypeLen > 0)
anObj.GetDataType().assign(reinterpret_cast<const unsigned char*>(ReadBytes(aTypeLen)), aTypeLen);
unsigned short aDataLen = ReadShort();
if (aDataLen > 0)
anObj.GetData().assign(reinterpret_cast<const unsigned char*>(ReadBytes(aDataLen)), aDataLen);
mDataObjects.insert(anObj);
}
}
if (mEnableACLs)
{
unsigned short aCt = ReadShort();
WDBG_LL("SMsgDirG2UpdateExtendBase::UnpackExtended Reading " << aCt << " ACLs.");
for (int i=0; i < aCt; i++)
{
DirACL anACL;
anACL.mType = static_cast<WONMsg::DirG2ACLType>(ReadByte());
unsigned short aPermCt = ReadShort();
for (int j=0; j < aPermCt; j++)
{
Permission aPerm;
aPerm.mUserId = ReadLong();
aPerm.mCommunityId = ReadLong();
aPerm.mTrustLevel = ReadShort();
anACL.mACL.insert(aPerm);
}
mACLs.push_back(anACL);
}
}
}
示例15: UnpackMess
void UnpackMess(char *player)
/*
* Takes all messages from a result and puts them in ``mdata??.dat''.
* Since messages are of unpredictable length, the place and size of
* all messages are given at the beginning of the file. In the result,
* however places (of course?) differ. So the messages are
* "moved". Also, a file ``mess??.dat'' with 0 outgoing messages is
* created.
*/
{
FILE *mess;
unsigned long place=16,dump;
unsigned short nomess;
unsigned char *buf;
int i,total=0,size;
buf=rstremember+place;
ReadLong(place,buf);
place--; /* this sucks */
buf=rstremember+place;
ReadShort(nomess,buf);
fprintf(stdout,"%3d messages found\n",nomess);
ReadLong(place,buf); /* place where first message starts */
buf-=4;
place--; /* this sucks */
for (i=0;i<nomess;i++) {
#ifdef test
fprintf(stderr,"%i",i%10);
#endif
ReadLong(dump,buf);
buf-=4; /* only disadvantage of my own macro */
dump-=(place-(2+6*nomess)); /* ``move'' message */
WriteLong(dump,buf);
ReadShort(size,buf);
total+=size;
}
mess=OpenPlayerFile("mdata",player,"dat");
fwrite(buf-(2+6*nomess),2+6*nomess,1,mess);
fwrite(rstremember+place,total,1,mess);
/* datsig not needed */
fclose(mess);
mess=OpenPlayerFile("mess",player,"dat");
i=0;
fwrite(&i,2,1,mess);
fclose(mess);
} /* UnpackMess */