亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? utility.cpp

?? 針對cdma2000層3信令的SMS的unicode ,解析出文本格式的SMS的源碼,在c++builder環(huán)境下開發(fā).
?? CPP
字號:
/*===================================================================
SERVICES:   UTILITY ROUTINES FOR COMPUTING THE CRC and Bit copying
            routines.
DESCRIPTION:
   This module provides utilities form computing a 30 bit CRC as 
   specified in the IS-95A and IS-2000 and also provides bit copying
   routines
===================================================================*/

//===================================================================
//   INCLUDES AND PUBLIC DATA DECLARATIONS
//===================================================================

//-------------------------------------------------------------------
// Defines
//-------------------------------------------------------------------

#define  CRC_MASK    0x6030B9C7

//-------------------------------------------------------------------
// Include Files
//-------------------------------------------------------------------
//#include "vxWorks.h"
//#include "csmtypes.h"
//#include "csmdef.h"
#include "utility.h"

#include "stdio.h"
#include "stdlib.h"

//-------------------------------------------------------------------
// Global Constant Declarations 
//-------------------------------------------------------------------

/*-------------------------------------------------------------------
   Static Variable Definitions  
-------------------------------------------------------------------*/

//- ------------------------------------------------------------------
//  Type Declarations
//- ------------------------------------------------------------------
    
/*- ------------------------------------------------------------------
    Function Prototypes
--- ----------------------------------------------------------------*/
    
//===================================================================
//  CLASS DEFINITIONS and FUNCTION DECLARATIONS
//===================================================================



/*=========================================================================
FUNCTION:   BCopy

DESCRIPTION:
   Arbitrary bit copy.

===========================================================================*/
//
bool BCopy
(
   const byte*    sourceBitBuffer,
   uint32         sourceBitOffset,
   byte*          destinationBitBuffer,
   uint32         destinationBitOffset,
   uint32         bitCount                // Number of bits to copy
)
{
   uint32         sourceBitIndexInByte;
   uint32         destinationBitIndexInByte;
   uint32         sourceByteIndex;
   uint32         destinationByteIndex;
   uint32         i;

   sourceByteIndex = sourceBitOffset / 8;
   sourceBitIndexInByte = sourceBitOffset % 8;

   destinationByteIndex = destinationBitOffset / 8;
   destinationBitIndexInByte = destinationBitOffset % 8;

   for( i=0; i<bitCount; i++ )
   {
      if( sourceBitBuffer[sourceByteIndex] & (1<<(7-sourceBitIndexInByte)) )
      {
         // This bit is set, copy to the destination bit buffer
         destinationBitBuffer[destinationByteIndex] |=
                                    (1<<(7-destinationBitIndexInByte));
      }
      else
      {
         destinationBitBuffer[destinationByteIndex] &=
                                    ~(byte)(1<<(7-destinationBitIndexInByte));
      }

      sourceBitIndexInByte += 1;
      if( sourceBitIndexInByte == 8 )
      {
         sourceBitIndexInByte = 0;
         sourceByteIndex += 1;
      }

      destinationBitIndexInByte += 1;
      if( destinationBitIndexInByte == 8 )
      {
         destinationBitIndexInByte = 0;
         destinationByteIndex += 1;
      }
   }

   return true;
}  // BCopy



/*=========================================================================
FUNCTION:   BitCopyFromBitStream

DESCRIPTION:
   Function copies bitCount bits from the supplied byte stream sourceBitBuffer
   starting at sourceBitOffset into the supplied byte result.

===========================================================================*/

void BitCopyFromBitStream
(
   const byte* sourceBitBuffer,
   uint32      sourceBitOffset,
   byte&       result,
   uint32      bitCount
)
{
   byte           bitIndexInByte;
   uint32         byteIndex;
   uint32         i;
   byte           resultOffset;

   if( bitCount == 0 )
   {
      return;
   }

   if( bitCount > (int)sizeof(result)*8 )
   {
      return;
   }

   byteIndex      = sourceBitOffset / 8;
   bitIndexInByte = sourceBitOffset % 8;

   resultOffset = 1 << (bitCount-1);

   result = 0;

   for( i=0; i<bitCount; i++ )
   {
      
      if( sourceBitBuffer[byteIndex] & (1<<(7-bitIndexInByte)) )
      {
         // This bit is set, copy to the result
         result += resultOffset;
      }
 
      resultOffset >>= 1;
      bitIndexInByte += 1;
      if( bitIndexInByte == 8 )
      {
         bitIndexInByte = 0;
         byteIndex += 1;
      }
   }

   return;
}  // BitCopyFromBitStream



