/**************************************************************************/
/*                                                                        */
/*                                 Sources                                */
/*                                from  the                               */
/*                           XSC SOFTWARE PACKAGE                         */
/*                                                                        */
/*                Copyright (c) 1997 University of Karlsruhe              */
/*                     Institute for Appl. Mathematics                    */
/*                                                                        */
/* This program is free software for non-commercial use. For details, see */
/* the file LICENSE.XSC, distributed with this software package.          */
/*                                                                        */
/* This program is distributed WITHOUT ANY WARRANTY. For details, see the */
/* file LICENSE.XSC, distributed with this software package.              */
/*                                                                        */
/**************************************************************************/

/* RCS $Id: d_vlcp.c,v 1.2 1997/09/25 17:15:28 ae59 Exp $ */
/*
$Log: d_vlcp.c,v $
 * Revision 1.2  1997/09/25  17:15:28  ae59
 * Copyright-message
 *
 * Revision 1.1  1994/01/27  13:22:11  ae59
 * Put under RCS control
 *
 */
/****************************************************************/
/*                                                              */
/*      Filename        : d_vlcp.c                              */
/*                                                              */
/*      Entry           : void d_vlcp(d)                        */
/*                        d_otpr *d;                            */
/*                                                              */
/*      Arguments       : d - dotprecision variable             */
/*                                                              */
/*      Description     : copy value-parameter if temporary-flag*/
/*                        is FALSE, otherwise set temporary-flag*/
/*                        FALSE                                 */
/*                                                              */
/*      Date            : 1991-10-10                            */
/*      1991-10-10 : (char *) cast for malloc()                 */
/*      1991-03-14 : message number changed to E_TMSG=40        */
/*      1991-01-17 : type of local variable n changed to size_t */
/*      1990-11-12 : E_TPUSH+E_TPOPP                            */
/****************************************************************/

#ifndef ALL_IN_ONE
#ifdef AIX
#include "/u/p88c/runtime/o_defs.h"
#else
#include "o_defs.h"
#endif
#define local
#endif

#ifdef LINT_ARGS
local void d_vlcp(d_otpr *d)
#else
local void d_vlcp(d)

d_otpr *d;
#endif
        {
        char *p;
        size_t n;

        E_TPUSH("d_vlcp")

        if (((*d)[A_STATUS] & A_TEMPORARY)==FALSE)
           {
           if ((p = (char *)malloc(n = A_LENGTH*sizeof(a_btyp)))==NULL)
              {
              e_trap(ALLOCATION,2,E_TMSG,40);

              E_TPOPP("d_vlcp")
              return;
              }
#ifdef HEAP_CHECK
b_freh((a_char *)d,(a_char *)p,(a_char *)"d_vlcp");
#endif
           C_COPY(p,(char *)(*d),n)
           *d = (d_otpr)p;
           }
        else
           (*d)[A_STATUS] &= ~A_TEMPORARY;

        E_TPOPP("d_vlcp")
        }
