Specify location of SAF’s standard types database¶
SAF_REGISTRIES
is a symbol defined in init.c.
Synopsis:
-
SAF_REGISTRIES
¶
Description: This is a string valued environment variable that holds colon (‘:’) separated list of pathnames files from where SAF will obtain predefined type definitions. If this variable is not set, SAF will build an use a transient database containing a minimal set of pre-defined types. In typical usage, this variable need not be set.
By default, SAF will generate a minimal, memory resident registry that is destroyed when saf is finalized. This
permits SAF to operate in such a way that it does not need to access some registry file on disk somewhere to
properly initialize. However, other, disk resident registry files can be opened if either the env. variable,
SAF__REGISTRIES
, is set and/or the client has specified a specific registry with the initialization properties.
Files specified by the SAF__REGISTRIES
env. variable are first in the list followed by those specified by the
initialization properties. In this way, if SAF__REGISTRIES
is specified, the definitions of symbols there take
precedence over those that may also exist in the file(s) specified by the initialization properties.
If SAF__REGISTRIES
is set to the string “implicit”, it will look for a file named Registry.saf in the
usual places, namely in the current working directory, then in the user’s home directory and finally in the
SAF installation directory.
Errors will be reported for registries specified explicitly by environment variables
and/or calls to saf_SetProps_Registry
, but not for the implicit locations. A warning will be issued if no
registry can be found at all.
Finally, if SAF__REGISTRIES
is set to the string “none”, then no registries will be
opened, not even the minimal, memory resident one. If SAF__REGISTRIES
is set to the string “default” then only the
minimal registry will be opened. That is, you can force SAF to ignore all registries specified by a client through
the initialization properties by setting SAF__REGISTRIES
to “default”.
Note that the order in which filenames are specified is important. When SAF needs to look up a pre-defined
datatype, it searches its known registries in the order in which they were specified in SAF__REGISTRIES
,
then those specified with saf_setProps_Registry. SAF returns the first matching referenced type.
See Also:
- Environment: Introduction for current chapter