/*=========================================================================
FUNCTION:   BitCopyFromBitStream

DESCRIPTION:
   Function copies bitCount bits from the supplied byte stream sourceBitBuffer
   starting at sourceBitOffset into the supplied uint16 result.

===========================================================================*/

void BitCopyFromBitStream
(
   const byte* sourceBitBuffer,
   uint32      sourceBitOffset,
   uint16&     result,
   uint32      bitCount
)
{
   byte           bitIndexInByte;
   uint32         byteIndex;
   uint32         i;
   uint16         resultOffset;

   if( bitCount == 0 )
   {
      return;
   }

   if( bitCount > (int)sizeof(result)*8 )
   {
      return;
   }

   byteIndex      = sourceBitOffset / 8;
   bitIndexInByte = sourceBitOffset % 8;

   resultOffset = 1 << (bitCount-1);

   result = 0;

   for( i=0; i<bitCount; i++ )
   {
      if( sourceBitBuffer[byteIndex] & (1<<(7-bitIndexInByte)) )
      {
         // This bit is set, copy to the result
         result += resultOffset;
      }

      resultOffset >>= 1;
      bitIndexInByte += 1;
      if( bitIndexInByte == 8 )
      {
         bitIndexInByte = 0;
         byteIndex += 1;
      }
   }

   return;
}  // BitCopyFromBitStream



/*=========================================================================
FUNCTION:   BitCopyFromBitStream

DESCRIPTION:
   Function copies bitCount bits from the supplied byte stream sourceBitBuffer
   starting at sourceBitOffset into the supplied uint32 result.

===========================================================================*/

void BitCopyFromBitStream
(
   const byte* sourceBitBuffer,
   uint32      sourceBitOffset,
   uint32&     result,
   uint32      bitCount
)
{
   byte           bitIndexInByte;
   uint32         byteIndex;
   uint32         i;
   uint32         resultOffset;

   if( bitCount == 0 )
   {
      return;
   }

   if( bitCount > (int)sizeof(result)*8 )
   {
      return;
   }

   byteIndex      = sourceBitOffset / 8;
   bitIndexInByte = sourceBitOffset % 8;

   resultOffset = 1 << (bitCount-1);

   result = 0;

   for( i=0; i<bitCount; i++ )
   {
      if( sourceBitBuffer[byteIndex] & (1<<(7-bitIndexInByte)) )
      {
         // This bit is set, copy to the result
         result += resultOffset;
      }

      resultOffset >>= 1;
      bitIndexInByte += 1;
      if( bitIndexInByte == 8 )
      {
         bitIndexInByte = 0;
         byteIndex += 1;
      }
   }

   return;
}  // BitCopyFromBitStream



/*=========================================================================
FUNCTION:   BitCopyFromBitStream

DESCRIPTION:
   Function copies bitCount bits from the supplied byte stream sourceBitBuffer
   starting at sourceBitOffset into the supplied uint64 result.

===========================================================================*/

void BitCopyFromBitStream
(
   const byte* sourceBitBuffer,
   uint32      sourceBitOffset,
   uint64&     result,
   uint32      bitCount
)
{
   byte           bitIndexInByte;
   uint32         byteIndex;
   uint32         i;
   uint64         resultOffset;

   if( bitCount == 0 )
   {
      return;
   }

   if( bitCount > (int)sizeof(result)*8 )
   {
      return;
   }

   byteIndex      = sourceBitOffset / 8;
   bitIndexInByte = sourceBitOffset % 8;

   resultOffset = 1 << (bitCount-1);

   result = (uint32)0;

   for( i=0; i<bitCount; i++ )
   {
      if( sourceBitBuffer[byteIndex] & (1<<(7-bitIndexInByte)) )
      {
         // This bit is set, copy to the result
         result = result + resultOffset;
      }

      resultOffset >>= 1;
      bitIndexInByte += 1;
      if( bitIndexInByte == 8 )
      {
         bitIndexInByte = 0;
         byteIndex += 1;
      }
   }

   return;
}  // BitCopyFromBitStream



