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

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

?? btree.c

?? 這是一個嵌入式系統上運行的輕量級數據庫
?? C
?? 第 1 頁 / 共 5 頁
字號:
  pP1 = pBt->page1;  rc = sqlitepager_write(pBt->page1);  if( rc ) return rc;  rc = sqlitepager_get(pBt->pPager, 2, (void**)&pRoot);  if( rc ) return rc;  rc = sqlitepager_write(pRoot);  if( rc ){    sqlitepager_unref(pRoot);    return rc;  }  strcpy(pP1->zMagic, zMagicHeader);  if( btree_native_byte_order ){    pP1->iMagic = MAGIC;    pBt->needSwab = 0;  }else{    pP1->iMagic = swab32(MAGIC);    pBt->needSwab = 1;  }  zeroPage(pBt, pRoot);  sqlitepager_unref(pRoot);  return SQLITE_OK;}/*** Attempt to start a new transaction.**** A transaction must be started before attempting any changes** to the database.  None of the following routines will work** unless a transaction is started first:****      sqliteBtreeCreateTable()**      sqliteBtreeCreateIndex()**      sqliteBtreeClearTable()**      sqliteBtreeDropTable()**      sqliteBtreeInsert()**      sqliteBtreeDelete()**      sqliteBtreeUpdateMeta()*/static int fileBtreeBeginTrans(Btree *pBt){  int rc;  if( pBt->inTrans ) return SQLITE_ERROR;  if( pBt->readOnly ) return SQLITE_READONLY;  if( pBt->page1==0 ){    rc = lockBtree(pBt);    if( rc!=SQLITE_OK ){      return rc;    }  }  rc = sqlitepager_begin(pBt->page1);  if( rc==SQLITE_OK ){    rc = newDatabase(pBt);  }  if( rc==SQLITE_OK ){    pBt->inTrans = 1;    pBt->inCkpt = 0;  }else{    unlockBtreeIfUnused(pBt);  }  return rc;}/*** Commit the transaction currently in progress.**** This will release the write lock on the database file.  If there** are no active cursors, it also releases the read lock.*/static int fileBtreeCommit(Btree *pBt){  int rc;  rc = pBt->readOnly ? SQLITE_OK : sqlitepager_commit(pBt->pPager);  pBt->inTrans = 0;  pBt->inCkpt = 0;  unlockBtreeIfUnused(pBt);  return rc;}/*** Rollback the transaction in progress.  All cursors will be** invalided by this operation.  Any attempt to use a cursor** that was open at the beginning of this operation will result** in an error.**** This will release the write lock on the database file.  If there** are no active cursors, it also releases the read lock.*/static int fileBtreeRollback(Btree *pBt){  int rc;  BtCursor *pCur;  if( pBt->inTrans==0 ) return SQLITE_OK;  pBt->inTrans = 0;  pBt->inCkpt = 0;  rc = pBt->readOnly ? SQLITE_OK : sqlitepager_rollback(pBt->pPager);  for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){    if( pCur->pPage && pCur->pPage->isInit==0 ){      sqlitepager_unref(pCur->pPage);      pCur->pPage = 0;    }  }  unlockBtreeIfUnused(pBt);  return rc;}/*** Set the checkpoint for the current transaction.  The checkpoint serves** as a sub-transaction that can be rolled back independently of the** main transaction.  You must start a transaction before starting a** checkpoint.  The checkpoint is ended automatically if the transaction** commits or rolls back.**** Only one checkpoint may be active at a time.  It is an error to try** to start a new checkpoint if another checkpoint is already active.*/static int fileBtreeBeginCkpt(Btree *pBt){  int rc;  if( !pBt->inTrans || pBt->inCkpt ){    return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR;  }  rc = pBt->readOnly ? SQLITE_OK : sqlitepager_ckpt_begin(pBt->pPager);  pBt->inCkpt = 1;  return rc;}/*** Commit a checkpoint to transaction currently in progress.  If no** checkpoint is active, this is a no-op.*/static int fileBtreeCommitCkpt(Btree *pBt){  int rc;  if( pBt->inCkpt && !pBt->readOnly ){    rc = sqlitepager_ckpt_commit(pBt->pPager);  }else{    rc = SQLITE_OK;  }  pBt->inCkpt = 0;  return rc;}/*** Rollback the checkpoint to the current transaction.  If there** is no active checkpoint or transaction, this routine is a no-op.**** All cursors will be invalided by this operation.  Any attempt** to use a cursor that was open at the beginning of this operation** will result in an error.*/static int fileBtreeRollbackCkpt(Btree *pBt){  int rc;  BtCursor *pCur;  if( pBt->inCkpt==0 || pBt->readOnly ) return SQLITE_OK;  rc = sqlitepager_ckpt_rollback(pBt->pPager);  for(pCur=pBt->pCursor; pCur; pCur=pCur->pNext){    if( pCur->pPage && pCur->pPage->isInit==0 ){      sqlitepager_unref(pCur->pPage);      pCur->pPage = 0;    }  }  pBt->inCkpt = 0;  return rc;}/*** Create a new cursor for the BTree whose root is on the page** iTable.  The act of acquiring a cursor gets a read lock on ** the database file.**** If wrFlag==0, then the cursor can only be used for reading.** If wrFlag==1, then the cursor can be used for reading or for** writing if other conditions for writing are also met.  These** are the conditions that must be met in order for writing to** be allowed:**** 1:  The cursor must have been opened with wrFlag==1**** 2:  No other cursors may be open with wrFlag==0 on the same table**** 3:  The database must be writable (not on read-only media)**** 4:  There must be an active transaction.**** Condition 2 warrants further discussion.  If any cursor is opened** on a table with wrFlag==0, that prevents all other cursors from** writing to that table.  This is a kind of "read-lock".  When a cursor** is opened with wrFlag==0 it is guaranteed that the table will not** change as long as the cursor is open.  This allows the cursor to** do a sequential scan of the table without having to worry about** entries being inserted or deleted during the scan.  Cursors should** be opened with wrFlag==0 only if this read-lock property is needed.** That is to say, cursors should be opened with wrFlag==0 only if they** intend to use the sqliteBtreeNext() system call.  All other cursors** should be opened with wrFlag==1 even if they never really intend** to write.** ** No checking is done to make sure that page iTable really is the** root page of a b-tree.  If it is not, then the cursor acquired** will not work correctly.*/static int fileBtreeCursor(Btree *pBt, int iTable, int wrFlag, BtCursor **ppCur){  int rc;  BtCursor *pCur, *pRing;  if( pBt->readOnly && wrFlag ){    *ppCur = 0;    return SQLITE_READONLY;  }  if( pBt->page1==0 ){    rc = lockBtree(pBt);    if( rc!=SQLITE_OK ){      *ppCur = 0;      return rc;    }  }  pCur = sqliteMalloc( sizeof(*pCur) );  if( pCur==0 ){    rc = SQLITE_NOMEM;    goto create_cursor_exception;  }  pCur->pgnoRoot = (Pgno)iTable;  rc = sqlitepager_get(pBt->pPager, pCur->pgnoRoot, (void**)&pCur->pPage);  if( rc!=SQLITE_OK ){    goto create_cursor_exception;  }  rc = initPage(pBt, pCur->pPage, pCur->pgnoRoot, 0);  if( rc!=SQLITE_OK ){    goto create_cursor_exception;  }  pCur->pOps = &sqliteBtreeCursorOps;  pCur->pBt = pBt;  pCur->wrFlag = wrFlag;  pCur->idx = 0;  pCur->eSkip = SKIP_INVALID;  pCur->pNext = pBt->pCursor;  if( pCur->pNext ){    pCur->pNext->pPrev = pCur;  }  pCur->pPrev = 0;  pRing = pBt->pCursor;  while( pRing && pRing->pgnoRoot!=pCur->pgnoRoot ){ pRing = pRing->pNext; }  if( pRing ){    pCur->pShared = pRing->pShared;    pRing->pShared = pCur;  }else{    pCur->pShared = pCur;  }  pBt->pCursor = pCur;  *ppCur = pCur;  return SQLITE_OK;create_cursor_exception:  *ppCur = 0;  if( pCur ){    if( pCur->pPage ) sqlitepager_unref(pCur->pPage);    sqliteFree(pCur);  }  unlockBtreeIfUnused(pBt);  return rc;}/*** Close a cursor.  The read lock on the database file is released** when the last cursor is closed.*/static int fileBtreeCloseCursor(BtCursor *pCur){  Btree *pBt = pCur->pBt;  if( pCur->pPrev ){    pCur->pPrev->pNext = pCur->pNext;  }else{    pBt->pCursor = pCur->pNext;  }  if( pCur->pNext ){    pCur->pNext->pPrev = pCur->pPrev;  }  if( pCur->pPage ){    sqlitepager_unref(pCur->pPage);  }  if( pCur->pShared!=pCur ){    BtCursor *pRing = pCur->pShared;    while( pRing->pShared!=pCur ){ pRing = pRing->pShared; }    pRing->pShared = pCur->pShared;  }  unlockBtreeIfUnused(pBt);  sqliteFree(pCur);  return SQLITE_OK;}/*** Make a temporary cursor by filling in the fields of pTempCur.** The temporary cursor is not on the cursor list for the Btree.*/static void getTempCursor(BtCursor *pCur, BtCursor *pTempCur){  memcpy(pTempCur, pCur, sizeof(*pCur));  pTempCur->pNext = 0;  pTempCur->pPrev = 0;  if( pTempCur->pPage ){    sqlitepager_ref(pTempCur->pPage);  }}/*** Delete a temporary cursor such as was made by the CreateTemporaryCursor()** function above.*/static void releaseTempCursor(BtCursor *pCur){  if( pCur->pPage ){    sqlitepager_unref(pCur->pPage);  }}/*** Set *pSize to the number of bytes of key in the entry the** cursor currently points to.  Always return SQLITE_OK.** Failure is not possible.  If the cursor is not currently** pointing to an entry (which can happen, for example, if** the database is empty) then *pSize is set to 0.*/static int fileBtreeKeySize(BtCursor *pCur, int *pSize){  Cell *pCell;  MemPage *pPage;  pPage = pCur->pPage;  assert( pPage!=0 );  if( pCur->idx >= pPage->nCell ){    *pSize = 0;  }else{    pCell = pPage->apCell[pCur->idx];    *pSize = NKEY(pCur->pBt, pCell->h);  }  return SQLITE_OK;}/*** Read payload information from the entry that the pCur cursor is** pointing to.  Begin reading the payload at "offset" and read** a total of "amt" bytes.  Put the result in zBuf.**** This routine does not make a distinction between key and data.** It just reads bytes from the payload area.*/static int getPayload(BtCursor *pCur, int offset, int amt, char *zBuf){  char *aPayload;  Pgno nextPage;  int rc;  Btree *pBt = pCur->pBt;  assert( pCur!=0 && pCur->pPage!=0 );  assert( pCur->idx>=0 && pCur->idx<pCur->pPage->nCell );  aPayload = pCur->pPage->apCell[pCur->idx]->aPayload;  if( offset<MX_LOCAL_PAYLOAD ){    int a = amt;    if( a+offset>MX_LOCAL_PAYLOAD ){      a = MX_LOCAL_PAYLOAD - offset;    }    memcpy(zBuf, &aPayload[offset], a);    if( a==amt ){      return SQLITE_OK;    }    offset = 0;    zBuf += a;    amt -= a;  }else{    offset -= MX_LOCAL_PAYLOAD;  }  if( amt>0 ){    nextPage = SWAB32(pBt, pCur->pPage->apCell[pCur->idx]->ovfl);  }  while( amt>0 && nextPage ){    OverflowPage *pOvfl;    rc = sqlitepager_get(pBt->pPager, nextPage, (void**)&pOvfl);    if( rc!=0 ){      return rc;    }    nextPage = SWAB32(pBt, pOvfl->iNext);    if( offset<OVERFLOW_SIZE ){      int a = amt;      if( a + offset > OVERFLOW_SIZE ){        a = OVERFLOW_SIZE - offset;      }      memcpy(zBuf, &pOvfl->aPayload[offset], a);      offset = 0;      amt -= a;      zBuf += a;    }else{      offset -= OVERFLOW_SIZE;    }    sqlitepager_unref(pOvfl);  }  if( amt>0 ){    return SQLITE_CORRUPT;  }  return SQLITE_OK;}/*** Read part of the key associated with cursor pCur.  A maximum** of "amt" bytes will be transfered into zBuf[].  The transfer** begins at "offset".  The number of bytes actually read is** returned. **** Change:  It used to be that the amount returned will be smaller** than the amount requested if there are not enough bytes in the key** to satisfy the request.  But now, it must be the case that there** is enough data available to satisfy the request.  If not, an exception** is raised.  The change was made in an effort to boost performance** by eliminating unneeded tests.*/static int fileBtreeKey(BtCursor *pCur, int offset, int amt, char *zBuf){  MemPage *pPage;  assert( amt>=0 );  assert( offset>=0 );  assert( pCur->pPage!=0 );  pPage = pCur->pPage;  if( pCur->idx >= pPage->nCell ){    return 0;  }  assert( amt+offset <= NKEY(pCur->pBt, pPage->apCell[pCur->idx]->h) );  getPayload(pCur, offset, amt, zBuf);  return amt;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品高清在线观看| 狠狠狠色丁香婷婷综合久久五月| 日本免费新一区视频| 粉嫩av亚洲一区二区图片| 欧美猛男超大videosgay| 久久精品日韩一区二区三区| 亚洲国产成人tv| 成人激情综合网站| 久久综合九色综合久久久精品综合 | 精品久久久久av影院| 亚洲精品老司机| 成人毛片在线观看| 精品国产免费人成在线观看| 午夜国产不卡在线观看视频| 99久久综合国产精品| 久久网站热最新地址| 久久成人免费电影| 欧美一区二区三区在线观看视频| 亚洲午夜精品网| 91黄色免费观看| 亚洲天堂网中文字| 波多野结衣的一区二区三区| 久久久久久久久久久久电影| 精品一区中文字幕| 欧美一区在线视频| 日韩av午夜在线观看| 欧美日韩情趣电影| 亚洲国产精品影院| 欧美日韩一级二级三级| 一区二区三区在线观看动漫| 91在线视频免费观看| 国产精品国产三级国产专播品爱网| 国产盗摄一区二区| 国产欧美视频一区二区三区| 国产成人免费视频| 日本一区二区高清| 成人18视频日本| 1区2区3区欧美| 色综合婷婷久久| 亚洲欧美一区二区三区孕妇| 一本大道久久a久久精二百| 自拍偷自拍亚洲精品播放| 久久影音资源网| 韩国精品在线观看| 欧美经典三级视频一区二区三区| 国产99久久久久久免费看农村| 国产欧美一区二区精品忘忧草| 成人h动漫精品一区二| 亚洲精品视频自拍| 欧美日韩在线三级| 久久99精品久久久久久| 久久久久久久电影| 色婷婷精品久久二区二区蜜臂av | 亚洲福利电影网| 7777精品伊人久久久大香线蕉超级流畅 | 欧美性大战久久| 亚洲成人一区二区| 日韩欧美中文字幕公布| 国产suv精品一区二区三区| 最近中文字幕一区二区三区| 欧美丝袜第三区| 黄网站免费久久| 中文字幕中文字幕在线一区 | 久久99在线观看| 国产精品美女视频| 欧美日韩一区二区在线视频| 精品一区精品二区高清| 国产精品成人免费在线| 3d动漫精品啪啪一区二区竹菊| 狠狠色狠狠色合久久伊人| 亚洲视频在线观看三级| 日韩一区二区三区视频在线观看 | 国产亚洲欧美一区在线观看| 91免费看视频| 国产自产高清不卡| 一区二区视频免费在线观看| 精品日韩99亚洲| 91国产成人在线| 国产999精品久久久久久| 亚洲妇女屁股眼交7| 中文一区二区完整视频在线观看| 欧美日韩一区小说| 99久久亚洲一区二区三区青草| 日韩电影在线一区| 麻豆成人av在线| 一级特黄大欧美久久久| 久久精品人人做人人爽97| 欧美高清dvd| 一本色道久久综合狠狠躁的推荐| 国产最新精品精品你懂的| 天天操天天干天天综合网| 亚洲欧美一区二区在线观看| 久久久亚洲欧洲日产国码αv| 欧美群妇大交群中文字幕| 91视频观看视频| 丰满亚洲少妇av| 精品亚洲porn| 美国十次综合导航| 日韩黄色免费网站| 亚洲无人区一区| 亚洲乱码国产乱码精品精小说| 国产亲近乱来精品视频| 精品久久久久久久久久久久久久久久久| 欧美三级日韩三级| 欧美在线小视频| 91官网在线观看| 91久久久免费一区二区| 91色婷婷久久久久合中文| www.日韩在线| 99久久99久久精品免费观看| 国产99一区视频免费| 国产成人av资源| 国产成人亚洲综合a∨婷婷| 国内精品写真在线观看| 精品在线你懂的| 国产资源精品在线观看| 国产美女在线精品| 国产成人午夜99999| 福利一区二区在线| 91.成人天堂一区| 91精品在线观看入口| 欧美一区二区三区婷婷月色| 日韩一区二区在线观看视频播放| 欧美一区二区三区公司| 日韩视频国产视频| 国产婷婷色一区二区三区| 国产人久久人人人人爽| 国产精品伦理在线| 亚洲欧美偷拍卡通变态| 一区二区三区精品| 首页国产丝袜综合| 激情小说欧美图片| 国产福利一区二区三区视频| av一区二区三区| 欧美亚洲综合网| 欧美一区二区三区免费视频| 久久夜色精品国产噜噜av| 国产欧美一区二区精品忘忧草| 亚洲欧美日韩国产另类专区| 亚洲一区二区偷拍精品| 久久精品国产99久久6| 成人教育av在线| 欧美三级一区二区| 久久婷婷国产综合精品青草| 国产精品久久久久久久久免费桃花| 悠悠色在线精品| 久久精品99国产精品| av在线这里只有精品| 欧美色偷偷大香| 久久久www成人免费毛片麻豆| 亚洲三级电影全部在线观看高清| 偷拍亚洲欧洲综合| 成人一区二区在线观看| 欧美日韩国产一区| 国产欧美日韩视频在线观看| 亚洲国产毛片aaaaa无费看| 精品一二三四区| 色94色欧美sute亚洲线路二 | 秋霞电影一区二区| 日韩一本二本av| 国产欧美日韩精品a在线观看| 亚洲免费大片在线观看| 久久精品72免费观看| 色综合天天综合在线视频| 337p日本欧洲亚洲大胆精品| 一区二区欧美国产| 丰满白嫩尤物一区二区| 91精品国产色综合久久久蜜香臀| 中文字幕一区二区三区在线不卡| 日韩av一区二| 欧美少妇性性性| 国产精品视频在线看| 久草精品在线观看| 欧美日韩国产综合草草| 中文字幕在线不卡国产视频| 激情综合色丁香一区二区| 欧美视频精品在线观看| 一区在线观看免费| 国产精品一级片在线观看| 欧美精品粉嫩高潮一区二区| 亚洲丝袜美腿综合| 成人黄色电影在线| 国产视频一区在线播放| 美腿丝袜亚洲色图| 91精品国产全国免费观看| 夜夜爽夜夜爽精品视频| 91在线精品一区二区| 国产精品午夜电影| 国产精品亚洲一区二区三区妖精| 欧美va亚洲va香蕉在线| 日韩av中文在线观看| 欧美精品久久99| 亚洲电影第三页| 欧美三级日韩在线| 亚欧色一区w666天堂| 欧美日韩中文字幕精品| 亚洲mv在线观看| 欧美精品1区2区| 男男成人高潮片免费网站| 中文无字幕一区二区三区|