LL_ERROR(5ICD)

NAME
ll_error, ll_perror - LDMC error handling

SYNOPSIS

#include "ll_errno.h"

ll_error (s)
char *s;

ll_perror (s)
char *s;

extern int ll_errno;
extern int ll_nerr;
extern char *ll_errlist[];

PARAMETERS
specifies the argument of an LDMC function to which the error message applies.

DESCRIPTION
When the functions in the LDMC library detect an error, this is indicated by an otherwise impossible return value. This is usually -1 for integer functions, or NULL for functions returning a pointer to something; the individual manual pages give the details. Additionally, when an error is detected, the exteral variable ll_errno is set to indicate the error, and the function ll_error() is called. The function ll_error() will then call ll_perror(), to produce the actual message. The variable ll_errno is not cleared when non-erroneous calls are made, so it should be checked only when an error has occured.

The function ll_perror() produces a short error message in the LDMC output describing the last error encountered during a call to the LDMC system function from an application program. First the string :ERROR: is printed, then the name of the function that caused the error and a colon, then the argument string s, then again a colon, followed by the message and a newline. The error number is taken from the external variable ll_errno.

In case the application wants to do more elaborate error handling, ll_error can be redefined to include the application-specific actions, ll_perror can then still be called.

Moreover, to simplify variant formatting of error messages, the vector of message strings ll_errlist is provided. The external variable ll_errno can be used as an index in this table to get the corresponding message string without the newline. The number of messages currently in the table is given by the external variable ll_nerr. This variable should be checked because new error codes can be added to the LDMC system before they are added to the table.

The following is a list of the errors and their names as given in "ll_errno.h".

LLE_SYS - unix error
    An unix error occured, for example, a file that can't be opened, a read or write error etc. The variable errno can be checked to determine the error. (See intro(2).)

LLE_LDMC - LDMC internal error
    An internal error in the LDMC system occured.

LLE_ASSERT - LDMC assertion failed
    Another internal error in the LDMC system.

LLE_NOINST - Can't find instance
    An instance name was specified, but this instance does not exist.

LLE_NOMOD - Can't find cell
    A cell name was specified, but this cell does not exist.

LLE_NOTERM - Can't find terminal
    A terminal name was specified, but this terminal does not exist.

LLE_MULT - Cell already defined
    A cell name was specified, but this cell already exists.

LLE_TNUSED - Terminal name already used
    A terminal name was specified, but this terminal already exists.

LLE_INUSED - Instance name already used
    An instance name was specified, but this instance name is already used.

LLE_MSEXP - Ms expected
    A layout primitive is generated, but there was not a ms-statement before.

LLE_MEEXP - Me expected
    There were more ms-statements then me-statements.

LLE_BADMOD - Cell not OK
    The cell that is called as a subcell contains an error.

LLE_COORD - Bad coordinates
    The coordinates from the box or terminal function are invalid, i.e. when xl >= xr or yb >= yt.

LLE_MIR - Bad mirror specification
    A mirror argument, for example from mc() or abut(), is not one of M0, MX or MY.

LLE_ROT - Bad rotation specification
    A rotation argument, for example from mc() or abut(), is not one of R0, R90, R180, or R270.

LLE_REP - Bad repetition
    A repetion number is < 0.

LLE_SIDE - Bad side
    A side specifier is not one of 'l', 'r', 'b' or 't'.

LLE_DIR - Bad direction
    A direction specifier is not one of 'x' or 'y'.

LLE_NAME - Bad name
    The name that was specified is not a valid name. A name can consist of letters, digits and underscores, but the first character can not be a digit.

LLE_MASK - Bad mask
    Specified mask name or mask id is invalid.

LLE_OPEN - Can't open file
    A file can't be opened, the variable errno can be checked for more details.

LLE_PITCH - Can't find pitch of cell
    The "xt" or "yt" key was specified, and the cell does not have terminals defining the pitch in the x- or y-direction respectively.

LLE_ROOM - Need more room
    The channel area for the river routing is not large enough.

LLE_TECH - Technology description error.
    An error occured in reading the technology information.

LLE_ABUT - Can't abut
    The terminals of the cell and the instance of abut do not conform for abutment.

LLE_KEY - Bad key
    A key, for example from getterm, contains a illegal characters.

LLE_PATTERN - Bad pattern
    The pattern argument of tup() was invalid.

LLE_PARSE - LDM parser error
    A syntax error in the LDM file that was read by readldm() or freadldm().

LLE_SIGNAL - Signal
    A signal was caught.

LLE_DBERROR - Database error
    An error occured while reading a database. The variable db_errno can be checked for more details.

LLE_CORE - No more core
    The system allocation routine failed.

LLE_BADARG - Bad argument to LDMC function
    Various bad arguments not covered by one of the other errors, for example, a NULL pointer.