Man more

From LSWiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 16:54, 11 June 2007 (edit)
Laine (Talk | contribs)

← Previous diff
Current revision (16:54, 11 June 2007) (edit)
Laine (Talk | contribs)

 

Current revision

Contents

Files

/def/descriptor/more.c
/lib/descriptors/more.h
/daemon/more.c
/mod/basic/term.c
/lib/display.h

Description

More descriptors (also known as more session descriptors) are used to contain the information associated with a 'more' (paginated) display, as handled by the more daemon. Usually you do not need to worry about this level of the system at all; the standard way to display paginated text is simply as follows:

   who->display(text, Display_Paginated);

If you wished to display a paginated file, the method would be:

   who->display(file, Display_File | Display_Paginated);

If these methods are not adequate for some reason, however, you can custom-build more sessions and pass them directly to the more daemon, as in the following example:

   Daemon("more")->more(More(([
       More_Type    : More_Type_Text,
       More_Content : some_text,
       More_User    : this_player(),
   ])));

The method based on the display() function should be preferred whenever possible. Manual construction is mostly useful for situations where you will be adding multiple more sessions simultaneously.

The public fields of the more descriptor are for users to specify the settings of more sessions. The internal fields are used by the more process to store information about the state of the session, and should not be interacted with by user code.

Public Fields

More_Type: The type of content in the more session. This is one of the following:

   More_Type_File: A file.  The More_Content field should contain the
   filename.
   More_Type_Text: An arbitrary string.  The More_Content field should
   contains the string.
   More_Type_Processed: Text which has already been processed through
   the terminal interpretation system.  This is intended solely for
   system use; there is no need whatsoever for users to construct more
   sessions of this type.  The More_Content is an array of the processed
   content.

More_Content: The content to be displayed by the more session, as determined by the More_Type field.

More_User: The user object for the more session. Required.

More_Header: A header to show at the top of each page of the more display. May be a closure, which will be called with the user as argument; the closure must always return the same number of lines, or incorrect behavior will result.

More_Footer: A footer to show at the bottom of each page of the more display. May be a closure, which will be called with the user as argument; the closure must always return the same number of lines, or incorrect behavior will result.

More_Done: A closure to call when the user exits all more sessions. The user will be passed as argument. Note that if more than one of the sessions specified for a given user at a given time has a More_Done setting, only the More_Done of the most recently added session to define one will be called.

More_Display: The display flags (from /lib/display.h) that will be applied to the terminal processing of the text. Defaults to Display_Default; there is no need to specify Display_Paginated or Display_File, as these are handled implicitly.

More_Lines: The total number of lines in the display. Only system-internal More_Type_Processed sessions need to specify this field.

More_File: The filename the session is from, if any. Only system-internal More_Type_Processed sessions need to specify this field. More_Type_File sessions automatically set this field to the value of More_Content.

Internal Fields

More_Rows: The number of rows to paginate with.

More_Columns: The number of columns to paginate with.

More_Tabs: The tab stop interval to paginate with.

More_Line: The current line within the display.

More_Pages: The pagination information for the display.

More_Page: The current page number within the display.

More_Source: The string object name of the object that passed the more session to the daemon.

More_Tag: The tag value for the descriptor system.

See Also

display(lfun), descriptors(mechanisms)

Personal tools