/*=========================================================================
FUNCTION:   BitCopyToBitStream

DESCRIPTION:
   Function copies bitCount bits from the supplied byte source into the
   destinationBitBuffer starting at destinationBitOffset.

===========================================================================*/
void BitCopyToBitStream
(
   const byte& source,
   byte*       destinationBitBuffer,
   uint32      destinationBitOffset,
   uint32      bitCount
)
{
   byte           bitIndexInByte;
   uint32         byteIndex;
   uint32         i;
   byte           sourceOffset;

   if( bitCount == 0 )
   {
      return;
   }

   if( bitCount > (int)sizeof(source)*8 )
   {
      return;
   }

   byteIndex      = destinationBitOffset / 8;
   bitIndexInByte = destinationBitOffset % 8;

   sourceOffset = 1 << (bitCount-1);

   for( i=0; i<bitCount; i++ )
   {
      if( source & sourceOffset )
      {
         // This bit is set, copy to the result
         destinationBitBuffer[byteIndex] |= (1<<(7-bitIndexInByte));
      }
      else
      {
         destinationBitBuffer[byteIndex] &= ~(byte)(1<<(7-bitIndexInByte));
      }

      sourceOffset >>= 1;
      bitIndexInByte += 1;
      if( bitIndexInByte == 8 )
      {
         bitIndexInByte = 0;
         byteIndex += 1;
      }
   }

   return;
}  // BitCopyToBitStream


/*=========================================================================
FUNCTION:   BitCopyToBitStream

DESCRIPTION:
   Function copies bitCount bits from the supplied uint16 source into the
   destinationBitBuffer starting at destinationBitOffset.

===========================================================================*/
void BitCopyToBitStream
(
   const uint16&  source,
   byte*          destinationBitBuffer,
   uint32         destinationBitOffset,
   uint32         bitCount )
{
   byte           bitIndexInByte;
   uint32         byteIndex;
   uint32         i;
   uint16         sourceOffset;

   if( bitCount == 0 )
   {
      return;
   }

   if( bitCount > (int)sizeof(source)*8 )
   {
      return;
   }

   byteIndex      = destinationBitOffset / 8;
   bitIndexInByte = destinationBitOffset % 8;

   sourceOffset = 1 << (bitCount-1);

   for( i=0; i<bitCount; i++ )
   {
      if( source & sourceOffset )
      {
         // This bit is set, copy to the result
         destinationBitBuffer[byteIndex] |= (1<<(7-bitIndexInByte));
      }
      else
      {
         destinationBitBuffer[byteIndex] &= ~(byte)(1<<(7-bitIndexInByte));
      }

      sourceOffset >>= 1;
      bitIndexInByte += 1;
      if( bitIndexInByte == 8 )
      {
         bitIndexInByte = 0;
         byteIndex += 1;
      }
   }

   return;
}  // BitCopyToBitStream


/*=========================================================================
FUNCTION:   BitCopyToBitStream

DESCRIPTION:
   Function copies bitCount bits from the supplied uint32 source into the
   destinationBitBuffer starting at destinationBitOffset.

===========================================================================*/
void BitCopyToBitStream
(
   const uint32&  source,
   byte*          destinationBitBuffer,
   uint32         destinationBitOffset,
   uint32         bitCount
)
{
   byte           bitIndexInByte;
   uint32         byteIndex;
   uint32         i;
   uint32         sourceOffset;

   if( bitCount == 0 )
   {
      return;
   }

   if( bitCount > (int)sizeof(source)*8 )
   {
      return;
   }

   byteIndex      = destinationBitOffset / 8;
   bitIndexInByte = destinationBitOffset % 8;

   sourceOffset = 1 << (bitCount-1);

   for( i=0; i<bitCount; i++ )
   {
      if( source & sourceOffset )
      {
         // This bit is set, copy to the result
         destinationBitBuffer[byteIndex] |= (1<<(7-bitIndexInByte));
      }
      else
      {
         destinationBitBuffer[byteIndex] &= ~(byte)(1<<(7-bitIndexInByte));
      }

      sourceOffset >>= 1;
      bitIndexInByte += 1;
      if( bitIndexInByte == 8 )
      {
         bitIndexInByte = 0;
         byteIndex += 1;
      }
   }

   return;
}  // BitCopyToBitStream


