home *** CD-ROM | disk | FTP | other *** search
- /*********
- * Function: _tr_errmsgs
- *
- * By: Tom Rettig
- *
- * Placed in the public domain by Tom Rettig Associates, 10/22/1990.
- *
- * char *_tr_errmsgs( (char*)calling function name, (int)message index )
- *
- * runtime error messages for functions returning <expC>
- *
- * calling function must pass its own name
- *
- *********/
-
- #include "trlib.h"
-
- char *_tr_errmsgs( funcname, message )
- char *funcname;
- int message;
- {
- static char *errmsg[] =
- { "TRLIB ERROR: ", /* prefix to all other errors */
- " SYNTAX",
- " ALLOCATING MEMORY",
- " OPENING FILE",
- " SEEKING FILE POSITION",
- " READING FILE",
- " WRITING FILE",
- " CLOSING FILE"
- };
- static char tempbuff[64] = " "; /* max error msg len is 63 including funcname */
- char *tp;
-
- tp = tempbuff;
- tp = _tr_strcpy( tp, errmsg[E_PREFIX] );
- tp = _tr_strcat( tp, funcname );
- return( _tr_strcat(tp,errmsg[message]) );
- }
-
-