The K Configuration Command
The K configuration command is used to associate a
symbolic name with a database-map type. The symbolic name will later
be used in the RHS of rules. The form of the K
command looks like this:
Kname type argsThe name is the symbolic name, the
type is the kind of database map to use,
and the args specifies its location and
properties. We describe each in turn.
The name
The name portion of the
K configuration command immediately follows the
K. Whitespace between the K and
the name is optional:
K name type args ↑optional whitespace
The name must begin with a letter or digit and can contain only letters, digits, and the underscore character:
K local_hosts ← good K $andcents← bad
The case of the letters in name does not matter. All names are converted to lowercase before they are stored:
K LOCAL_Hosts K local_hosts ← the same
If you begin a name with a bad character,
the following error will be printed and that K
line will be ignored:
configfile: line num: readcf: config K line: no map name
If a bad character appears in the middle of a name, the part
preceding the bad character will be taken as the
name, and the part following the bad character
will be taken as the type. For example,
the name me@home will
produce this error:
configfile: line num: readcf: map me: class home not available
The type
Recall that the type[2] portion of the
K configuration command follows the
name:
Kname type argsNote that whitespace between the name and the
type can be a joined indented ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access