/*=========================================================================
FUNCTION:   BitCopyToBitStream

DESCRIPTION:
   Function copies bitCount bits from the supplied uint64 source into the
   destinationBitBuffer starting at destinationBitOffset.

===========================================================================*/
void BitCopyToBitStream
(
   const uint64&  source,
   byte*          destinationBitBuffer,
   uint32         destinationBitOffset,
   uint32         bitCount
)
{
   byte           bitIndexInByte;
   uint32         byteIndex;
   uint32         i;
   uint64         sourceOffset=0;
   uint64         zero=0;

   if( bitCount == 0 )
   {
      return;
   }

   if( bitCount > (int)sizeof(source)*8 )
   {
      return;
   }

   byteIndex      = destinationBitOffset / 8;
   bitIndexInByte = destinationBitOffset % 8;

   sourceOffset = 1;
   sourceOffset <<= (bitCount-1);

   for( i=0; i<bitCount; i++ )
   {
      if( (source & sourceOffset) != zero )
      {
         // This bit is set, copy to the result
         destinationBitBuffer[byteIndex] |= (1<<(7-bitIndexInByte));
      }
      else
      {
         destinationBitBuffer[byteIndex] &= ~(byte)(1<<(7-bitIndexInByte));
      }

      sourceOffset >>= (uint32)1;
      bitIndexInByte += 1;
      if( bitIndexInByte == 8 )
      {
         bitIndexInByte = 0;
         byteIndex += 1;
      }
   }

   return;
}  // BitCopyToBitStream



