-- File: DBIndexPage.mesa
-- Purpose: Maintains DBIndex.Page records for database pages. Keeps a list of currently
-- active DBIndex.Pages, which acts as a cache for frequently accessed pages.
-- Last edited by:
-- Suzuki: 2-Apr-81 16:09:21
-- Cattell: September 21, 1982 9:23 pm

DIRECTORY
DBCommon USING[DBPage],
DBIndex USING [Core, Page, RealIndexHandle];

DBIndexPage: DEFINITIONS =
BEGIN

BadPage: SIGNAL; -- if page is not a B-Tree page

DestroyPageList: PROC;
-- Frees the list of page records (DBIndex.Pages) that DBIndexPage maintains

DestroyPage: PROC [segment: DBCommon.DBPage, p: DBIndex.Page, db: DBCommon.DBPage];
-- Unlock the page and de-allocate the page in the database for re-use.

UnlockPage: PROC [p: DBIndex.Page];
-- Should be called when the client no longer has pointers into page and p thrown away

WritePage: PROC [p: DBIndex.Page];
-- Mark page p as having been modified, but keep locked.

WriteAndUnlockPage: PROC [p: DBIndex.Page];
-- Call when page no longer in use, and page has been modified.

CreateEmptyPage: PROC [tree: DBIndex.RealIndexHandle, level: CARDINAL, s: DBCommon.DBPage]
RETURNS [DBIndex.Page];
-- Allocates a new DBCommon.DBPage with associated DBIndex.Page, level = 1 if it is a leaf

GetPage: PROC [
tree: DBIndex.RealIndexHandle, db: DBCommon.DBPage, level: CARDINAL] RETURNS [DBIndex.Page];
-- Makes DBIndex.Page pointing to given DBCommon.DBPage.

CheckTag: PROC[LONG POINTER TO DBIndex.Core];

END.

Change Log

By Cattell September 22, 1982 12:57 pm: Changed names to be clearer. Use UnlockPage instead of FreePage, GetPage instead of CreateOldPage, etc.