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

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

?? btree.c

?? sqlite 3.3.8 支持加密的版本
?? C
?? 第 1 頁 / 共 5 頁
字號(hào):
  pPage->idxShift = 0;
  pPage->nCell = 0;
  pPage->isInit = 1;
  pageIntegrity(pPage);
}

/*
** Get a page from the pager.  Initialize the MemPage.pBt and
** MemPage.aData elements if needed.
*/
static int getPage(BtShared *pBt, Pgno pgno, MemPage **ppPage){
  int rc;
  unsigned char *aData;
  MemPage *pPage;
  rc = sqlite3pager_get(pBt->pPager, pgno, (void**)&aData);
  if( rc ) return rc;
  pPage = (MemPage*)&aData[pBt->pageSize];
  pPage->aData = aData;
  pPage->pBt = pBt;
  pPage->pgno = pgno;
  pPage->hdrOffset = pPage->pgno==1 ? 100 : 0;
  *ppPage = pPage;
  return SQLITE_OK;
}

/*
** Get a page from the pager and initialize it.  This routine
** is just a convenience wrapper around separate calls to
** getPage() and initPage().
*/
static int getAndInitPage(
  BtShared *pBt,          /* The database file */
  Pgno pgno,           /* Number of the page to get */
  MemPage **ppPage,    /* Write the page pointer here */
  MemPage *pParent     /* Parent of the page */
){
  int rc;
  if( pgno==0 ){
    return SQLITE_CORRUPT_BKPT; 
  }
  rc = getPage(pBt, pgno, ppPage);
  if( rc==SQLITE_OK && (*ppPage)->isInit==0 ){
    rc = initPage(*ppPage, pParent);
  }
  return rc;
}

/*
** Release a MemPage.  This should be called once for each prior
** call to getPage.
*/
static void releasePage(MemPage *pPage){
  if( pPage ){
    assert( pPage->aData );
    assert( pPage->pBt );
    assert( &pPage->aData[pPage->pBt->pageSize]==(unsigned char*)pPage );
    sqlite3pager_unref(pPage->aData);
  }
}

/*
** This routine is called when the reference count for a page
** reaches zero.  We need to unref the pParent pointer when that
** happens.
*/
static void pageDestructor(void *pData, int pageSize){
  MemPage *pPage;
  assert( (pageSize & 7)==0 );
  pPage = (MemPage*)&((char*)pData)[pageSize];
  if( pPage->pParent ){
    MemPage *pParent = pPage->pParent;
    pPage->pParent = 0;
    releasePage(pParent);
  }
  pPage->isInit = 0;
}

/*
** During a rollback, when the pager reloads information into the cache
** so that the cache is restored to its original state at the start of
** the transaction, for each page restored this routine is called.
**
** This routine needs to reset the extra data section at the end of the
** page to agree with the restored data.
*/
static void pageReinit(void *pData, int pageSize){
  MemPage *pPage;
  assert( (pageSize & 7)==0 );
  pPage = (MemPage*)&((char*)pData)[pageSize];
  if( pPage->isInit ){
    pPage->isInit = 0;
    initPage(pPage, pPage->pParent);
  }
}

