READLDM(5ICD)

NAME
readldm, freadldm - read an LDM file

SYNOPSIS

readldm (file)
char *file;

freadldm (fp)
FILE *fp;

PARAMETERS
Name of the file which must be read. specifies an open file which must be read.

DESCRIPTION
Readldm and freadldm are routines that will read the specified LDM file, and update the internal LDMC datastructure with the new information. The cells defined in the LDM file are treated exactly the same as cells defined in the LDMC program internally, and are also echo'ed to the output. Note that this differs from the way how dbread and dbreadl(5ICD) behave. If this is not desired, you can use a call

    setout("/dev/null");

before readldm.

This routine is also very useful to read the output of other layout generator programs, either written in LDMC or not. Examples of such programs may even be placement/routing programs.

RETURN VALUE
Both readldm and freadldm return the number of succesfully read cells, which may be 0, e.g. if the file is empty. On error, -1 is returned and ll_errno is set to indicate the error.

SPECIAL CONSIDERATIONS
The LDM file is parsed by a special program (parseldm) in a separate process. The parser checks the syntax and translates the LDM file in a fixed-format temporary file, with optional fields in the LDM statements all fully specified. This format is then easily read by the readldm routine. This arrangement avoids the size overhead of having a complete LDM parser linked into every program using the readldm routine.

SEE ALSO
ldmcintro(5ICD)