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

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

?? btree.c

?? 這是一個嵌入式系統上運行的輕量級數據庫
?? C
?? 第 1 頁 / 共 5 頁
字號:
      moveToParent(pCur);      pPage = pCur->pPage;    }while( pCur->idx>=pPage->nCell );    *pRes = 0;    return SQLITE_OK;  }  *pRes = 0;  if( pPage->u.hdr.rightChild==0 ){    return SQLITE_OK;  }  rc = moveToLeftmost(pCur);  return rc;}/*** Step the cursor to the back to the previous entry in the database.  If** successful then set *pRes=0.  If the cursor** was already pointing to the first entry in the database before** this routine was called, then set *pRes=1.*/static int fileBtreePrevious(BtCursor *pCur, int *pRes){  int rc;  Pgno pgno;  MemPage *pPage;  pPage = pCur->pPage;  if( pPage==0 ){    *pRes = 1;    return SQLITE_ABORT;  }  assert( pPage->isInit );  assert( pCur->eSkip!=SKIP_INVALID );  if( pPage->nCell==0 ){    *pRes = 1;    return SQLITE_OK;  }  if( pCur->eSkip==SKIP_PREV ){    pCur->eSkip = SKIP_NONE;    *pRes = 0;    return SQLITE_OK;  }  pCur->eSkip = SKIP_NONE;  assert( pCur->idx>=0 );  if( (pgno = pPage->apCell[pCur->idx]->h.leftChild)!=0 ){    rc = moveToChild(pCur, pgno);    if( rc ) return rc;    rc = moveToRightmost(pCur);  }else{    while( pCur->idx==0 ){      if( pPage->pParent==0 ){        if( pRes ) *pRes = 1;        return SQLITE_OK;      }      moveToParent(pCur);      pPage = pCur->pPage;    }    pCur->idx--;    rc = SQLITE_OK;  }  *pRes = 0;  return rc;}/*** Allocate a new page from the database file.**** The new page is marked as dirty.  (In other words, sqlitepager_write()** has already been called on the new page.)  The new page has also** been referenced and the calling routine is responsible for calling** sqlitepager_unref() on the new page when it is done.**** SQLITE_OK is returned on success.  Any other return value indicates** an error.  *ppPage and *pPgno are undefined in the event of an error.** Do not invoke sqlitepager_unref() on *ppPage if an error is returned.**** If the "nearby" parameter is not 0, then a (feeble) effort is made to ** locate a page close to the page number "nearby".  This can be used in an** attempt to keep related pages close to each other in the database file,** which in turn can make database access faster.*/static int allocatePage(Btree *pBt, MemPage **ppPage, Pgno *pPgno, Pgno nearby){  PageOne *pPage1 = pBt->page1;  int rc;  if( pPage1->freeList ){    OverflowPage *pOvfl;    FreelistInfo *pInfo;    rc = sqlitepager_write(pPage1);    if( rc ) return rc;    SWAB_ADD(pBt, pPage1->nFree, -1);    rc = sqlitepager_get(pBt->pPager, SWAB32(pBt, pPage1->freeList),                        (void**)&pOvfl);    if( rc ) return rc;    rc = sqlitepager_write(pOvfl);    if( rc ){      sqlitepager_unref(pOvfl);      return rc;    }    pInfo = (FreelistInfo*)pOvfl->aPayload;    if( pInfo->nFree==0 ){      *pPgno = SWAB32(pBt, pPage1->freeList);      pPage1->freeList = pOvfl->iNext;      *ppPage = (MemPage*)pOvfl;    }else{      int closest, n;      n = SWAB32(pBt, pInfo->nFree);      if( n>1 && nearby>0 ){        int i, dist;        closest = 0;        dist = SWAB32(pBt, pInfo->aFree[0]) - nearby;        if( dist<0 ) dist = -dist;        for(i=1; i<n; i++){          int d2 = SWAB32(pBt, pInfo->aFree[i]) - nearby;          if( d2<0 ) d2 = -d2;          if( d2<dist ) closest = i;        }      }else{        closest = 0;      }      SWAB_ADD(pBt, pInfo->nFree, -1);      *pPgno = SWAB32(pBt, pInfo->aFree[closest]);      pInfo->aFree[closest] = pInfo->aFree[n-1];      rc = sqlitepager_get(pBt->pPager, *pPgno, (void**)ppPage);      sqlitepager_unref(pOvfl);      if( rc==SQLITE_OK ){        sqlitepager_dont_rollback(*ppPage);        rc = sqlitepager_write(*ppPage);      }    }  }else{    *pPgno = sqlitepager_pagecount(pBt->pPager) + 1;    rc = sqlitepager_get(pBt->pPager, *pPgno, (void**)ppPage);    if( rc ) return rc;    rc = sqlitepager_write(*ppPage);  }  return rc;}/*** Add a page of the database file to the freelist.  Either pgno or** pPage but not both may be 0. **** sqlitepager_unref() is NOT called for pPage.*/static int freePage(Btree *pBt, void *pPage, Pgno pgno){  PageOne *pPage1 = pBt->page1;  OverflowPage *pOvfl = (OverflowPage*)pPage;  int rc;  int needUnref = 0;  MemPage *pMemPage;  if( pgno==0 ){    assert( pOvfl!=0 );    pgno = sqlitepager_pagenumber(pOvfl);  }  assert( pgno>2 );  assert( sqlitepager_pagenumber(pOvfl)==pgno );  pMemPage = (MemPage*)pPage;  pMemPage->isInit = 0;  if( pMemPage->pParent ){    sqlitepager_unref(pMemPage->pParent);    pMemPage->pParent = 0;  }  rc = sqlitepager_write(pPage1);  if( rc ){    return rc;  }  SWAB_ADD(pBt, pPage1->nFree, 1);  if( pPage1->nFree!=0 && pPage1->freeList!=0 ){    OverflowPage *pFreeIdx;    rc = sqlitepager_get(pBt->pPager, SWAB32(pBt, pPage1->freeList),                        (void**)&pFreeIdx);    if( rc==SQLITE_OK ){      FreelistInfo *pInfo = (FreelistInfo*)pFreeIdx->aPayload;      int n = SWAB32(pBt, pInfo->nFree);      if( n<(sizeof(pInfo->aFree)/sizeof(pInfo->aFree[0])) ){        rc = sqlitepager_write(pFreeIdx);        if( rc==SQLITE_OK ){          pInfo->aFree[n] = SWAB32(pBt, pgno);          SWAB_ADD(pBt, pInfo->nFree, 1);          sqlitepager_unref(pFreeIdx);          sqlitepager_dont_write(pBt->pPager, pgno);          return rc;        }      }      sqlitepager_unref(pFreeIdx);    }  }  if( pOvfl==0 ){    assert( pgno>0 );    rc = sqlitepager_get(pBt->pPager, pgno, (void**)&pOvfl);    if( rc ) return rc;    needUnref = 1;  }  rc = sqlitepager_write(pOvfl);  if( rc ){    if( needUnref ) sqlitepager_unref(pOvfl);    return rc;  }  pOvfl->iNext = pPage1->freeList;  pPage1->freeList = SWAB32(pBt, pgno);  memset(pOvfl->aPayload, 0, OVERFLOW_SIZE);  if( needUnref ) rc = sqlitepager_unref(pOvfl);  return rc;}/*** Erase all the data out of a cell.  This involves returning overflow** pages back the freelist.*/static int clearCell(Btree *pBt, Cell *pCell){  Pager *pPager = pBt->pPager;  OverflowPage *pOvfl;  Pgno ovfl, nextOvfl;  int rc;  if( NKEY(pBt, pCell->h) + NDATA(pBt, pCell->h) <= MX_LOCAL_PAYLOAD ){    return SQLITE_OK;  }  ovfl = SWAB32(pBt, pCell->ovfl);  pCell->ovfl = 0;  while( ovfl ){    rc = sqlitepager_get(pPager, ovfl, (void**)&pOvfl);    if( rc ) return rc;    nextOvfl = SWAB32(pBt, pOvfl->iNext);    rc = freePage(pBt, pOvfl, ovfl);    if( rc ) return rc;    sqlitepager_unref(pOvfl);    ovfl = nextOvfl;  }  return SQLITE_OK;}/*** Create a new cell from key and data.  Overflow pages are allocated as** necessary and linked to this cell.  */static int fillInCell(  Btree *pBt,              /* The whole Btree.  Needed to allocate pages */  Cell *pCell,             /* Populate this Cell structure */  const void *pKey, int nKey,    /* The key */  const void *pData,int nData    /* The data */){  OverflowPage *pOvfl, *pPrior;  Pgno *pNext;  int spaceLeft;  int n, rc;  int nPayload;  const char *pPayload;  char *pSpace;  Pgno nearby = 0;  pCell->h.leftChild = 0;  pCell->h.nKey = SWAB16(pBt, nKey & 0xffff);  pCell->h.nKeyHi = nKey >> 16;  pCell->h.nData = SWAB16(pBt, nData & 0xffff);  pCell->h.nDataHi = nData >> 16;  pCell->h.iNext = 0;  pNext = &pCell->ovfl;  pSpace = pCell->aPayload;  spaceLeft = MX_LOCAL_PAYLOAD;  pPayload = pKey;  pKey = 0;  nPayload = nKey;  pPrior = 0;  while( nPayload>0 ){    if( spaceLeft==0 ){      rc = allocatePage(pBt, (MemPage**)&pOvfl, pNext, nearby);      if( rc ){        *pNext = 0;      }else{        nearby = *pNext;      }      if( pPrior ) sqlitepager_unref(pPrior);      if( rc ){        clearCell(pBt, pCell);        return rc;      }      if( pBt->needSwab ) *pNext = swab32(*pNext);      pPrior = pOvfl;      spaceLeft = OVERFLOW_SIZE;      pSpace = pOvfl->aPayload;      pNext = &pOvfl->iNext;    }    n = nPayload;    if( n>spaceLeft ) n = spaceLeft;    memcpy(pSpace, pPayload, n);    nPayload -= n;    if( nPayload==0 && pData ){      pPayload = pData;      nPayload = nData;      pData = 0;    }else{      pPayload += n;    }    spaceLeft -= n;    pSpace += n;  }  *pNext = 0;  if( pPrior ){    sqlitepager_unref(pPrior);  }  return SQLITE_OK;}/*** Change the MemPage.pParent pointer on the page whose number is** given in the second argument so that MemPage.pParent holds the** pointer in the third argument.*/static void reparentPage(Pager *pPager, Pgno pgno, MemPage *pNewParent,int idx){  MemPage *pThis;  if( pgno==0 ) return;  assert( pPager!=0 );  pThis = sqlitepager_lookup(pPager, pgno);  if( pThis && pThis->isInit ){    if( pThis->pParent!=pNewParent ){      if( pThis->pParent ) sqlitepager_unref(pThis->pParent);      pThis->pParent = pNewParent;      if( pNewParent ) sqlitepager_ref(pNewParent);    }    pThis->idxParent = idx;    sqlitepager_unref(pThis);  }}/*** Reparent all children of the given page to be the given page.** In other words, for every child of pPage, invoke reparentPage()** to make sure that each child knows that pPage is its parent.**** This routine gets called after you memcpy() one page into** another.*/static void reparentChildPages(Btree *pBt, MemPage *pPage){  int i;  Pager *pPager = pBt->pPager;  for(i=0; i<pPage->nCell; i++){    reparentPage(pPager, SWAB32(pBt, pPage->apCell[i]->h.leftChild), pPage, i);  }  reparentPage(pPager, SWAB32(pBt, pPage->u.hdr.rightChild), pPage, i);  pPage->idxShift = 0;}/*** Remove the i-th cell from pPage.  This routine effects pPage only.** The cell content is not freed or deallocated.  It is assumed that** the cell content has been copied someplace else.  This routine just** removes the reference to the cell from pPage.**** "sz" must be the number of bytes in the cell.**** Do not bother maintaining the integrity of the linked list of Cells.** Only the pPage->apCell[] array is important.  The relinkCellList() ** routine will be called soon after this routine in order to rebuild ** the linked list.*/static void dropCell(Btree *pBt, MemPage *pPage, int idx, int sz){  int j;  assert( idx>=0 && idx<pPage->nCell );  assert( sz==cellSize(pBt, pPage->apCell[idx]) );  assert( sqlitepager_iswriteable(pPage) );  freeSpace(pBt, pPage, Addr(pPage->apCell[idx]) - Addr(pPage), sz);  for(j=idx; j<pPage->nCell-1; j++){    pPage->apCell[j] = pPage->apCell[j+1];  }  pPage->nCell--;  pPage->idxShift = 1;}/*** Insert a new cell on pPage at cell index "i".  pCell points to the** content of the cell.**** If the cell content will fit on the page, then put it there.  If it** will not fit, then just make pPage->apCell[i] point to the content** and set pPage->isOverfull.  **** Do not bother maintaining the integrity of the linked list of Cells.** Only the pPage->apCell[] array is important.  The relinkCellList() ** routine will be called soon after this routine in order to rebuild ** the linked list.*/static void insertCell(Btree *pBt, MemPage *pPage, int i, Cell *pCell, int sz){  int idx, j;  assert( i>=0 && i<=pPage->nCell );  assert( sz==cellSize(pBt, pCell) );  assert( sqlitepager_iswriteable(pPage) );  idx = allocateSpace(pBt, pPage, sz);  for(j=pPage->nCell; j>i; j--){    pPage->apCell[j] = pPage->apCell[j-1];  }  pPage->nCell++;  if( idx<=0 ){    pPage->isOverfull = 1;    pPage->apCell[i] = pCell;  }else{    memcpy(&pPage->u.aDisk[idx], pCell, sz);    pPage->apCell[i] = (Cell*)&pPage->u.aDisk[idx];  }  pPage->idxShift = 1;}/*** Rebuild the linked list of cells on a page so that the cells** occur in the order specified by the pPage->apCell[] array.  ** Invoke this routine once to repair damage after one or more** invocations of either insertCell() or dropCell().*/static void relinkCellList(Btree *pBt, MemPage *pPage){  int i;  u16 *pIdx;  assert( 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美r级在线观看| 欧美日韩mp4| 紧缚奴在线一区二区三区| 秋霞电影一区二区| 日本美女一区二区三区| 日韩国产欧美在线视频| 午夜一区二区三区视频| 视频一区中文字幕| 麻豆久久一区二区| 国产麻豆精品在线观看| 成人精品国产免费网站| 国产成人av网站| 99re热视频这里只精品 | 欧美日韩黄色一区二区| 欧美性猛片aaaaaaa做受| 欧美日韩大陆一区二区| 日韩一区二区在线播放| 久久天天做天天爱综合色| 欧美国产日韩精品免费观看| 国产精品不卡一区| 五月天国产精品| 国产成人精品三级麻豆| 色香蕉成人二区免费| 欧美一区二区三区性视频| 久久久三级国产网站| 亚洲同性gay激情无套| 五月天国产精品| 成人免费看黄yyy456| 欧美日韩国产综合草草| 亚洲精品一区二区三区福利| 亚洲欧美日韩国产中文在线| 日韩精品每日更新| 成人高清免费观看| 91精品国产欧美日韩| 中文字幕国产一区| 日韩电影在线免费看| 成人av电影在线网| 91精品国产丝袜白色高跟鞋| 国产精品色眯眯| 免费在线看一区| 色婷婷综合中文久久一本| 精品久久人人做人人爱| 洋洋av久久久久久久一区| 国产伦精一区二区三区| 欧美军同video69gay| 国产精品人妖ts系列视频| 欧美aa在线视频| 91麻豆精品一区二区三区| 精品福利av导航| 丝袜美腿亚洲色图| 91在线视频网址| 日本一区二区在线不卡| 免费在线欧美视频| 欧美三级一区二区| 亚洲精品视频一区二区| 风流少妇一区二区| 精品国产一二三| 免费看日韩精品| 欧美人伦禁忌dvd放荡欲情| 国产精品美女久久福利网站| 极品美女销魂一区二区三区免费| 欧美午夜一区二区| 亚洲欧美色一区| 成人a级免费电影| 中文字幕第一区综合| 国产一区二区三区久久悠悠色av| 日韩欧美一级二级三级| 天天综合日日夜夜精品| 欧美三区免费完整视频在线观看| 亚洲久草在线视频| 色悠悠久久综合| 亚洲欧美一区二区三区久本道91| 成人性视频免费网站| 国产精品日韩成人| 99久久99久久久精品齐齐| 国产精品久久三区| 99精品一区二区三区| 亚洲免费在线视频| 色妞www精品视频| 亚洲精品欧美二区三区中文字幕| 99久久免费视频.com| 亚洲欧美日韩中文字幕一区二区三区 | 国产一区在线精品| 精品sm在线观看| 国产在线不卡视频| 久久精品亚洲乱码伦伦中文| 久久99蜜桃精品| 国产色产综合色产在线视频 | 亚洲欧洲另类国产综合| 99国产精品国产精品久久| 亚洲免费三区一区二区| 欧美日韩精品欧美日韩精品一综合| 午夜精品久久久久久久| 欧美大白屁股肥臀xxxxxx| 韩国女主播一区| 中文字幕一区二区三区在线不卡| 91免费观看在线| 日韩精品高清不卡| 久久精品欧美一区二区三区不卡 | 国产麻豆视频一区| 自拍偷拍国产精品| 91精品国产综合久久香蕉麻豆| 久久69国产一区二区蜜臀| 国产欧美精品国产国产专区| 99久久99精品久久久久久| 午夜精品123| 日本一区二区三区四区在线视频| 色哟哟欧美精品| 精品在线免费观看| 亚洲综合色在线| 久久网这里都是精品| 91麻豆产精品久久久久久| 青青草原综合久久大伊人精品 | 日本不卡高清视频| 国产精品久久午夜| 日韩久久久精品| 色老综合老女人久久久| 黑人巨大精品欧美黑白配亚洲| 亚洲天天做日日做天天谢日日欢| 日韩欧美一二区| 日本精品视频一区二区| 国产乱码精品一区二区三区五月婷| 亚洲欧美视频在线观看视频| 久久久久久久综合| 欧美色电影在线| 99热这里都是精品| 国产一区二区精品在线观看| 丝袜诱惑亚洲看片| 亚洲美女电影在线| 亚洲国产精品av| 久久精品一区二区三区四区| 欧美日韩国产高清一区二区| av中文字幕在线不卡| 国产一区二区三区电影在线观看| 性做久久久久久久免费看| 日韩理论片在线| 中文字幕av一区二区三区| 337p日本欧洲亚洲大胆精品 | 蜜臀av一区二区| 午夜视频在线观看一区二区| 一区二区视频免费在线观看| 中文字幕av一区二区三区免费看| 精品少妇一区二区三区在线视频 | 免费成人av资源网| 亚洲成人www| 亚洲午夜视频在线观看| 亚洲精品国产a| 亚洲精品老司机| 亚洲精品写真福利| 亚洲激情在线播放| 一区二区在线观看视频| 亚洲美女免费在线| 亚洲一级二级三级| 天堂午夜影视日韩欧美一区二区| 一区二区成人在线观看| 一区二区免费在线| 视频在线观看一区| 久久精品免费看| 国内外成人在线| 国产精品69毛片高清亚洲| 国产盗摄精品一区二区三区在线 | 中文字幕巨乱亚洲| 亚洲天堂福利av| 亚洲午夜国产一区99re久久| 亚洲高清一区二区三区| 日本午夜精品一区二区三区电影| 日韩av网站免费在线| 蜜桃一区二区三区在线| 国产在线视视频有精品| 成人高清免费在线播放| 欧美综合久久久| 欧美日韩午夜影院| 精品少妇一区二区三区视频免付费 | 国产精品久久久久影院| 亚洲天堂中文字幕| 亚洲成人av免费| 国内精品久久久久影院一蜜桃| 国产剧情一区二区| 91蜜桃免费观看视频| 欧美日韩久久久久久| 欧美大度的电影原声| 国产精品国产三级国产aⅴ原创| 亚洲色图色小说| 国产999精品久久| 色女孩综合影院| 亚洲精品一线二线三线| 亚洲精品美国一| 国产综合色在线视频区| 99re热视频精品| 日韩美女视频一区二区在线观看| 欧美国产综合色视频| 一区二区三区精品| 精品一区二区三区免费视频| 91视频国产观看| 精品少妇一区二区三区视频免付费 | 卡一卡二国产精品| 91视频国产观看| 精品国产髙清在线看国产毛片| 亚洲日本丝袜连裤袜办公室| 久久99在线观看|