ReactOS 0.4.15-dev-5666-gc548b97
amsg.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/sdk/crt/misc/amsg.c
5 * PURPOSE: Print runtime error messages
6 * PROGRAMER: Ariadne
7 * UPDATE HISTORY:
8 * 28/12/98: Created
9 */
10
11#include <precomp.h>
12
13static char *__rt_err_msg[] =
14{
15 "stack overflow", /* _RT_STACK */
16 "null pointer assignment", /* _RT_NULLPTR */
17 "floating point not loaded", /* _RT_FLOAT */
18 "integer divide by 0", /* _RT_INTDIV */
19 "not enough space for arguments", /* _RT_SPACEARG */
20 "not enough space for environment", /* _RT_SPACEENV */
21 "abnormal program termination", /* _RT_ABORT */
22 "not enough space for thread data", /* _RT_THREAD */
23 "unexpected multithread lock error", /* _RT_LOCK */
24 "unexpected heap error", /* _RT_HEAP */
25 "unable to open console device", /* _RT_OPENCON */
26 "non-continuable exception", /* _RT_NONCONT */
27 "invalid exception disposition", /* _RT_INVALDISP */
28 "not enough space for _onexit/atexit table", /* _RT_ONEXIT */
29 "pure virtual function call", /* _RT_PUREVIRT */
30 "not enough space for stdio initialization", /* _RT_STDIOINIT */
31 "not enough space for lowio initialization", /* _RT_LOWIOINIT */
32};
33
34
35/*
36 * @implemented
37 */
38typedef void (*aexit_t)(int);
40
41/*
42 * @implemented
43 */
44void _amsg_exit(int errnum)
45{
46 if ((errnum >=0) && (errnum < sizeof(__rt_err_msg)/sizeof(__rt_err_msg[0])))
47 fprintf(stderr, "runtime error - %s\n", __rt_err_msg[errnum]);
48 else
49 fprintf(stderr, "runtime error - %d\n", errnum);
50 _exit(-1);
51}
52
void _exit(int exitcode)
Definition: _exit.c:25
void(* aexit_t)(int)
Definition: amsg.c:38
void _amsg_exit(int errnum)
Definition: amsg.c:44
aexit_t _aexit_rtn
Definition: amsg.c:39
static char * __rt_err_msg[]
Definition: amsg.c:13
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define stderr
Definition: stdio.h:100
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)