DMOPENPROJECT(5ICD)

NAME
dmOpenProject - initiate a DDM project transaction

SYNOPSIS

#include "dmincl.h"
DM_PROJECT *dmOpenProject (dmpath, mode)
char *dmpath;
int mode;

PARAMETERS
identifies the project to be used. Either the path of the project directory or the value DEFAULT_PROJECT (current working directory). is the project access mode. Valid modes as predefined in "dmincl.h" are:

PROJ_READ -
the project is opened for read access.
PROJ_WRITE -
the project is opened for write access.
DEFAULT_MODE -
the project is opened for read and write access.

DESCRIPTION
Function dmOpenProject() initiates a project transaction. It returns a pointer to a DM_PROJECT data structure, containing information about the particular project, identified by dmpath and the access rights represented by mode. The DM_PROJECT data structure will be used as an argument to the functions in the cell transaction layer.

If a project transaction was already in progress on this project, the existing key will be returned immediately. External variable dmerrno will be set to DME_PRLOCK to signal this situation, but dmError() will not be called.

There are two predefined arguments for the function dmOpenProject(): DEFAULT_PROJECT and DEFAULT_MODE, which may be used when the tool operates in a default environment. If the specified dmpath is relative, dmOpenProject() tries to read the environment variable CWD to make an absolute path.

After a successful call to dmOpenProject() the dmpath member of the DM_PROJECT data structure will contain the absolute path of the project directory. This member should be used by tools that want to store / retrieve result files into / from the project directory.

DIAGNOSTICS
If properly executed, dmOpenProject() will return a pointer to a DM_PROJECT data structure. If dmOpenProject() fails 0 will be returned, after a call to function dmError() is done, and dmerrno will be set to indicate the error.
This might happen in the following cases:

DME_SYS
    Error in system call.

DME_BADPR
    Bad project.

DME_PRLOCK
    Project is locked.

DME_NODMRC
    Cannot open file ".dmrc".

DME_FMT
    Bad format.

DME_BADREL
    Bad release.

DME_NOINIT
    Not yet initialized.

FILES
.dmrc

SEE ALSO
dmCloseProject(5ICD).