/*
** Open a database file.
** 
** zFilename is the name of the database file.  If zFilename is NULL
** a new database with a random name is created.  This randomly named
** database file will be deleted when sqlite3BtreeClose() is called.
*/
int sqlite3BtreeOpen(
  const char *zFilename,  /* Name of the file containing the BTree database */
  sqlite3 *pSqlite,       /* Associated database handle */
  Btree **ppBtree,        /* Pointer to new Btree object written here */
  int flags               /* Options */
){
  BtShared *pBt;          /* Shared part of btree structure */
  Btree *p;               /* Handle to return */
  int rc;
  int nReserve;
  unsigned char zDbHeader[100];
#if !defined(SQLITE_OMIT_SHARED_CACHE) && !defined(SQLITE_OMIT_DISKIO)
  const ThreadData *pTsdro;
#endif

  /* Set the variable isMemdb to true for an in-memory database, or 
  ** false for a file-based database. This symbol is only required if
  ** either of the shared-data or autovacuum features are compiled 
  ** into the library.
  */
#if !defined(SQLITE_OMIT_SHARED_CACHE) || !defined(SQLITE_OMIT_AUTOVACUUM)
  #ifdef SQLITE_OMIT_MEMORYDB
    const int isMemdb = 0;
  #else
    const int isMemdb = zFilename && !strcmp(zFilename, ":memory:");
  #endif
#endif

  p = sqliteMalloc(sizeof(Btree));
  if( !p ){
    return SQLITE_NOMEM;
  }
  p->inTrans = TRANS_NONE;
  p->pSqlite = pSqlite;

  /* Try to find an existing Btree structure opened on zFilename. */
#if !defined(SQLITE_OMIT_SHARED_CACHE) && !defined(SQLITE_OMIT_DISKIO)
  pTsdro = sqlite3ThreadDataReadOnly();
  if( pTsdro->useSharedData && zFilename && !isMemdb ){
    char *zFullPathname = sqlite3OsFullPathname(zFilename);
    if( !zFullPathname ){
      sqliteFree(p);
      return SQLITE_NOMEM;
    }
    for(pBt=pTsdro->pBtree; pBt; pBt=pBt->pNext){
      assert( pBt->nRef>0 );
      if( 0==strcmp(zFullPathname, sqlite3pager_filename(pBt->pPager)) ){
        p->pBt = pBt;
        *ppBtree = p;
        pBt->nRef++;
        sqliteFree(zFullPathname);
        return SQLITE_OK;
      }
    }
    sqliteFree(zFullPathname);
  }
#endif

  /*
  ** The following asserts make sure that structures used by the btree are
  ** the right size.  This is to guard against size changes that result
  ** when compiling on a different architecture.
  */
  assert( sizeof(i64)==8 || sizeof(i64)==4 );
  assert( sizeof(u64)==8 || sizeof(u64)==4 );
  assert( sizeof(u32)==4 );
  assert( sizeof(u16)==2 );
  assert( sizeof(Pgno)==4 );

  pBt = sqliteMalloc( sizeof(*pBt) );
  if( pBt==0 ){
    *ppBtree = 0;
    sqliteFree(p);
    return SQLITE_NOMEM;
  }
  rc = sqlite3pager_open(&pBt->pPager, zFilename, EXTRA_SIZE, flags);
  if( rc!=SQLITE_OK ){
    if( pBt->pPager ) sqlite3pager_close(pBt->pPager);
    sqliteFree(pBt);
    sqliteFree(p);
    *ppBtree = 0;
    return rc;
  }
  p->pBt = pBt;

  sqlite3pager_set_destructor(pBt->pPager, pageDestructor);
  sqlite3pager_set_reiniter(pBt->pPager, pageReinit);
  pBt->pCursor = 0;
  pBt->pPage1 = 0;
  pBt->readOnly = sqlite3pager_isreadonly(pBt->pPager);
  sqlite3pager_read_fileheader(pBt->pPager, sizeof(zDbHeader), zDbHeader);
  pBt->pageSize = get2byte(&zDbHeader[16]);
  if( pBt->pageSize<512 || pBt->pageSize>SQLITE_MAX_PAGE_SIZE
       || ((pBt->pageSize-1)&pBt->pageSize)!=0 ){
    pBt->pageSize = SQLITE_DEFAULT_PAGE_SIZE;
    pBt->maxEmbedFrac = 64;   /* 25% */
    pBt->minEmbedFrac = 32;   /* 12.5% */
    pBt->minLeafFrac = 32;    /* 12.5% */
#ifndef SQLITE_OMIT_AUTOVACUUM
    /* If the magic name ":memory:" will create an in-memory database, then
    ** do not set the auto-vacuum flag, even if SQLITE_DEFAULT_AUTOVACUUM
    ** is true. On the other hand, if SQLITE_OMIT_MEMORYDB has been defined,
    ** then ":memory:" is just a regular file-name. Respect the auto-vacuum
    ** default in this case.
    */
    if( zFilename && !isMemdb ){
      pBt->autoVacuum = SQLITE_DEFAULT_AUTOVACUUM;
    }
#endif
    nReserve = 0;
  }else{
    nReserve = zDbHeader[20];
    pBt->maxEmbedFrac = zDbHeader[21];
    pBt->minEmbedFrac = zDbHeader[22];
    pBt->minLeafFrac = zDbHeader[23];
    pBt->pageSizeFixed = 1;
#ifndef SQLITE_OMIT_AUTOVACUUM
    pBt->autoVacuum = (get4byte(&zDbHeader[36 + 4*4])?1:0);
#endif
  }
  pBt->usableSize = pBt->pageSize - nReserve;
  assert( (pBt->pageSize & 7)==0 );  /* 8-byte alignment of pageSize */
  sqlite3pager_set_pagesize(pBt->pPager, pBt->pageSize);

#if !defined(SQLITE_OMIT_SHARED_CACHE) && !defined(SQLITE_OMIT_DISKIO)
  /* Add the new btree to the linked list starting at ThreadData.pBtree.
  ** There is no chance that a malloc() may fail inside of the 
  ** sqlite3ThreadData() call, as the ThreadData structure must have already
  ** been allocated for pTsdro->useSharedData to be non-zero.
  */
  if( pTsdro->useSharedData && zFilename && !isMemdb ){
    pBt->pNext = pTsdro->pBtree;
    sqlite3ThreadData()->pBtree = pBt;
  }
#endif
  pBt->nRef = 1;
  *ppBtree = p;
  return SQLITE_OK;
}

