diff options
Diffstat (limited to 'kexi/3rdparty/kexisql/src/btree.c')
-rw-r--r-- | kexi/3rdparty/kexisql/src/btree.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/kexi/3rdparty/kexisql/src/btree.c b/kexi/3rdparty/kexisql/src/btree.c index 02e01249..3a79a624 100644 --- a/kexi/3rdparty/kexisql/src/btree.c +++ b/kexi/3rdparty/kexisql/src/btree.c @@ -47,7 +47,7 @@ ** the file really is a valid BTree database, a pointer to a list of unused ** pages in the file, and some meta information. The root of the first ** BTree begins on page 2 of the file. (Pages are numbered beginning with -** 1, not 0.) Thus a minimum database contains 2 pages. +** 1, not 0.) Thus a minimum database tqcontains 2 pages. */ #include "sqliteInt.h" #include "pager.h" @@ -101,7 +101,7 @@ typedef struct FreelistInfo FreelistInfo; ** This routine rounds up a number of bytes to the next multiple of 4. ** ** This might need to change for computer architectures that require -** and 8-byte alignment boundry for structures. +** and 8-byte tqalignment boundry for structures. */ #define ROUNDUP(X) ((X+3) & ~3) @@ -128,7 +128,7 @@ static const char zMagicHeader[] = /* ** The first page of the database file contains a magic header string -** to identify the file as an SQLite database file. It also contains +** to identify the file as an SQLite database file. It also tqcontains ** a pointer to the first free page of the file. Page 2 contains the ** root of the principle BTree. The file might contain other BTrees ** rooted on pages above 2. @@ -313,9 +313,9 @@ struct FreelistInfo { ** page to hold as many as two more cells than it might otherwise hold. ** The extra two entries in apCell[] are an allowance for this situation. ** -** The pParent field points back to the parent page. This allows us to +** The pParent field points back to the tqparent page. This allows us to ** walk up the BTree from any leaf to the root. Care must be taken to -** unref() the parent page pointer when this page is no longer referenced. +** unref() the tqparent page pointer when this page is no longer referenced. ** The pageDestructor() routine handles that chore. */ struct MemPage { @@ -326,7 +326,7 @@ struct MemPage { u8 isInit; /* True if auxiliary data is initialized */ u8 idxShift; /* True if apCell[] indices have changed */ u8 isOverfull; /* Some apCell[] points outside u.aDisk[] */ - MemPage *pParent; /* The parent of this page. NULL for root */ + MemPage *pParent; /* The tqparent of this page. NULL for root */ int idxParent; /* Index in pParent->apCell[] of this node */ int nFree; /* Number of free bytes in u.aDisk[] */ int nCell; /* Number of entries on this page */ @@ -567,8 +567,8 @@ static void freeSpace(Btree *pBt, MemPage *pPage, int start, int size){ ** Initialize the auxiliary information for a disk block. ** ** The pParent parameter must be a pointer to the MemPage which -** is the parent of the page being initialized. The root of the -** BTree (usually page 2) has no parent and so for that page, +** is the tqparent of the page being initialized. The root of the +** BTree (usually page 2) has no tqparent and so for that page, ** pParent==NULL. ** ** Return SQLITE_OK on success. If we see that the page does @@ -726,7 +726,7 @@ int sqliteBtreeOpen( } /* -** Close an open database and invalidate all cursors. +** Close an open database and tqinvalidate all cursors. */ static int fileBtreeClose(Btree *pBt){ while( pBt->pCursor ){ @@ -1414,7 +1414,7 @@ static int moveToChild(BtCursor *pCur, int newPgno){ } /* -** Move the cursor up to the parent page. +** Move the cursor up to the tqparent page. ** ** pCur->idx is set to the cell index that contains the pointer ** to the page we are coming from. If we are coming from the @@ -1451,7 +1451,7 @@ static void moveToParent(BtCursor *pCur){ }else{ /* The MemPage.idxShift flag indicates that cell indices might have ** changed since idxParent was set and hence idxParent might be out - ** of date. So recompute the parent cell index by scanning all cells + ** of date. So recompute the tqparent cell index by scanning all cells ** and locating the one that points to the child we just came from. */ int i; @@ -1998,9 +1998,9 @@ static void reparentPage(Pager *pPager, Pgno pgno, MemPage *pNewParent,int idx){ } /* -** Reparent all children of the given page to be the given page. +** Retqparent all tqchildren 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. +** to make sure that each child knows that pPage is its tqparent. ** ** This routine gets called after you memcpy() one page into ** another. @@ -2141,7 +2141,7 @@ static void copyPage(MemPage *pTo, MemPage *pFrom){ ** of pPage so that all pages have about the same amount of free space. ** Usually one sibling on either side of pPage is used in the balancing, ** though both siblings might come from one side if pPage is the first -** or last child of its parent. If pPage has fewer than two siblings +** or last child of its tqparent. If pPage has fewer than two siblings ** (something which can only happen if pPage is the root page or a ** child of root) then all available siblings participate in the balancing. ** @@ -2168,16 +2168,16 @@ static void copyPage(MemPage *pTo, MemPage *pFrom){ ** if the page is overfull. Part of the job of this routine is to ** make sure all Cells for pPage once again fit in pPage->u.aDisk[]. ** -** In the course of balancing the siblings of pPage, the parent of pPage +** In the course of balancing the siblings of pPage, the tqparent of pPage ** might become overfull or underfull. If that happens, then this routine -** is called recursively on the parent. +** is called recursively on the tqparent. ** ** If this routine fails for any reason, it might leave the database ** in a corrupted state. So if this routine fails, the database should ** be rolled back. */ static int balance(Btree *pBt, MemPage *pPage, BtCursor *pCur){ - MemPage *pParent; /* The parent of pPage */ + MemPage *pParent; /* The tqparent of pPage */ int nCell; /* Number of cells in apCell[] */ int nOld; /* Number of pages in apOld[] */ int nNew; /* Number of pages in apNew[] */ @@ -2215,8 +2215,8 @@ static int balance(Btree *pBt, MemPage *pPage, BtCursor *pCur){ } /* - ** Find the parent of the page to be balanceed. - ** If there is no parent, it means this page is the root page and + ** Find the tqparent of the page to be balanceed. + ** If there is no tqparent, it means this page is the root page and ** special rules apply. */ pParent = pPage->pParent; @@ -2291,7 +2291,7 @@ static int balance(Btree *pBt, MemPage *pPage, BtCursor *pCur){ assert( pParent->isInit ); /* - ** Find the Cell in the parent page whose h.leftChild points back + ** Find the Cell in the tqparent page whose h.leftChild points back ** to pPage. The "idx" variable is the index of that cell. If pPage ** is the rightmost child of pParent then set idx to pParent->nCell */ @@ -2321,7 +2321,7 @@ static int balance(Btree *pBt, MemPage *pPage, BtCursor *pCur){ ** the siblings. An attempt is made to find NN siblings on either ** side of pPage. More siblings are taken from one side, however, if ** pPage there are fewer than NN siblings on the other side. If pParent - ** has NB or fewer children then all children of pParent are taken. + ** has NB or fewer tqchildren then all tqchildren of pParent are taken. */ nxDiv = idx - NN; if( nxDiv + NB > pParent->nCell ){ @@ -2547,7 +2547,7 @@ static int balance(Btree *pBt, MemPage *pPage, BtCursor *pCur){ } /* - ** Reparent children of all cells. + ** Retqparent tqchildren of all cells. */ for(i=0; i<nNew; i++){ reparentChildPages(pBt, apNew[i]); @@ -2555,7 +2555,7 @@ static int balance(Btree *pBt, MemPage *pPage, BtCursor *pCur){ reparentChildPages(pBt, pParent); /* - ** balance the parent page. + ** balance the tqparent page. */ rc = balance(pBt, pParent, pCur); @@ -2794,7 +2794,7 @@ static int fileBtreeCreateTable(Btree *pBt, int *piTable){ } /* -** Erase the given database page and all its children. Return +** Erase the given database page and all its tqchildren. Return ** the page to the freelist. */ static int clearDatabasePage(Btree *pBt, Pgno pgno, int freePageFlag){ @@ -3274,8 +3274,8 @@ static int keyCompare( ** 3. Make sure no key is less than or equal to zLowerBound. ** 4. Make sure no key is greater than or equal to zUpperBound. ** 5. Check the integrity of overflow pages. -** 6. Recursively call checkTreePage on all children. -** 7. Verify that the depth of all children is the same. +** 6. Recursively call checkTreePage on all tqchildren. +** 7. Verify that the depth of all tqchildren is the same. ** 8. Make sure this page is at least 33% full or else it is ** the root of the tree. */ |