/**************************************************************************/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久国产精品99久久人人澡| 91精品国产福利在线观看 | 欧美性三三影院| 久久超碰97中文字幕| 国产精品五月天| 成人午夜在线免费| 亚洲v日本v欧美v久久精品| 久久久久久久综合日本| 久久免费精品国产久精品久久久久| 一本色道**综合亚洲精品蜜桃冫| ...中文天堂在线一区| 日本一区二区三区电影| 色综合色狠狠天天综合色| 在线观看精品一区| 91在线免费播放| 欧美大片顶级少妇| 亚洲女厕所小便bbb| 国产视频视频一区| 这里只有精品电影| 9191精品国产综合久久久久久| 91免费视频网| 成人精品视频一区二区三区| 国产麻豆精品久久一二三| 日韩一区精品视频| 日韩精品视频网| 亚洲国产一区二区a毛片| 国产精品国产三级国产普通话蜜臀 | 在线中文字幕一区二区| 九色|91porny| 亚洲6080在线| 日本午夜一区二区| 国产蜜臀97一区二区三区| 国产精品免费久久| 中文字幕一区二区三区不卡在线| 国产精品美女久久久久aⅴ国产馆| 欧美成人乱码一区二区三区| 欧美日韩aaa| 91麻豆精品91久久久久久清纯| 亚洲精品一区二区三区精华液| 日韩精品免费视频人成| 日本免费新一区视频| 日本不卡中文字幕| 舔着乳尖日韩一区| 精品亚洲国内自在自线福利| 懂色av中文一区二区三区| 91麻豆.com| 日韩欧美一二区| 一区视频在线播放| 天天色 色综合| 国产黄人亚洲片| 欧美中文字幕亚洲一区二区va在线| 日韩一级成人av| 国产精品毛片大码女人| 五月婷婷欧美视频| 成人美女视频在线观看18| 欧美日韩国产一区二区三区地区| 2020国产精品| 亚洲高清在线视频| 粉嫩av一区二区三区粉嫩| 欧美人xxxx| 亚洲四区在线观看| 久久疯狂做爰流白浆xx| 91免费看`日韩一区二区| 91精品麻豆日日躁夜夜躁| 综合在线观看色| 精品一区二区三区在线观看国产| 一本大道av一区二区在线播放 | 色吊一区二区三区| 精品国产乱码久久久久久图片| 一区二区三区在线免费观看| 老色鬼精品视频在线观看播放| 一本大道久久精品懂色aⅴ| 久久亚洲影视婷婷| 丝袜诱惑亚洲看片| 99re视频这里只有精品| 欧美不卡一区二区三区| 亚洲精品va在线观看| 国产成人免费在线观看不卡| 制服.丝袜.亚洲.另类.中文| 亚洲视频在线观看三级| 黑人精品欧美一区二区蜜桃| 欧美三区在线观看| 亚洲人成小说网站色在线| 国产电影精品久久禁18| 日韩亚洲欧美中文三级| 亚洲成人久久影院| 97久久精品人人做人人爽50路| 久久这里只有精品首页| 另类调教123区| 在线不卡中文字幕| 亚洲国产精品一区二区尤物区| 91丨九色丨蝌蚪丨老版| 中文字幕一区在线观看| 国产91丝袜在线播放0| 久久午夜色播影院免费高清| 免费xxxx性欧美18vr| 67194成人在线观看| 亚洲国产精品欧美一二99| 91久久国产最好的精华液| 亚洲天堂av老司机| 91小宝寻花一区二区三区| 国产精品久久久一本精品 | 久久精品网站免费观看| 久久国产福利国产秒拍| 欧美电视剧在线看免费| 久久99精品久久久久久国产越南| 日韩一级欧美一级| 麻豆91精品视频| 久久―日本道色综合久久| 精品一区二区三区日韩| xnxx国产精品| 国产盗摄视频一区二区三区| 久久久一区二区三区捆绑**| 国产伦理精品不卡| 中文欧美字幕免费| 成人aaaa免费全部观看| 中文字幕视频一区| 日本韩国一区二区三区| 亚洲午夜久久久| 在线成人av影院| 久久精品国产久精国产| 国产欧美日韩中文久久| 成人免费福利片| 一区二区三区在线观看动漫| 欧美丝袜丝交足nylons| 日韩精品免费视频人成| 精品国产不卡一区二区三区| 国产91丝袜在线播放0| 亚洲精品国产无天堂网2021| 欧洲国内综合视频| 捆绑调教一区二区三区| 欧美大片在线观看一区二区| 国产成人午夜精品影院观看视频| 中文字幕亚洲成人| 欧美日韩精品福利| 久久福利视频一区二区| 国产精品久久三| 欧美日韩精品一区二区三区四区| 麻豆精品视频在线观看视频| 国产三级精品视频| 日本高清免费不卡视频| 婷婷成人综合网| 国产三级一区二区| 日本精品免费观看高清观看| 美女一区二区在线观看| 中文字幕一区在线| 在线成人免费观看| 成人高清视频免费观看| 亚洲福中文字幕伊人影院| 精品日韩欧美在线| 一本色道综合亚洲| 九九精品视频在线看| 亚洲天堂免费看| 日韩免费视频一区二区| av电影天堂一区二区在线观看| 日本亚洲最大的色成网站www| 欧美国产综合一区二区| 欧美喷潮久久久xxxxx| 成人app在线观看| 免费成人小视频| 亚洲精品福利视频网站| 久久久国产精品不卡| 欧美人妖巨大在线| 91影视在线播放| 精品亚洲成a人在线观看| 亚洲黄色小视频| 欧美极品少妇xxxxⅹ高跟鞋| 欧美一区二区人人喊爽| 91捆绑美女网站| 国产iv一区二区三区| 麻豆精品在线看| 亚洲电影激情视频网站| 国产精品乱人伦中文| 精品美女一区二区| 欧美日本韩国一区| 色嗨嗨av一区二区三区| 成人禁用看黄a在线| 日产国产高清一区二区三区| 国产精品夫妻自拍| 91精品办公室少妇高潮对白| 黄色日韩三级电影| 亚洲va韩国va欧美va| 久久综合网色—综合色88| 欧美三日本三级三级在线播放| 国产精品亚洲一区二区三区在线| 成人免费视频在线观看| 久久精品一区二区| 欧美一区二区三区爱爱| 色婷婷一区二区| aa级大片欧美| 国产一区视频网站| 日韩电影在线观看电影| 一区二区三区中文在线观看| 久久久精品免费免费| 日韩一区二区三区视频| 在线精品观看国产| 在线免费av一区| 懂色av中文字幕一区二区三区| 久久精品噜噜噜成人av农村| 日本在线播放一区二区三区|