Specify registry file¶
saf_setProps_Registry
is a function defined in libprops.c.
Synopsis:
-
int
saf_setProps_Registry
(SAF_LibProps *properties, const char *name)¶
Formal Arguments:
properties
: Library properties (See *Properties*)name
: Name of object registry file
Description: The registry consists of one or more SAF databases which will be consulted when an object query cannot be satisfied from the primary database. For instance, if the client performed a saf_find_one_unit to obtain a handle for something called “millimeter” and the find operation could not find any matching definition in the specified database, then each SAF registry database will be queried until a definition can be found or all registered registry files have been exhausted.
The library consults registries in the following order: First all files specified with the SAF__REGISTRIES
environment variable (if the variable is set to the word none’ then no registries are consulted). The
environment variable can specify multiple registries by separating them from one another with colons. Second,
all files registered with ``saf_setProps_Registry` are searched in the order they were specified. Third, a file
by the name of Registry.saf
in the current working directory, then the home directory (as specified by the
environment variable `HOME
’). Last, SAF will check for a file named Registry.saf
in the data installation
directory specified during the saf configuration with the –datadir’ switch (defaults to `/usr/local/share``).
Preconditions:
properties
must be a valid library properties handle. (low-cost)name
is required to be non-empty. (low-cost)
Return Value: A non-negative value on success. Otherwise this function either returns a negative error number or throws an exception, depending on the value of the library’s error handling property.
Issues: The library does not attempt to open the registry file until a database is opened. Therefore, specifying an invalid file name here will not result in an error until the call to saf_open_database is made.
See Also:
- saf_find_one_unit: 21.4: Convenience function for finding a unit
- saf_open_database: 7.3: Open a database
- Library Properties: Introduction for current chapter