/*
** Close an open database and invalidate all cursors.
*/
int sqlite3BtreeClose(Btree *p){
  BtShared *pBt = p->pBt;
  BtCursor *pCur;

#ifndef SQLITE_OMIT_SHARED_CACHE
  ThreadData *pTsd;
#endif

  /* Close all cursors opened via this handle.  */
  pCur = pBt->pCursor;
  while( pCur ){
    BtCursor *pTmp = pCur;
    pCur = pCur->pNext;
    if( pTmp->pBtree==p ){
      sqlite3BtreeCloseCursor(pTmp);
    }
  }

  /* Rollback any active transaction and free the handle structure.
  ** The call to sqlite3BtreeRollback() drops any table-locks held by
  ** this handle.
  */
  sqlite3BtreeRollback(p);
  sqliteFree(p);

#ifndef SQLITE_OMIT_SHARED_CACHE
  /* If there are still other outstanding references to the shared-btree
  ** structure, return now. The remainder of this procedure cleans 
  ** up the shared-btree.
  */
  assert( pBt->nRef>0 );
  pBt->nRef--;
  if( pBt->nRef ){
    return SQLITE_OK;
  }

  /* Remove the shared-btree from the thread wide list. Call 
  ** ThreadDataReadOnly() and then cast away the const property of the 
  ** pointer to avoid allocating thread data if it is not really required.
  */
  pTsd = (ThreadData *)sqlite3ThreadDataReadOnly();
  if( pTsd->pBtree==pBt ){
    assert( pTsd==sqlite3ThreadData() );
    pTsd->pBtree = pBt->pNext;
  }else{
    BtShared *pPrev;
    for(pPrev=pTsd->pBtree; pPrev && pPrev->pNext!=pBt; pPrev=pPrev->pNext){}
    if( pPrev ){
      assert( pTsd==sqlite3ThreadData() );
      pPrev->pNext = pBt->pNext;
    }
  }
#endif

  /* Close the pager and free the shared-btree structure */
  assert( !pBt->pCursor );
  sqlite3pager_close(pBt->pPager);
  if( pBt->xFreeSchema && pBt->pSchema ){
    pBt->xFreeSchema(pBt->pSchema);
  }
  sqliteFree(pBt->pSchema);
  sqliteFree(pBt);
  return SQLITE_OK;
}

/*
** Change the busy handler callback function.
*/
int sqlite3BtreeSetBusyHandler(Btree *p, BusyHandler *pHandler){
  BtShared *pBt = p->pBt;
  pBt->pBusyHandler = pHandler;
  sqlite3pager_set_busyhandler(pBt->pPager, pHandler);
  return SQLITE_OK;
}

