53 int cst_verrmsg(
const char *fmt, va_list args)
59 _vsnprintf(msg,256,fmt,args);
61 len = mbstowcs(NULL,msg,0) + 1;
63 mbstowcs(wmsg,msg,len);
65 OutputDebugStringW(wmsg);
70 int cst_errmsg(
const char *fmt, ...)
75 cst_verrmsg(fmt, args);
81 _E__pr_info_header_wofn(
char const *msg)
83 cst_errmsg(
"%s:\t", msg);
87 _E__pr_header(
char const *f,
long ln,
char const *msg)
89 cst_errmsg(
"%s: \"%s\", line %ld: ", msg, f, ln);
93 _E__pr_info_header(
char const *f,
long ln,
char const *msg)
95 cst_errmsg(
"%s: %s(%ld): ", msg, f, ln);
99 _E__pr_warn(
char const *fmt, ...)
104 cst_verrmsg(fmt, pvar);
109 _E__pr_info(
char const *fmt, ...)
114 cst_verrmsg(fmt, pvar);
119 _E__die_error(
char const *fmt, ...)
124 cst_verrmsg(fmt, pvar);
130 _E__fatal_sys_error(
char const *fmt, ...)
136 error = GetLastError();
138 cst_verrmsg(fmt, pvar);
141 OutputDebugStringW(L
"; ");
142 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
143 FORMAT_MESSAGE_FROM_SYSTEM |
144 FORMAT_MESSAGE_IGNORE_INSERTS,
151 OutputDebugString(msg_buf);
158 _E__sys_error(
char const *fmt, ...)
164 error = GetLastError();
166 cst_verrmsg(fmt, pvar);
169 OutputDebugStringW(L
"; ");
170 FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
171 FORMAT_MESSAGE_FROM_SYSTEM |
172 FORMAT_MESSAGE_IGNORE_INSERTS,
179 OutputDebugString(msg_buf);
184 _E__abort_error(
char const *fmt, ...)
189 cst_verrmsg(fmt, pvar);
#define ckd_calloc(n, sz)
Macros to simplify the use of above functions.
Sphinx's memory allocation/deallocation routines.
SPHINXBASE_EXPORT void ckd_free(void *ptr)
Test and free a 1-D array.
Implementation of logging routines.