DMGETDESIGNDATA(5ICD)

NAME
dmGetDesignData, dmPutDesignData - get/put data from/to the database

SYNOPSIS

#include "dmincl.h"
dmGetDesignData (dmstream, fmt)
DM_STREAM *dmstream;
int fmt;
dmPutDesignData (dmstream, fmt)
DM_STREAM *dmstream;
int fmt;

PARAMETERS

dmstream
    is a pointer to a valid DM_STREAM as obtained from function dmOpenStream(). It is the access key of a named stream from / to which the data is read or written.

fmt is an integer which determines the internal format that is to be used for read or write operations.

DESCRIPTION
These functions must be used to shield the programmer as much as possible from the internal representation of the data in the database (for instance, the data may be in PACKED format). The data requested from the database is returned in an external structure, one for each type, which is specified by the argument fmt.

In the include file "dmincl.h", for each type the corresponding value of the argument fmt is given plus the definition and the name of the structure in which the data is conveyed to and from the database.

For each possibility for the argument fmt, a 'macro' has been defined. It is strongly advised to use these macro's instead of ordinary numbers for the argument fmt, since it makes your application less dependent. See the include file "dmincl.h" for all macro names and data types.

EXAMPLE
/* the error handling has been omitted */
         .
         .
key = dmCheckOut (dmproject, cell, WORKING, DONTCARE, LAYOUT, ATTACH);
fp_boxlay = dmOpenStream (key, "np_bxx", "r");
fp_vlnlay = dmOpenStream (key, "np_vln", "w");
while (dmGetDesignData (fp_boxlay, GEO_BOXLAY) > 0) {
    xl = gboxlay.xl;
    xr = gboxlay.xr;
        .
        .
    gvlnlay.x = xl;
    gvlnlay.occ_type = occ_type;
        .
        .
    dmPutDesignData (fp_vlnlay, GEO_VLNLAY);
}
dmCheckIn (key, COMPLETE);

DIAGNOSTICS
Function dmGetDesignData() returns the number of items read, if successful. When EOF is reached 0 will be returned. If dmGetDesignData() fails -1 will be returned, external variable dmerrno will be set to DME_GET, and a call to function dmError() will be done.

Function dmPutDesignData() returns 0, if successful. If dmPutDesignData() fails -1 will be returned, external variable dmerrno will be set to DME_PUT, and a call to function dmError() will be done.

Both functions return -1 if an unknown fmt is specified, external variable dmerrno will be set to DME_FMT, and a call to function dmError() will be done.

SEE ALSO
Documentation on the format definition for the layout, circuit and floorplan view.