1 # @(#)structures 5.2 (Berkeley) 11/1/93
3 There are three major data structures in this package. The first is a
4 single global structure (named GS) which contains information common to
5 all files and screens. It's really pretty tiny, and functions more as a
6 single place to hang things than anything else.
8 The second and third structures are the file structures (named EXF) and
9 the screen structures (named SCR). They contain information theoretically
10 unique to a screen or file, respectively. Each SCR structure has a set
11 of functions which update the screen and/or return information about the
12 screen from the underlying screen package.
14 The GS structure contains linked lists SCR structures. The structures
15 can also be classed by persistence. The GS structure never goes away
16 and the SCR structure persists over instances of files.
18 File names have different properties than files themselves, so the name
19 information for a file is held in an FREF structure which is chained from
22 In general, functions are always passed an SCR structure and often an EXF
23 structure as well. The SCR structure is necessary for any routine that
24 wishes to talk to the screen, the EXF structure is necessary for any
25 routine that wants to modify the file. The relationship between an SCR
26 structure and its underlying EXF structure is not fixed, and although you
27 can translate from an SCR to the underlying EXF, it is discouraged. If
28 this becomes too onerous, I suspect I'll just stop passing around the EXF
31 The naming of the structures is consistent across the program. (Macros
32 even depend on it, so don't try and change it!) The global structure is
33 "gp", the screen structure is "sp", and the file structure is "ep".
35 A few other data structures:
37 TEXT In nvi/cut.h. This structure describes a portion of a line,
38 and is used by the input routines and as the "line" part of a
41 CB In nvi/cut.h. A cut buffer. A cut buffer is a place to
42 hang a list of TEXT structures.
44 MARK In nvi/mark.h. A cursor position, consisting of a line number
47 MSG In nvi/msg.h. A chain of messages for the user.
49 SEQ In nvi/seq.h. An abbreviation or a map entry.
52 In nvi/ex/excmd.h.stub. The structure that gets passed around
53 to the functions that implement the ex commands. (The main
54 ex command loop (see nvi/ex/ex.c) builds this up and then passes
55 it to the ex functions.)
58 In nvi/vi/vcmd.h. The structure that gets passed around to the
59 functions that implement the vi commands. (The main vi command
60 loop (see nvi/vi/vi.c) builds this up and then passes it to the