3
"$Header: d:/cvsroot/tads/TADS2/LERMSG.C,v 1.2 1999/05/17 02:52:12 MJRoberts Exp $";
7
* Copyright (c) 1993 by Steve McAdams. All Rights Reserved.
9
* Please see the accompanying license file, LICENSE.TXT, for information
10
* on using and copying this software.
14
lermsg.c - Library ERorr message handling routines
20
01/04/93 SMcAdams - Creation from TADS errmsg.c
30
/*--------------------------------- lerini ---------------------------------*/
32
* lerini - allocate and initialize an error context. Returns a
33
* pointer to an initialized error context if successful, 0 otherwise.
37
errcxdef *errcx; /* error context */
39
/* allocate an error context */
40
if (!(errcx = ltk_suballoc(sizeof(errcxdef))))
43
return((errcxdef *)0);
46
/* initialize the error context */
47
errcx->errcxfp = (osfildef *)0; /* no error file handle */
48
errcx->errcxofs = 0; /* no offset in argument buffer */
49
errcx->errcxlog = ltk_errlog; /* error logging routine */
50
errcx->errcxlgc = errcx; /* error logging context */
52
/* return the new context */
57
/*--------------------------------- lerfre ---------------------------------*/
59
* lerfre - FREe error context allocated by errini.
62
errcxdef *errcx; /* error context to free */
64
/* free the context */
69
/*--------------------------------- errmsg ---------------------------------*/
71
* errmsg - format error message number 'err' into the given buffer.
73
void errmsg(ctx, outbuf, outbufl, err)
74
errcxdef *ctx; /* error context */
75
char *outbuf; /* output buffer */
76
uint outbufl; /* output buffer length */
77
uint err; /* error msg # to get */
79
sprintf(outbuf, "Error #%d occured.", err);
83
/*--------------------------------- errini ---------------------------------*/
85
* errini - initialize error system.
87
void errini(ctx, arg0)