83 va_start(ap, message);
95 fprintf(stderr,
"wsc: fatal: ");
98 vfprintf(stderr, fmt, ap);
101 fprintf(stderr,
"\n");
158 va_start(ap, message);
179 va_start(ap, message);
204 for (
start = 0, i = 0; fmt[i]; i++)
205 if (fmt[i] ==
'%' && fmt[i + 1]) {
212 unsigned int width = 0;
214 if (fmt[i + 1] ==
'%') {
246 while (
'0' <= fmt[i] && fmt[i] <=
'9') {
248 width += fmt[i++] -
'0';
255 ival = (int) va_arg(ap,
int);
257 snprintf(buf,
sizeof(buf),
"%c", (
char) ival);
262 cp = va_arg(ap,
char *);
266 ival = va_arg(ap,
int);
268 snprintf(buf,
sizeof(buf),
"%d", ival);
273 uival = va_arg(ap,
unsigned int);
275 snprintf(buf,
sizeof(buf),
"%u", uival);
280 uival = va_arg(ap,
unsigned int);
282 snprintf(buf,
sizeof(buf),
"%x", uival);
287 ws_fatal(
"ws_vfprintf(): format %%%c not implemented", fmt[i]);
293 (*io)(cp, strlen(cp),
context);
296 if (width > strlen(cp)) {
298 int amount = width - strlen(cp);
306 (*io)(cp, strlen(cp),
context);
320 (*io)(str, strlen(str),
context);
void ws_fatal(char *fmt,...)
gw_assert(wtls_machine->packet_to_send !=NULL)
#define WS_ERROR_B_SYNTAX
#define WS_ERROR_B_SEMANTIC
void ws_fprintf(WsIOProc io, void *context, const char *fmt,...)
void ws_src_warning(WsCompilerPtr compiler, WsUInt32 line, char *message,...)
void ws_error_syntax(WsCompilerPtr compiler, WsUInt32 line)
#define WS_ERROR_B_MEMORY
WsUInt32 last_syntax_error_line
void ws_puts(WsIOProc io, void *context, const char *str)
#define WS_LINE_TERMINATOR
void ws_vfprintf(WsIOProc io, void *context, const char *fmt, va_list ap)
void ws_src_error(WsCompilerPtr compiler, WsUInt32 line, char *message,...)
void ws_error_memory(WsCompilerPtr compiler)
void ws_info(WsCompilerPtr compiler, char *message,...)
void(* WsIOProc)(const char *data, size_t len, void *context)
void ws_fputc(int ch, WsIOProc io, void *context)