summaryrefslogtreecommitdiff
path: root/usr.bin/vi/docs/internals/structures
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/vi/docs/internals/structures')
-rw-r--r--usr.bin/vi/docs/internals/structures63
1 files changed, 35 insertions, 28 deletions
diff --git a/usr.bin/vi/docs/internals/structures b/usr.bin/vi/docs/internals/structures
index d49ab65cbee..a25c780c8e6 100644
--- a/usr.bin/vi/docs/internals/structures
+++ b/usr.bin/vi/docs/internals/structures
@@ -1,32 +1,35 @@
-# @(#)structures 5.2 (Berkeley) 11/1/93
+# @(#)structures 5.4 (Berkeley) 10/4/95
-There are three major data structures in this package. The first is a
-single global structure (named GS) which contains information common to
-all files and screens. It's really pretty tiny, and functions more as a
-single place to hang things than anything else.
+There are three major data structures in this package, plus a single data
+structure per screen type. The first is a single global structure (GS)
+which contains information common to all files and screens. It hold
+global things like the input key queues, and functions as a single place
+to hang things. For example, interrupt routines have to be able to find
+screen structures, and they can only do this if they have a starting
+point. The number of globals in nvi is dependent on the screen type, but
+every screen type will have at least one global, __global_list, which
+references the GS structure.
-The second and third structures are the file structures (named EXF) and
-the screen structures (named SCR). They contain information theoretically
-unique to a screen or file, respectively. Each SCR structure has a set
-of functions which update the screen and/or return information about the
-screen from the underlying screen package.
+The GS structure contains linked lists of screen (SCR) structures.
+Each SCR structure normally references a file (EXF) structure.
-The GS structure contains linked lists SCR structures. The structures
-can also be classed by persistence. The GS structure never goes away
-and the SCR structure persists over instances of files.
+The GS structure has a set of functions which update the screen and/or
+return information about the screen from the underlying screen package.
+The GS structure never goes away. The SCR structure persists over
+instances of screens, and the EXF structure persists over references to
+files.
File names have different properties than files themselves, so the name
information for a file is held in an FREF structure which is chained from
the SCR structure.
-In general, functions are always passed an SCR structure and often an EXF
-structure as well. The SCR structure is necessary for any routine that
-wishes to talk to the screen, the EXF structure is necessary for any
-routine that wants to modify the file. The relationship between an SCR
-structure and its underlying EXF structure is not fixed, and although you
-can translate from an SCR to the underlying EXF, it is discouraged. If
-this becomes too onerous, I suspect I'll just stop passing around the EXF
-in the future.
+In general, functions are always passed an SCR structure, which usually
+references an underlying EXF structure. The SCR structure is necessary
+for any routine that wishes to talk to the screen, the EXF structure is
+necessary for any routine that wants to modify the file. The relationship
+between an SCR structure and its underlying EXF structure is not fixed,
+and various ex commands will substitute a new EXF in place of the current
+one, and there's no way to detect this.
The naming of the structures is consistent across the program. (Macros
even depend on it, so don't try and change it!) The global structure is
@@ -41,6 +44,9 @@ TEXT In nvi/cut.h. This structure describes a portion of a line,
CB In nvi/cut.h. A cut buffer. A cut buffer is a place to
hang a list of TEXT structures.
+CL The curses screen private data structure. Everything to
+ do standalone curses screens.
+
MARK In nvi/mark.h. A cursor position, consisting of a line number
and a column number.
@@ -48,14 +54,15 @@ MSG In nvi/msg.h. A chain of messages for the user.
SEQ In nvi/seq.h. An abbreviation or a map entry.
-EXCMDARG
- In nvi/ex/excmd.h.stub. The structure that gets passed around
- to the functions that implement the ex commands. (The main
- ex command loop (see nvi/ex/ex.c) builds this up and then passes
- it to the ex functions.)
+TK The Tcl/Tk screen private data structure. Everything to
+ do standalone Tcl/Tk screens.
+
+EXCMD In nvi/ex/ex.h. The structure that gets passed around to the
+ functions that implement the ex commands. (The main ex command
+ loop (see nvi/ex/ex.c) builds this up and then passes it to the
+ ex functions.)
-VICMDARG
- In nvi/vi/vcmd.h. The structure that gets passed around to the
+VICMD In nvi/vi/vi.h. The structure that gets passed around to the
functions that implement the vi commands. (The main vi command
loop (see nvi/vi/vi.c) builds this up and then passes it to the
vi functions.)