/*
** Change the limit on the number of pages allowed in the cache.
**
** The maximum number of cache pages is set to the absolute
** value of mxPage.  If mxPage is negative, the pager will
** operate asynchronously - it will not stop to do fsync()s
** to insure data is written to the disk surface before
** continuing.  Transactions still work if synchronous is off,
** and the database cannot be corrupted if this program
** crashes.  But if the operating system crashes or there is
** an abrupt power failure when synchronous is off, the database
** could be left in an inconsistent and unrecoverable state.
** Synchronous is on by default so database corruption is not
** normally a worry.
*/
int sqlite3BtreeSetCacheSize(Btree *p, int mxPage){
  BtShared *pBt = p->pBt;
  sqlite3pager_set_cachesize(pBt->pPager, mxPage);
  return SQLITE_OK;
}

/*
** Change the way data is synced to disk in order to increase or decrease
** how well the database resists damage due to OS crashes and power
** failures.  Level 1 is the same as asynchronous (no syncs() occur and
** there is a high probability of damage)  Level 2 is the default.  There
** is a very low but non-zero probability of damage.  Level 3 reduces the
** probability of damage to near zero but with a write performance reduction.
*/
#ifndef SQLITE_OMIT_PAGER_PRAGMAS
int sqlite3BtreeSetSafetyLevel(Btree *p, int level, int fullSync){
  BtShared *pBt = p->pBt;
  sqlite3pager_set_safety_level(pBt->pPager, level, fullSync);
  return SQLITE_OK;
}
#endif

