static char *SccsId = "@(#)dmclproj.c 3.7 (TU-Delft) 03/26/91";
/**********************************************************

Name/Version      : The Design Data Management Project

Language          : C
Operating system  : UNIX SYSTEM V
Host machine      : HP9000/S500

Author(s)         : S. de Graaf
                    A. van der Hoeven
                    T.G.R. van Leuken
                    N. van der Meijs
		    T. Vogel
		    P. van der Wolf
Creation date     : 04-Dec-1986
Modified by       : S. de Graaf
Modification date : 06-Jan-1988


        Delft University of Technology
        Department of Electrical Engineering
        Network Theory Section
        Mekelweg 4 - P.O.Box 5031
        2600 GA DELFT
        The Netherlands

        Phone : 015 - 786234

        COPYRIGHT (C) 1985-1988 , All rights reserved
**********************************************************/
#include "dmstd.h"

dmCloseProject (dmproject, mode)
DM_PROJECT * dmproject;
int mode;
{
#ifdef PRLOCK
    if (dmproject -> mode == PROJ_WRITE) {
	if (dmproject -> dmpath) {
	    _dmUnlockProject (dmproject -> dmpath);
	}
	else {
	    dmerrno = DME_PRLOCK;
	    dmError ("dmCloseProject");
	    return (-1);
	}
    }
#endif /* PRLOCK */
    if (mode == CONTINUE) return (dmCloseProjectContinue (dmproject));
    _dmRm_projectkey (dmproject);
    return (0);
}
