openproj(3c) openproj(3c)
openproj, closeproj - create/destroy a PROJ token
#include <proj.h>
PROJ openproj(const char *project, const char *projid);
void closeproj(PROJ token);
The opendir function is used to create a PROJ token. The closedir
function is used to destroy it when it is no longer needed.
The getprojuser family of functions (including projid, projname,
getprojall, getprojuser, getdfltprojuser and validateproj) is used to
extract information from the project and projid files. Because these
functions open, read, and close the project and projid files, they can be
inefficient if it is necessary to use them repeatedly in the same
program. Therefore, a second set of parallel functions is provided that
is slightly more complex to use but runs more efficiently and is
appropriate when repeated queries to the project and projid files are
required.
The second set of functions makes use of a PROJ token to maintain various
state information that reduces the overhead associated with repeated
accesses to the project and projid files. These functions are identical
to their "simple" counterparts with the following exceptions:
The function names are prefixed with the letter "f".
An additional argument, the PROJ token itself, is included at the
beginning of each function's argument list.
The openproj function is used to create the PROJ token. It takes two
arguments, the pathnames to the project and projid files. NULL can be
specified for either or both of these arguments, in which case the system
default pathnames (/etc/project and /etc/projid, respectively) will be
used. The closeproj function can be used to delete the PROJ token and
release any resources associated with it when processing is finished.
/etc/project System project authorization file.
/etc/projid System project name to project ID mappings.
getdfltprojuser(3C), getprojall(3C), getprojuser(3C), projid(3C),
validateproj(3C), project(4), projid(4), projects(5).
Page 1
openproj(3c) openproj(3c)
openproj returns a PROJ token if successful, or NULL if not.
Both functions use fopen(3S) and are thus subject to its limitations.
Project information should be (optionally) obtained via NIS.
PPPPaaaaggggeeee 2222 [ Back ]
|