/*
** Return TRUE if the given btree is set to safety level 1.  In other
** words, return TRUE if no sync() occurs on the disk files.
*/
int sqlite3BtreeSyncDisabled(Btree *p){
  BtShared *pBt = p->pBt;
  assert( pBt && pBt->pPager );
  return sqlite3pager_nosync(pBt->p

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一片黄亚洲嫩模| 亚洲特黄一级片| 日本va欧美va欧美va精品| www.性欧美| 国产精品嫩草99a| 成人开心网精品视频| 国产日韩v精品一区二区| 九九九精品视频| 日韩精品影音先锋| 美女www一区二区| 日韩免费视频线观看| 久久精品99国产国产精| 欧美成人性战久久| 国产一区二区三区精品欧美日韩一区二区三区 | 国产不卡视频在线观看| 精品国产一区二区三区av性色| 韩国成人精品a∨在线观看| 日本国产一区二区| 国产日产欧美一区二区视频| 国产福利一区二区三区视频在线| 精品国产乱码久久| 国产精品小仙女| 国产精品麻豆欧美日韩ww| 色哟哟国产精品| 亚洲成av人片一区二区梦乃| 欧美成人精品高清在线播放| 国产原创一区二区三区| 中文字幕制服丝袜成人av| 欧美视频一区二区在线观看| 国产一区二区在线影院| 最新中文字幕一区二区三区| 在线免费观看成人短视频| 蜜臀av一区二区在线观看| 国产婷婷精品av在线| 99久久综合狠狠综合久久| 五月天亚洲婷婷| 日韩欧美在线观看一区二区三区| 国产精品一区二区在线观看网站| 亚洲品质自拍视频| 精品日韩在线一区| 99国产精品国产精品毛片| 日本欧美一区二区| 亚洲欧洲日韩综合一区二区| 日韩视频一区二区在线观看| 99精品桃花视频在线观看| 蜜桃视频在线观看一区二区| 亚洲激情第一区| 国产无一区二区| 日韩欧美在线观看一区二区三区| 99国内精品久久| 国产一区二区三区在线观看精品 | 日韩美女视频一区二区| 欧美大片在线观看一区| 欧美色电影在线| 99国产精品国产精品久久| 国产精品夜夜嗨| 另类调教123区| 五月激情丁香一区二区三区| 一区二区三区日韩欧美| 国产精品毛片大码女人| 欧美极品aⅴ影院| 久久久影视传媒| 亚洲精品一区二区精华| 精品国产乱码久久久久久夜甘婷婷| 欧美日韩一卡二卡三卡| 欧美精品在线视频| 91精品国产综合久久蜜臀| 91精品国产免费| 日韩视频不卡中文| 精品少妇一区二区三区免费观看| 精品国产一区二区在线观看| 成人理论电影网| 国产成人在线视频网站| 国产黄色91视频| 北条麻妃一区二区三区| 91无套直看片红桃| 欧美三级电影在线看| 欧美一级在线观看| 久久免费偷拍视频| 中文字幕乱码久久午夜不卡| 樱花草国产18久久久久| 视频一区二区中文字幕| 国内久久婷婷综合| 丁香婷婷深情五月亚洲| 欧美中文字幕一区| 免费精品99久久国产综合精品| 国产精品美女久久久久aⅴ国产馆| 国产欧美日韩三级| 亚洲精品中文在线影院| 日日摸夜夜添夜夜添亚洲女人| 青青青伊人色综合久久| 成人性生交大片免费看中文网站| 91免费观看视频| 精品国产精品网麻豆系列| 成人免费小视频| 久久成人免费日本黄色| 99视频国产精品| 欧美成人激情免费网| 亚洲精品中文字幕乱码三区| 激情文学综合丁香| 欧美日韩不卡视频| 国产精品麻豆99久久久久久| 免费一级片91| 91久久线看在观草草青青| 亚洲精品一区在线观看| 亚洲一区二区三区精品在线| 国产成人精品1024| 欧美成人官网二区| 日本亚洲视频在线| 在线观看日韩电影| 自拍偷拍欧美精品| 国产精品996| 日韩天堂在线观看| 日韩影院在线观看| 欧美乱熟臀69xxxxxx| 一区二区欧美精品| 91麻豆免费在线观看| 中文成人av在线| 国产成人精品aa毛片| 国产日韩成人精品| 粉嫩aⅴ一区二区三区四区| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 色狠狠综合天天综合综合| 中文字幕一区二区三区不卡在线| 国产精品456露脸| 久久久久久久综合日本| 国产精品影音先锋| 欧美一区二区三区免费观看视频 | 亚洲福利电影网| 欧美色窝79yyyycom| 午夜国产精品一区| 欧美日韩一二三| 天天影视涩香欲综合网| 在线不卡一区二区| 奇米精品一区二区三区在线观看一 | 欧美综合天天夜夜久久| 亚洲一区二区欧美激情| 欧美乱熟臀69xxxxxx| 奇米777欧美一区二区| 精品视频一区二区三区免费| 日韩av不卡一区二区| 久久综合久久综合九色| 不卡一区二区三区四区| 亚洲一区在线视频观看| 日韩久久久精品| 99在线精品免费| 免费观看成人鲁鲁鲁鲁鲁视频| 2023国产精华国产精品| caoporm超碰国产精品| 午夜国产不卡在线观看视频| 国产日产欧产精品推荐色| 狠狠色综合播放一区二区| 日韩免费高清电影| www.色精品| 日本不卡一二三区黄网| 中文字幕亚洲欧美在线不卡| 91精品久久久久久久91蜜桃| 国产成人精品综合在线观看| 香蕉久久夜色精品国产使用方法| 精品乱人伦小说| 欧美日韩在线观看一区二区| 国产一区二区三区日韩| 亚洲va欧美va国产va天堂影院| 久久久久99精品一区| 欧美一区二区三区四区高清| av欧美精品.com| 国产盗摄一区二区三区| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产精品免费免费| 久久免费午夜影院| 欧美一区二区视频观看视频| 国产黄色成人av| 视频一区二区国产| 亚洲成人免费电影| 亚洲精品久久久蜜桃| 国产精品久久久久久久岛一牛影视 | 成人18视频在线播放| 国产成人aaaa| 国产东北露脸精品视频| 国产精品1024| 国产不卡在线一区| 成人91在线观看| 91丨九色丨国产丨porny| 91在线云播放| 欧美在线视频你懂得| 99re66热这里只有精品3直播| 懂色av一区二区在线播放| 成人夜色视频网站在线观看| 国产成人啪免费观看软件| 福利电影一区二区三区| 偷拍亚洲欧洲综合| 亚洲成人一区在线| 水蜜桃久久夜色精品一区的特点| 亚洲mv在线观看| 日本成人在线看| 国产a久久麻豆| 色综合天天做天天爱| 欧美三电影在线| 日韩欧美国产成人一区二区| 久久久久久久久久久电影|