Introduction
This is a collection of notes that describe the implementation of the Walnut mail reader. These notes are very incomplete.
See WalnutDoc.tioga for more information.
Modules
There are two main collection of modules. These are described by the DF files WallTapestry-Suite.df and WallTapestryKernel-Suite.df and their associated configs WalnutControl and WalnutKernel.
The system contains several layers of functionality. The following table lists the layers and their interfaces and exporters (again let me stress that this is incomplete). While I have tried to assign modules to layers such that components within a layer are independent, this is not entirely true. (There are several modules in Walnut that export and import the same interface!) Lower numbered layers are lower in the dependency chain, e.g. level 0 does not depend on anything in level 1. Level 1 (and 1.5) is in WalnutKernel while level 3 is in WalnutControl; level 2 is split between WalnutControl and WalnutKernel.
LEVEL 0:
Interface Exported by Purpose
LoganBerry LoganBerryImpl, etc. database storage and indexing
FS/PFS FSOnPFSImpl, etc. log storage
... ... ...
LEVEL 1:
Interface Exported by Purpose
WalnutStream WalnutStreamImpl deals with streams on log files
WalnutRoot WalnutRootImpl parses root file, transaction management
WalnutSchema WalnutOpsMiscImpl database schema definition
LEVEL 1.5:
Interface Exported by Purpose
WalnutLog WalnutLogImpl writes messages to log file
WalnutMiscLog WalnutLogImpl
WalnutLogExpunge WalnutLogExpungeImpl removes deleted messages from log
WalnutDB WalnutDBOpsImpl database operations
WalnutDBMsgImpl
WalnutDBMsgSetsImpl
LEVEL 2:
Interface Exported by Purpose
WalnutNewMail WalnutNewMailImpl reading new mail
WalnutOpsInternal WalnutOpsInternalImpl miscellaneous high-level ops
WalnutOps WalnutOpsImpl top-level operations
WalnutViewer WalnutViewerImpl viewer utilities
LEVEL 3:
Interface Exported by Purpose
WalnutInternal WalnutNotifierImpl a hodge-podge of operations
WalnutWindowMenuImpl
WalnutWindowInternalImpl
WalnutMsgSetButtonsImpl
WalnutMsgDisplayerImpl
WalnutMsgSetDisplayerImpl
WalnutPrintImpl
WalnutWindow WalnutNotifierImpl a hodge-podge of operations
WalnutWindowCommandsImpl
WalnutWindowInternalImpl
WalnutWindowMenuImpl
WalnutMsgDisplayerImpl
WalnutMsgSetDisplayerImpl
WalnutMsgSetButtonsImpl
WalnutPrintImpl
LoganWalnutImpl
WallabyImpl
WalnutWindowSidedoor WalnutMsgSetButtonsImpl more hodge-podge
WalnutWindowCommandsImpl
LoganWalnut LoganWalnutImpl database entry conversions
Wallaby WallabyImpl message browser
See WalnutCatalog.tioga for a listing of which procedures are exported by which modules.
Using logs
Walnut writes an operation log that keeps track off all notable events. This log contains operations like creating message sets, moving messages between sets, etc. It also contains the text of all messages. For reliablity reasons the log is append-only. The expunge operation writes a new log that contains all of the messages that have not been deleted.
Walnut also maintains a database that indexes information that is in the log. The database is used to enumerate message sets and such. The database can always be completely recovered by scavenging the log.
Browsing messages (Wallaby)
Implemented in: LoganWalnut.mesa, LoganWalnutImpl.mesa, Wallaby.mesa, WallabyImpl.mesa.
What happens when a user clicks "Query" in the Walnut control window?
Calls Wallaby.QueryProc
Creates new LoganBerryBrowser.ToolBody
Calls LoganBerry.Open[NIL, wH.opsH.dbName]
Calls LoganBerryBrowser.CreateTool
What happens when a user clicks "Browse" in the Wallaby browser?
Calls WallabyImpl.BrowseProc
Calls DoBrowseProc
Calls BrowseBody
Calls LoganBerryBrowser.ReadEntryForm
Calls LoganQuery.QueryEntries to get query plan (ignores cursor)
Calls LoganBerryBrowser.ReportFeedback
Calls GenerateWalnutEntries
Calls LoganWalnut.GenerateEntriesPlusDate
Calls WalnutOps.GenerateEntriesPlusDate
Calls WalnutDBMsgImpl.GenerateEntriesPlusDate
Calls LoganBerry.GenerateEntries
Builds and returns a LoganBerry.Cursor
Builds and returns a LoganQuery.ComplexCursor
Builds up filters by calling LoganQuery.FilterEntries
Reports "Query in Progress"
Retrieves allmatching entries by calling LoganQuery.NextEntry
Reports "Query Finished"
Changes made for PCedar/Tapestry
Removed dependencies on Alpine and Cypress.
Changed parsing code that looked for \n to check for either '\r or '\l.
Changed names of temp files.
Removed LoganWalnut and private bound in copy of LoganQuery and LoganBerryBrowser.