


DMERROR(5ICD)		     9/18/85		    DMERROR(5ICD)



NNNNAAAAMMMMEEEE
     dmError, dmPerror - DDM error message functions

SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
     ####iiiinnnncccclllluuuuddddeeee """"ddddmmmmiiiinnnnccccllll....hhhh""""

     ddddmmmmEEEErrrrrrrroooorrrr ((((ssss))))
     cccchhhhaaaarrrr ****ssss;;;;

     ddddmmmmPPPPeeeerrrrrrrroooorrrr ((((ssss))))
     cccchhhhaaaarrrr ****ssss;;;;


PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
     ssss	     specifies the name of the program that generated the
	     error, or the argument of a DDM function to which
	     the error message applies.

DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
     Function ddddmmmmPPPPeeeerrrrrrrroooorrrr(((()))) produces a short error message on _s_t_d_e_r_r
     output describing the last error encountered during a call
     to the DDM system function from an application program.
     First the argument string ssss is printed, then a colon, then
     the message and a newline.  The error number is taken from
     the external variable ddddmmmmeeeerrrrrrrrnnnnoooo (see _d_m_i_n_t_r_o(5ICD), which is
     set when errors occur but not cleared when non-erroneous
     calls are made.

     To simplify variant formatting of messages, the vector of
     message strings ddddmmmmeeeerrrrrrrrlllliiiisssstttt[[[[]]]] is provided; External variable
     ddddmmmmeeeerrrrrrrrnnnnoooo can be used as an index in this table to get the
     corresponding message string without the newline.	Variable
     ddddmmmmeeeerrrrrrrrnnnnoooo may not be greater than ddddmmmmnnnneeeerrrrrrrr, which is set to the
     number of messages provided for the table.  The external
     variable ddddmmmmnnnneeeerrrrrrrr should be checked because new error codes
     may be added to the DDM system before they are added to the
     table.

     Function ddddmmmmEEEErrrrrrrroooorrrr(((()))) is called by the Interface Functions
     itself, when they detect an error, i.e. when they actually
     set ddddmmmmeeeerrrrrrrrnnnnoooo.  The function dmError() will then call dmPer-
     ror(), to produce the corresponding message automatically on
     _s_t_d_e_r_r output.  This is to simplify the error handling of
     the application program.  In case the application wants to
     provide the error messages itself, the application program-
     mer must provide his own (possibly dummy-) dmError() func-
     tion.  For example, you might want to display the errors in
     a special window on your graphics device.







		   The Nelsis IC Design System			1






DMERROR(5ICD)		     9/18/85		    DMERROR(5ICD)



     To show how the error messages are handled, here follows the
     source code listings of the functions dmError() and dmPer-
     ror().

     #include "stdio.h"
     #include "dmincl.h"

     dmError (s)
     char   *s;
     {
	 dmPerror (s);
     }

     dmPerror (s)
     char   *s;
     {
	 if (s && *s != '\0')
	     fprintf (stderr, "%s: ", s);

	 if (dmerrno > 0 && dmerrno <= dmnerr)
	     fprintf (stderr, "%s\n", dmerrlist[dmerrno]);
	 else
	     fprintf (stderr, "DDM error number: %d\n", dmerrno);
     }


SSSSEEEEEEEE AAAALLLLSSSSOOOO
     dmintro(5ICD).



























2		   The Nelsis IC Design System



