evltc(1)

NAME

evltc - Compile formatting templates

SYNOPSIS

evltc   sourcefile  [-f | --func]  [-n | --noto]
        [-c | --cpp]  [cpp_options]
or
evltc  binfile.to

DESCRIPTION

The evltc command reads the formatting template specifica
tion(s) in sourcefile and creates a binary template file for each specification. sourcefile may not define two templates with the same event_type, even if they are for different facilities. Binary files are created in the
directory where sourcefile resides.

If the name of the specified file ends in .to, it is
assumed to be a binary template file. It is read, and if
it contains an event-record template, the corresponding
sample call to the evl_log_write() function is printed, as with -f. In this case, the -f and -n options (if speci
fied) are ignored, and any cpp-related options are flagged
as errors.

The binary file for an event-record template is named
eventtype.to, where eventtype is the hexadecimal event type. For a facility's default template, the binary file
is named default.to.

The binary file for a struct template is named struct_ name.to.

If the source file contains any errors, no binary files
are produced, and error messages are written to stderr.

The algorithm for finding a struct template that is refer
enced by another template is as follows:

(1) The struct_path from the import statement is converted
into a relative pathname by replacing all periods with
slashes and appending .to. For example, gui.graph
ics.point becomes gui/graphics/point.to.

(2) This relative pathname is applied to each of the fol
lowing directories in turn until a file is found:
(a) the directory in which the current template source
file resides.
(b) the directories specified in the EVLTMPLPATH environ
ment variable (a colon-delimited list of directories). If
the EVLTMPLPATH environment variable is not defined, the
directories /var/evlog/templates/$LANG and /var/evlog/tem
plates are searched, in that order.
(3) The selected template file is read into memory if it
is not already there.
It is neither necessary nor permitted to import a template
with the same name as one previously defined in the cur
rent template source file, unless the imported template is
from a different directory. See Example 3 (below).

OPTIONS

-f, --func
When this option is specified, a sample call to the
evl_log_write() function is created. Such a call
could be used to log an event record whose format
matches the template.
-n, --noto
Compile the template source and report errors as
appropriate, but do not write out the binary tem
plate file(s).
-c, --cpp
Run sourcefile through the C preprocessor, /lib/cpp, and compile the result. The contents of
sourcefile are unchanged.
-D macro[=defn]
Passed to the C preprocessor. Implies -c.
-U macro
Passed to the C preprocessor. Implies -c.
-I dir
Passed to the C preprocessor. Implies -c.

EXAMPLES

Example 1.

Suppose the file VolMgr.t contains the following text.

ArrayRecovery Status: %recovery_stat%
Sense Bytes:
%sense_bytes%

Recommended repair action:
%repair_action%

ArrayEND
import statusRegister; /* ILLEGAL */

FILES

/var/evlog/templates - Formatting template repository
Copyright © 2010-2025 Platon Technologies, s.r.o.           Home | Man pages | tLDP | Documents | Utilities | About
Design by styleshout