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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? btree.c

?? 新版輕量級嵌入式數據庫
?? C
?? 第 1 頁 / 共 5 頁
字號:
** database page. The first argument to each is the number of usable** bytes on each page of the database (often 1024). The second is the** page number to look up in the pointer map.**** PTRMAP_PAGENO returns the database page number of the pointer-map** page that stores the required pointer. PTRMAP_PTROFFSET returns** the offset of the requested map entry.**** If the pgno argument passed to PTRMAP_PAGENO is a pointer-map page,** then pgno is returned. So (pgno==PTRMAP_PAGENO(pgsz, pgno)) can be** used to test if pgno is a pointer-map page. PTRMAP_ISPAGE implements** this test.*/#define PTRMAP_PAGENO(pBt, pgno) ptrmapPageno(pBt, pgno)#define PTRMAP_PTROFFSET(pBt, pgno) (5*(pgno-ptrmapPageno(pBt, pgno)-1))#define PTRMAP_ISPAGE(pBt, pgno) (PTRMAP_PAGENO((pBt),(pgno))==(pgno))static Pgno ptrmapPageno(BtShared *pBt, Pgno pgno){  int nPagesPerMapPage = (pBt->usableSize/5)+1;  int iPtrMap = (pgno-2)/nPagesPerMapPage;  int ret = (iPtrMap*nPagesPerMapPage) + 2;   if( ret==PENDING_BYTE_PAGE(pBt) ){    ret++;  }  return ret;}/*** The pointer map is a lookup table that identifies the parent page for** each child page in the database file.  The parent page is the page that** contains a pointer to the child.  Every page in the database contains** 0 or 1 parent pages.  (In this context 'database page' refers** to any page that is not part of the pointer map itself.)  Each pointer map** entry consists of a single byte 'type' and a 4 byte parent page number.** The PTRMAP_XXX identifiers below are the valid types.**** The purpose of the pointer map is to facility moving pages from one** position in the file to another as part of autovacuum.  When a page** is moved, the pointer in its parent must be updated to point to the** new location.  The pointer map is used to locate the parent page quickly.**** PTRMAP_ROOTPAGE: The database page is a root-page. The page-number is not**                  used in this case.**** PTRMAP_FREEPAGE: The database page is an unused (free) page. The page-number **                  is not used in this case.**** PTRMAP_OVERFLOW1: The database page is the first page in a list of **                   overflow pages. The page number identifies the page that**                   contains the cell with a pointer to this overflow page.**** PTRMAP_OVERFLOW2: The database page is the second or later page in a list of**                   overflow pages. The page-number identifies the previous**                   page in the overflow page list.**** PTRMAP_BTREE: The database page is a non-root btree page. The page number**               identifies the parent page in the btree.*/#define PTRMAP_ROOTPAGE 1#define PTRMAP_FREEPAGE 2#define PTRMAP_OVERFLOW1 3#define PTRMAP_OVERFLOW2 4#define PTRMAP_BTREE 5/*** Write an entry into the pointer map.**** This routine updates the pointer map entry for page number 'key'** so that it maps to type 'eType' and parent page number 'pgno'.** An error code is returned if something goes wrong, otherwise SQLITE_OK.*/static int ptrmapPut(BtShared *pBt, Pgno key, u8 eType, Pgno parent){  u8 *pPtrmap;    /* The pointer map page */  Pgno iPtrmap;   /* The pointer map page number */  int offset;     /* Offset in pointer map page */  int rc;  /* The master-journal page number must never be used as a pointer map page */  assert( 0==PTRMAP_ISPAGE(pBt, PENDING_BYTE_PAGE(pBt)) );  assert( pBt->autoVacuum );  if( key==0 ){    return SQLITE_CORRUPT_BKPT;  }  iPtrmap = PTRMAP_PAGENO(pBt, key);  rc = sqlite3pager_get(pBt->pPager, iPtrmap, (void **)&pPtrmap);  if( rc!=SQLITE_OK ){    return rc;  }  offset = PTRMAP_PTROFFSET(pBt, key);  if( eType!=pPtrmap[offset] || get4byte(&pPtrmap[offset+1])!=parent ){    TRACE(("PTRMAP_UPDATE: %d->(%d,%d)\n", key, eType, parent));    rc = sqlite3pager_write(pPtrmap);    if( rc==SQLITE_OK ){      pPtrmap[offset] = eType;      put4byte(&pPtrmap[offset+1], parent);    }  }  sqlite3pager_unref(pPtrmap);  return rc;}/*** Read an entry from the pointer map.**** This routine retrieves the pointer map entry for page 'key', writing** the type and parent page number to *pEType and *pPgno respectively.** An error code is returned if something goes wrong, otherwise SQLITE_OK.*/static int ptrmapGet(BtShared *pBt, Pgno key, u8 *pEType, Pgno *pPgno){  int iPtrmap;       /* Pointer map page index */  u8 *pPtrmap;       /* Pointer map page data */  int offset;        /* Offset of entry in pointer map */  int rc;  iPtrmap = PTRMAP_PAGENO(pBt, key);  rc = sqlite3pager_get(pBt->pPager, iPtrmap, (void **)&pPtrmap);  if( rc!=0 ){    return rc;  }  offset = PTRMAP_PTROFFSET(pBt, key);  assert( pEType!=0 );  *pEType = pPtrmap[offset];  if( pPgno ) *pPgno = get4byte(&pPtrmap[offset+1]);  sqlite3pager_unref(pPtrmap);  if( *pEType<1 || *pEType>5 ) return SQLITE_CORRUPT_BKPT;  return SQLITE_OK;}#endif /* SQLITE_OMIT_AUTOVACUUM *//*** Given a btree page and a cell index (0 means the first cell on** the page, 1 means the second cell, and so forth) return a pointer** to the cell content.**** This routine works only for pages that do not contain overflow cells.*/static u8 *findCell(MemPage *pPage, int iCell){  u8 *data = pPage->aData;  assert( iCell>=0 );  assert( iCell<get2byte(&data[pPage->hdrOffset+3]) );  return data + get2byte(&data[pPage->cellOffset+2*iCell]);}/*** This a more complex version of findCell() that works for** pages that do contain overflow cells.  See insert*/static u8 *findOverflowCell(MemPage *pPage, int iCell){  int i;  for(i=pPage->nOverflow-1; i>=0; i--){    int k;    struct _OvflCell *pOvfl;    pOvfl = &pPage->aOvfl[i];    k = pOvfl->idx;    if( k<=iCell ){      if( k==iCell ){        return pOvfl->pCell;      }      iCell--;    }  }  return findCell(pPage, iCell);}/*** Parse a cell content block and fill in the CellInfo structure.  There** are two versions of this function.  parseCell() takes a cell index** as the second argument and parseCellPtr() takes a pointer to the** body of the cell as its second argument.*/static void parseCellPtr(  MemPage *pPage,         /* Page containing the cell */  u8 *pCell,              /* Pointer to the cell text. */  CellInfo *pInfo         /* Fill in this structure */){  int n;                  /* Number bytes in cell content header */  u32 nPayload;           /* Number of bytes of cell payload */  pInfo->pCell = pCell;  assert( pPage->leaf==0 || pPage->leaf==1 );  n = pPage->childPtrSize;  assert( n==4-4*pPage->leaf );  if( pPage->hasData ){    n += getVarint32(&pCell[n], &nPayload);  }else{    nPayload = 0;  }  pInfo->nData = nPayload;  if( pPage->intKey ){    n += getVarint(&pCell[n], (u64 *)&pInfo->nKey);  }else{    u32 x;    n += getVarint32(&pCell[n], &x);    pInfo->nKey = x;    nPayload += x;  }  pInfo->nHeader = n;  if( nPayload<=pPage->maxLocal ){    /* This is the (easy) common case where the entire payload fits    ** on the local page.  No overflow is required.    */    int nSize;          /* Total size of cell content in bytes */    pInfo->nLocal = nPayload;    pInfo->iOverflow = 0;    nSize = nPayload + n;    if( nSize<4 ){      nSize = 4;        /* Minimum cell size is 4 */    }    pInfo->nSize = nSize;  }else{    /* If the payload will not fit completely on the local page, we have    ** to decide how much to store locally and how much to spill onto    ** overflow pages.  The strategy is to minimize the amount of unused    ** space on overflow pages while keeping the amount of local storage    ** in between minLocal and maxLocal.    **    ** Warning:  changing the way overflow payload is distributed in any    ** way will result in an incompatible file format.    */    int minLocal;  /* Minimum amount of payload held locally */    int maxLocal;  /* Maximum amount of payload held locally */    int surplus;   /* Overflow payload available for local storage */    minLocal = pPage->minLocal;    maxLocal = pPage->maxLocal;    surplus = minLocal + (nPayload - minLocal)%(pPage->pBt->usableSize - 4);    if( surplus <= maxLocal ){      pInfo->nLocal = surplus;    }else{      pInfo->nLocal = minLocal;    }    pInfo->iOverflow = pInfo->nLocal + n;    pInfo->nSize = pInfo->iOverflow + 4;  }}static void parseCell(  MemPage *pPage,         /* Page containing the cell */  int iCell,              /* The cell index.  First cell is 0 */  CellInfo *pInfo         /* Fill in this structure */){  parseCellPtr(pPage, findCell(pPage, iCell), pInfo);}/*** Compute the total number of bytes that a Cell needs in the cell** data area of the btree-page.  The return number includes the cell** data header and the local payload, but not any overflow page or** the space used by the cell pointer.*/#ifndef NDEBUGstatic int cellSize(MemPage *pPage, int iCell){  CellInfo info;  parseCell(pPage, iCell, &info);  return info.nSize;}#endifstatic int cellSizePtr(MemPage *pPage, u8 *pCell){  CellInfo info;  parseCellPtr(pPage, pCell, &info);  return info.nSize;}#ifndef SQLITE_OMIT_AUTOVACUUM/*** If the cell pCell, part of page pPage contains a pointer** to an overflow page, insert an entry into the pointer-map** for the overflow page.*/static int ptrmapPutOvflPtr(MemPage *pPage, u8 *pCell){  if( pCell ){    CellInfo info;    parseCellPtr(pPage, pCell, &info);    if( (info.nData+(pPage->intKey?0:info.nKey))>info.nLocal ){      Pgno ovfl = get4byte(&pCell[info.iOverflow]);      return ptrmapPut(pPage->pBt, ovfl, PTRMAP_OVERFLOW1, pPage->pgno);    }  }  return SQLITE_OK;}/*** If the cell with index iCell on page pPage contains a pointer** to an overflow page, insert an entry into the pointer-map** for the overflow page.*/static int ptrmapPutOvfl(MemPage *pPage, int iCell){  u8 *pCell;  pCell = findOverflowCell(pPage, iCell);  return ptrmapPutOvflPtr(pPage, pCell);}#endif/*** Do sanity checking on a page.  Throw an exception if anything is** not right.**** This routine is used for internal error checking only.  It is omitted** from most builds.*/#if defined(BTREE_DEBUG) && !defined(NDEBUG) && 0static void _pageIntegrity(MemPage *pPage){  int usableSize;  u8 *data;  int i, j, idx, c, pc, hdr, nFree;  int cellOffset;  int nCell, cellLimit;  u8 *used;  used = sqliteMallocRaw( pPage->pBt->pageSize );  if( used==0 ) return;  usableSize = pPage->pBt->usableSize;  assert( pPage->aData==&((unsigned char*)pPage)[-pPage->pBt->pageSize] );  hdr = pPage->hdrOffset;  assert( hdr==(pPage->pgno==1 ? 100 : 0) );  assert( pPage->pgno==sqlite3pager_pagenumber(pPage->aData) );  c = pPage->aData[hdr];  if( pPage->isInit ){    assert( pPage->leaf == ((c & PTF_LEAF)!=0) );    assert( pPage->zeroData == ((c & PTF_ZERODATA)!=0) );    assert( pPage->leafData == ((c & PTF_LEAFDATA)!=0) );    assert( pPage->intKey == ((c & (PTF_INTKEY|PTF_LEAFDATA))!=0) );    assert( pPage->hasData ==             !(pPage->zeroData || (!pPage->leaf && pPage->leafData)) );    assert( pPage->cellOffset==pPage->hdrOffset+12-4*pPage->leaf );    assert( pPage->nCell = get2byte(&pPage->aData[hdr+3]) );  }  data = pPage->aData;  memset(used, 0, usableSize);  for(i=0; i<hdr+10-pPage->leaf*4; i++) used[i] = 1;  nFree = 0;  pc = get2byte(&data[hdr+1]);  while( pc ){    int size;    assert( pc>0 && pc<usableSize-4 );    size = get2byte(&data[pc+2]);    assert( pc+size<=usableSize );    nFree += size;    for(i=pc; i<pc+size; i++){      assert( used[i]==0 );      used[i] = 1;    }    pc = get2byte(&data[pc]);  }  idx = 0;  nCell = get2byte(&data[hdr+3]);  cellLimit = get2byte(&data[hdr+5]);  assert( pPage->isInit==0          || pPage->nFree==nFree+data[hdr+7]+cellLimit-(cellOffset+2*nCell) );  cellOffset = pPage->cellOffset;  for(i=0; i<nCell; i++){    int size;    pc = get2byte(&data[cellOffset+2*i]);    assert( pc>0 && pc<usableSize-4 );    size = cellSize(pPage, &data[pc]);    assert( pc+size<=usableSize );    for(j=pc; j<pc+size; j++){      assert( used[j]==0 );      used[j] = 1;    }  }  for(i=cellOffset+2*nCell; i<cellimit; i++){    assert( used[i]==0 );    used[i] = 1;  }  nFree = 0;  for(i=0; i<usableSize; i++){    assert( used[i]<=1 );    if( used[i]==0 ) nFree++;  }  assert( nFree==data[hdr+7] );

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人av福利| 亚洲天堂免费在线观看视频| 91精品一区二区三区久久久久久| 日韩精品五月天| 亚洲伊人色欲综合网| 国产欧美一区二区精品久导航 | 久久疯狂做爰流白浆xx| 中文字幕在线观看不卡| 久久影院视频免费| 精品成人一区二区三区四区| 国产日产欧美一区二区视频| 欧美一级日韩一级| 91麻豆精品国产自产在线观看一区| 91丨porny丨最新| 91日韩在线专区| 欧美日韩免费观看一区三区| 欧美性猛交xxxx乱大交退制版| 日韩精品亚洲专区| 亚洲最新在线观看| 亚洲欧美区自拍先锋| 玉足女爽爽91| 美女看a上一区| av中文字幕一区| 欧美三级日韩在线| 欧美日韩一区二区三区在线| 日韩美女主播在线视频一区二区三区| 欧美日韩一二三| 国产日韩亚洲欧美综合| 一区二区三区四区视频精品免费 | 美女网站一区二区| 国产精一品亚洲二区在线视频| 成人午夜精品一区二区三区| 正在播放亚洲一区| **欧美大码日韩| 日韩精品一二区| 91麻豆精品视频| 国产欧美视频在线观看| 图片区小说区区亚洲影院| 成人黄色大片在线观看| 欧美区视频在线观看| 国产精品久久久久久久裸模| 麻豆精品视频在线观看免费| 91欧美一区二区| 国产精品欧美久久久久一区二区 | 成人综合在线网站| 91传媒视频在线播放| 久久久精品日韩欧美| 香蕉成人啪国产精品视频综合网| 九九在线精品视频| 欧美日韩电影一区| 天天影视网天天综合色在线播放| 99re这里只有精品6| 国产精品久99| 在线亚洲+欧美+日本专区| 91精品国产日韩91久久久久久| 欧美顶级少妇做爰| 中文字幕在线免费不卡| 国产成人精品aa毛片| 国产精品视频九色porn| 一本久久a久久精品亚洲 | 夜夜嗨av一区二区三区四季av| 91香蕉国产在线观看软件| 亚洲色图欧美偷拍| 欧美疯狂做受xxxx富婆| 国产一区二区女| 亚洲精品高清在线| 精品粉嫩超白一线天av| 国产美女精品在线| 亚洲欧洲99久久| 欧美一区二区在线视频| 日韩福利视频导航| 国产无人区一区二区三区| 色偷偷88欧美精品久久久| 丝袜美腿亚洲综合| 久久伊人中文字幕| 91天堂素人约啪| 精品一区二区免费视频| 一区二区在线免费观看| 欧美色图天堂网| 国产成人在线看| 久久国产精品一区二区| 一区二区三区四区中文字幕| 精品成人一区二区| 欧美一区三区四区| 99re这里都是精品| 99久久99久久精品免费观看| 国产精一区二区三区| 麻豆91在线播放免费| 亚洲一区二三区| 欧美电视剧在线看免费| 99久久夜色精品国产网站| 色婷婷精品久久二区二区蜜臀av| 激情久久久久久久久久久久久久久久| 亚洲欧美区自拍先锋| 欧美高清在线一区二区| 精品国产乱码久久久久久图片 | 播五月开心婷婷综合| 亚洲国产cao| 中文字幕在线不卡一区| 久久新电视剧免费观看| 26uuu亚洲婷婷狠狠天堂| 欧美精品一二三| 6080日韩午夜伦伦午夜伦| 欧美在线观看一区二区| 欧美午夜精品久久久| 日韩欧美另类在线| 久久婷婷综合激情| 一区二区久久久久久| 日韩高清不卡在线| 国内久久婷婷综合| 91香蕉视频污| 欧美精品视频www在线观看| 久久综合九色综合久久久精品综合 | 亚洲人成网站在线| 人人精品人人爱| 综合久久久久久久| 亚洲成av人片在线| 国产成人在线观看| 色8久久精品久久久久久蜜| 日韩三级视频在线观看| 中文字幕在线观看一区二区| 亚洲福利视频三区| 97精品电影院| 中文在线免费一区三区高中清不卡| 日韩精品午夜视频| 欧美影院一区二区| 国产精品看片你懂得| 国产一区二区女| 精品理论电影在线观看 | 国产麻豆视频精品| 91精品国产综合久久蜜臀| 国产精品的网站| 国产一区欧美一区| 日韩一区二区免费在线电影 | 国产又黄又大久久| 欧美一区二区三区免费大片| 国产人成亚洲第一网站在线播放| 毛片av一区二区三区| 欧美电影在线免费观看| 天天色天天操综合| 精品视频一区三区九区| 亚洲五码中文字幕| 欧美日韩电影在线播放| 综合久久久久久久| 色94色欧美sute亚洲线路一久| 亚洲精品欧美在线| 欧美优质美女网站| 青椒成人免费视频| 欧美经典一区二区三区| 风间由美性色一区二区三区| 亚洲色图视频免费播放| 在线欧美日韩精品| 秋霞av亚洲一区二区三| 欧美大片国产精品| 国产夫妻精品视频| 亚洲欧洲成人精品av97| 日本高清不卡一区| 亚洲高清视频中文字幕| 亚洲精品在线观| 在线亚洲免费视频| 日韩成人一级片| 国产精品国产精品国产专区不片| 欧美午夜在线一二页| 狠狠网亚洲精品| 亚洲欧美日韩人成在线播放| 色综合久久久久综合体| 黄色小说综合网站| 亚洲一区在线播放| 精品va天堂亚洲国产| 91免费在线看| 国产91在线|亚洲| 精品一区二区三区在线播放视频| 国产精品国产三级国产aⅴ中文| 日韩欧美区一区二| 欧美精品一级二级| 在线观看视频一区| 99久久99久久精品免费看蜜桃| 国产一区二区成人久久免费影院| 亚洲一区二区在线免费看| 中文字幕人成不卡一区| 欧美日韩美少妇| 色狠狠一区二区| av电影一区二区| av不卡免费电影| 国产高清久久久久| 99精品视频中文字幕| 99久久婷婷国产综合精品| 99视频热这里只有精品免费| 成人毛片老司机大片| 成熟亚洲日本毛茸茸凸凹| www.亚洲精品| 精品视频免费看| 精品毛片乱码1区2区3区| 日韩一二三区不卡| 国产三级精品三级| 亚洲免费在线视频| 麻豆91免费观看| 99久免费精品视频在线观看| 欧美日韩中文字幕一区二区| 欧美精品一区视频|