*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->IRIX man pages -> ssdi (3c)              


SSDI(3C)							      SSDI(3C)

NAME    [Toc]    [Back]

     ssdi_get_config_and_load -	consult	configuration file and load DSO
     corresponding to the source for a given system database

SYNOPSIS    [Toc]    [Back]

     #include <ssdi.h>

     int ssdi_get_config_and_load(char *dbname,	struct ssdiconfiginfo *cfinfo,
	  struct ssdisrcinfo *srcinfo);

DESCRIPTION    [Toc]    [Back]

     The ssdi_get_config_and_load function provides the	means for an
     application to load the dynamic shared object (DSO) corresponding to a
     source for	a given	system database. A database is a collection of
     information related to users, groups, networks, etc. that the operating
     system expects to be maintained by	user-level libraries.  For example,
     information relating to users is encapsulated by the passwd database.
     Each such has a definite interface. For example, the getpwent(3C)
     routines define the interface for the passwd database.  The information
     contained in a given database  may	be stored in multiple sources. Almost
     all standard databases come with sources that are compiled-in with	the
     interface.	The files source for the passwd	database which maintains
     relevant information in files is one such.	 A Dynamic source for a
     database is one whose implementation is not fixed at the time of
     compilation of interface for the database.	 Thus, a dynamic source	allows
     for custom	implementations	of database repositories.

     The file /etc/ssdi.conf (see ssdi(4)) is used to add a dynamic source for
     a database.  Each application can cache configuration information for a
     given database using a variable of	type struct ssdiconfiginfo, which
     includes the following members:

     int  ssdi_ci_got_config	      If non-zero, the rest of the fields
				      contain configuration information.

     char *ssdi_ci_dsrcs[_SSDI_MAXSRCS]
				      Names of dynamic sources for the given

     char **ssdi_ci_currdsrc	      Next dynamic source to load. Pointer to
				      the name in the above array.

     Initially,	the variable used to cache configuration information should be
     set to _SSDI_InitConfigInfo.

     Each dynamic source should	be implemented as a DSO, and should reside in
     a standard	directory as defined by	_SSDI_STD_SRC_DIR. The DSO should
     export a variable which represents	a vector of functions. This vector
     contains addresses	of functions which implement corresponding
     functionality of the database interface. The correspondence between the
     vector and	the routines of	the database interface is defined in a
     database specific header file, <di_{database-name}.h>.  For example, the
     file <di_group.h> defines the correspondence for the group	database. If a

									Page 1

SSDI(3C)							      SSDI(3C)

     source does not implement a particular routine then the corresponding
     element in	the vector should be set to NULL.

     On	its very first invocation, ssdi_get_config_and_load function gathers
     information for the database dbname from the configuration	file, and
     caches it in the variable pointed to by cfinfo.  Then, it loads (using
     dlopen(3))	the DSO	corresponding to the first source listed in the
     configuration.  Information concerning the	loaded source is returned in
     srcinfo, which is of type struct ssdisrcinfo, and has the following

     char ssdi_si_name[_SSDI_MAXSRCNAME]
				      The name of the source that was loaded.

     _SSDI_VOIDFUNC  *ssdi_si_funcs   A	pointer	to the vector of routines
				      implemented by the source; resolved
				      using dlsym(3) from the DSO
				      corresponding to the source.

     On	subsequent invocations (with the same arguments),
     ssdi_get_config_and_load loads the	next source in the cached
     configuration information;	srcinfo	is overwritten with data from this new
     source.  Since  ssdi_get_config_and_load maintains	state between
     invocations in cfinfo, it should not be manipulated by the	caller,	except
     for proper	initialization before the first	invocation.

SEE ALSO    [Toc]    [Back]

     ssdi(4), dlopen(3), dlsym(3), getpwent(3C), getgrent(3C)

DIAGNOSTICS    [Toc]    [Back]

     If	a source was successfully loaded, ssdi_get_config_and_load returns
     zero. Otherwise, a	non-zero value is returned.

									PPPPaaaaggggeeee 2222
[ Back ]
 Similar pages
Name OS Title
mk_kernel HP-UX load a kernel configuration from a system file
debconf-loadtemplate Linux load template file into debconf database
rc.conf OpenBSD system daemon configuration database
rc.conf.local OpenBSD system daemon configuration database
rmdel Tru64 Removes a delta from a Source Code Control System (SCCS) file
delta Tru64 Saves editing changes in a Source Code Control System (SCCS) file
prs Tru64 Displays key information in a Source Code Control System (SCCS) file
sccsdiff Tru64 Compares two versions of a Source Code Control System (SCCS) file
get Tru64 Creates a specified version of a Source Code Control System (SCCS) file
svc.conf Tru64 Database service selection configuration file
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service